Differences between version 2 and previous revision of setsockopt(2).
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 2 | Last edited on Monday, June 6, 2005 12:31:03 pm | by PerryLorier | Revert |
Older page: | version 1 | Last edited on Tuesday, June 4, 2002 12:23:46 am | by perry | Revert |
@@ -1,37 +1,16 @@
-GETSOCKOPT
!!!GETSOCKOPT
-NAME
-SYNOPSIS
-DESCRIPTION
-RETURN VALUE
-ERRORS
-CONFORMING TO
-NOTE
-BUGS
-SEE ALSO
-----
!!NAME
-
getsockopt, setsockopt - get and set options on sockets
!!SYNOPSIS
+ __#include <sys/types.h>__
+ __#include <sys/socket.h>__
+ __int getsockopt(int__ ''s''__, int__ ''level''__, int__ ''optname''__, void *__''optval''__, socklen_t *__''optlen''__);__
-__#include __
-#include __
-
-
-
__int getsockopt
(int__ ''s''__, int__
-
''level''__, int__ ''optname''__, void
-
*__''optval''__, socklen_t
-*
__''optlen''__);__
-
+
__int setsockopt
(int__ ''s''__, int__ ''level''__, int__ ''optname''__, const
void *__''optval''__, socklen_t__ ''optlen''__);__
-__int setsockopt(int__ ''s''__, int__
-''level''__, int__ ''optname''__, const void
-*__''optval''__, socklen_t__
-''optlen''__);__
!!DESCRIPTION
__Getsockopt__ and __setsockopt__ manipulate the
@@ -81,66 +60,27 @@
For a description of the available socket options see
socket(7) and the appropriate protocol man
pages.
!!RETURN VALUE
-
On success, zero is returned. On error, -1 is returned, and
''errno'' is set appropriately.
+
!!ERRORS
+;[EBADF]: The argument ''s'' is not a valid descriptor.
+;[ENOTSOCK]: The argument ''s'' is a file, not a socket.
+;[ENOPROTOOPT]: The option is unknown at the level indicated.
+;[EFAULT]: The address pointed to by ''optval'' is not in a valid part of the process address space. For getsockopt(2), this error may also be returned if ''optlen'' is not in a valid part of the process address space.
+;[EINVAL]: The optlen or the option you are trying to set is invalid.
-
-__EBADF__
-
-
-The argument ''s'' is not a valid
-descriptor.
-
-
-__ENOTSOCK__
-
-
-The argument ''s'' is a file, not a socket.
-
-
-__ENOPROTOOPT__
-
-
-The option is unknown at the level indicated.
-
-
-__EFAULT__
-
-
-The address pointed to by ''optval'' is not in a valid
-part of the process address space. For __getsockopt__,
-this error may also be returned if ''optlen'' is not in a
-valid part of the process address space.
!!CONFORMING TO
+SVr4, 4.4BSD (these system calls first appeared in 4.2BSD). SVr4 documents additional [ENOMEM] and [ENOSR] error codes, but does not document the __SO_SNDLOWAT__, __SO_RCVLOWAT__, __SO_SNDTIMEO__, __SO_RCVTIMEO__ options
-
-SVr4, 4.4BSD (these system calls first appeared in 4.2BSD).
-SVr4 documents additional ENOMEM and ENOSR error codes, but
-does not document the __SO_SNDLOWAT__,
-__SO_RCVLOWAT__, __SO_SNDTIMEO__, __SO_RCVTIMEO__
-options
!!NOTE
+The fifth argument of getsockopt(2) and setsockopt(2) is in reality an int [[*] (and this is what BSD 4.* and libc4 and libc5 have). Some [POSIX] confusion
+resulted in the present socklen_t. The draft standard has not been adopted yet, but glibc2 already follows it and also has socklen_t [[*]. See also accept(2).
-
-The fifth argument of __getsockopt__ and
-__setsockopt__ is in reality an int [[*] (and this is what
-BSD 4.* and libc4 and libc5 have). Some POSIX confusion
-resulted in the present socklen_t. The draft standard has
-not been adopted yet, but glibc2 already follows it and also
-has socklen_t [[*]. See also accept(2).
!!BUGS
+Several of the socket options should be handled at lower levels of the system.
-
-Several of the socket options should be handled at lower
-levels of the system.
!!SEE ALSO
-
-
-
ioctl(2), socket(2), getprotoent(3),
-
protocols(5), socket(7), unix(7),
-
tcp(7)
-----
+ioctl(2), socket(2), getprotoent(3), protocols(5), socket(7), unix(7), tcp(7)