- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Error with read() function in C program
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2010 10:30 AM
тАО10-27-2010 10:30 AM
Re: Error with read() function in C program
The read system call will return EINVAL if the current file offset is not a multiple of the block size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2010 12:30 PM
тАО10-27-2010 12:30 PM
Re: Error with read() function in C program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:13 PM
тАО10-28-2010 12:13 PM
Re: Error with read() function in C program
-----
7635-15:50:24.529-log -- Commiting After Cache. --
7635-15:53:17.624-log Unable to read from client (0/8) errno(25)
7635-15:53:17.629-log sd : '3'
7635-15:53:17.629-log buffer: '99960000'
------
Notice that the errno changed from 22 to 25. 25 is ENOTTY (Not a typewriter.) Why am I getting the errno=25 and how do I resolve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 12:50 PM
тАО10-28-2010 12:50 PM
Re: Error with read() function in C program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 01:05 PM
тАО10-28-2010 01:05 PM
Re: Error with read() function in C program
Again, a read return of zero means the remote end of the TCP connection has called close or shutdown. Or at least it is supposed to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 01:18 PM
тАО10-28-2010 01:18 PM
Re: Error with read() function in C program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2010 01:44 PM
тАО10-28-2010 01:44 PM
Re: Error with read() function in C program
One way to confirm this (hopefully Dennis can confirm) I suppose is to explicitly set errno to 0 before the call to read() and then see what it says after.
I think you are chasing after red herrings. Read return of zero against a file descriptor associated with a TCP connection means the remote has closed his end of the connection. The remote has indicated it will be sending no more data to be read. Further, read return of zero is given only after all previously sent data has been "consumed" (read) it means you have already seen all the data you are going to see.
If this is then happening at an unexpected time, it suggests not a problem with the read() call (well apart from the broken assumption about always getting sz bytes) but with the "application protocol" between your client and server. Somehow they have gotten out of sync with one another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 05:04 AM
тАО10-29-2010 05:04 AM
Re: Error with read() function in C program
(You're too quick for me.)
Right, you have no business looking at errno, unless you get that -1 return:
When an end-of-file is reached, a value of 0 is returned. Otherwise, a -1 is returned and errno is set to indicate the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 09:49 AM
тАО10-29-2010 09:49 AM
Re: Error with read() function in C program
Curtis
- « Previous
-
- 1
- 2
- Next »