HPlogo Berkeley Sockets/iX Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 File System Intrinsics

CLOSE, SCLOSE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

NOTE: This routine is called sclose for non-POSIX users, and is called close for POSIX users.

C Interface

       int close (s)

       int s;



       int sclose (s)

       int s;

Description

Closes the socket descriptor indicated by s. If this file descriptor is the last reference to the socket, then it is deactivated. For example, on the last close of a socket, associated naming information and queued data are discarded.

The SO_LINGER option of setsockopt can be used to determine what happens to data queued at the time of the close.

For more information about close or any other POSIX function, refer to the MPE/iX Developer's Kit Reference Manual, Volume 1.

Return Value

If the call completes successfully, a value of 0 is returned. If the call is unsuccessful, a value of -1 is returned and errno is set to indicate the error.

Errors

The following error is returned by close:

[EBADF]

The argument s is not a valid descriptor.

See Also

getsockopt, setsockopt

Feedback to webmaster