Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
tcperror() z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
When a socket call produces an error, the call returns a negative value and the variable errno is set to an error value found in TCPERRNO.H. The tcperror() call prints a short error message describing the last error that occurred. If s is non-NULL, tcperror() prints the string s followed by a colon, followed by a space, followed by the error message, and terminating with a new-line character. If s is NULL or points to a NULL string, only the error message and the new-line character are output. The tcperror() function is equivalent to the UNIX perror() function.
Example 1
If the socket() call produces error ENOMEM, socket()
returns a negative value and errno is set to ENOMEM. When tcperror()
is called, it prints the string:
Example 2
If the socket() call produces error
ENOMEM, socket() returns a negative value and errno is set
to ENOMEM. When tcperror() is called, it prints the string:
|
Copyright IBM Corporation 1990, 2014
|