DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications over TCP/IP using Internet sockets

Error handling in programming (Internet domain)

Generally, each system service maps its error conditions to the generic error codes defined by the operating system. However, some errors have been added especially for SCO TCP/IP.

Check for error returns after every system call. Most calls have associated error values which are described in the manual page for the call. An error condition is indicated by an otherwise impossible return value, usually -1. An error number is provided in the external variable errno, which is set only when an error occurs and is not cleared on successful calls. Consequently, check it only after an error has been indicated. Use perror(S) to print error messages. With sockets, if information at the sending node indicates that the message cannot be delivered (for instance, when a network is unreachable), the call returns -1 and the global variable errno contains an error number.


Next topic: List of error codes (Internet domain)
Previous topic: Adding and checking for services (Internet domain)

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003