Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (a - d) close(2)
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
To use this function in a 32-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, perform the same tasks (described above) used to make the function
thread-aware in a multi-threaded application on systems running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, you must perform all of the following tasks to make the function thread-
aware in a multi-threaded application:
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Compile the application using the -Wlp64 compiler command option.
Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmers Guide.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned,
and errno is set to indicate the error.
ERRORS
If any of these conditions occur, the close() function sets errno to the corresponding value:
[EBADF] The filedes parameter is not a valid open file descriptor.
[EIO] An input or output error occurred. The device that the file is stored on might be
in the down state, or both processors that provide access to the device might
have failed.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
For all other error conditions, errno is set to the appropriate Guardian file-
system error number. See the Guardian Procedure Errors and Messages
Manual for more information about a specific Guardian file-system error.
RELATED INFORMATION
Functions: exec(2), fcntl(2), getsockopt(2), open(2), pipe(2), setsockopt(2), socket(2),
spt_closez(2), tdm_execve(2), tdm_execvep(2).
Files: signal(4).
STANDARDS CONFORMANCE
This function does not return the errno value [EINTR].
For an AF_INET or AF_INET6 socket, even if all these are true:
The socket is connection-oriented.
The SO_LINGER option is enabled for the socket.
527186-023 Hewlett-Packard Company 135