VMS Help
TCPIP Services, Programming Interfaces, Sockets API, getsockopt()
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Returns the options set on a socket.
The $QIO equivalent is the IO$_SENSEMODE function.
Format
#include <types.h>
#include <socket.h>
int getsockopt ( int s, int level, int optname, char *optval,
unsigned int *optlen );
s
A socket descriptor created by the socket() function.
level
The protocol level for which the socket options are desired. It
can have one of the following values:
SOL_SOCKET Get the options at the socket level.
p Any protocol number. Get the options for
protocol level specified by p. See the IN.H
header file for the various IPPROTO values.
optname
Interpreted by the protocol specified in the level. Options at
each protocol level are documented with the protocol.
For descriptions of the supported socket level options, see the
description of setsockopt() in this chapter.
optval
Points to a buffer in which the value of the specified option
should be placed by getsockopt().
optlen
Points to an integer containing the size of the buffer pointed
to by optval. On return, the integer is modified to contain the
actual size of the option value returned.
This function gets information on socket options. See the
appropriate protocol for information about available options
at each protocol level.
0 Successful completion.
-1 Error; errno is set to indicate the error.
EACCES The calling process does not have appropriate
permissions.
EBADF The socket descriptor is invalid.
EDOM The send and receive timeout values are too
large to fit in the timeout fields of the
socket structure.
EFAULT The address pointed to by the optval argument
is not in a valid (writable) part of the
process space, or the optlen argument is not
in a valid part of the process address space.
EINVAL The optval or optlen argument is invalid; or
the socket is shut down.
ENOBUFS The system has insufficient resources to
complete the call.
ENOTSOCK The socket descriptor is invalid.
ENOPROTOOPT The option is unknown or the protocol is
unsupported.
EOPNOTSUPP The operation is not supported by the socket
protocol.
ENOPROTOOPT The option is unknown.
ENOTSOCK The socket descriptor is invalid.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.