summaryrefslogtreecommitdiff
path: root/manual/socket.texi
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-04 14:31:26 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-04 14:31:26 +0000
commit55c14926be46b12fda4e01d0977911d3b0883db7 (patch)
tree2bb9829379008a2d0d59bb849d12f2491624c1fb /manual/socket.texi
parent8f2ece695d8822e9ecc63ecd157e90bf17a6fe65 (diff)
1997-08-04 15:29 Ulrich Drepper <drepper@cygnus.com> * locale/programs/localedef.c (main): Set bit in avail for those categories which are successfully read. * locale/programs/locfile.c (check_all_categories): Don't check categories if they are not available. (write_all_categories): Don't write categories if they are not available. * login/setutent_r.c (setutent_unknown): Change return type to int and return result of called function. * manual/arith.texi: Mark floating-point test macro from ISO C 9X as macros (not functions). * manual/libc.texinfo (UPDATED): Update. * manual/math.texi: Document exceptions, functions to handle exceptions, mathematical constants, FP comparison functions and several new functions from ISO C 9X. Change parameter of drand48, lrand48, and mrand48 to void (not empty). * manual/pattern.texi: Remove paragraph which explained that wordexp is executed by running a shell. * manual/time.texi: Explain difficulties with strftime if the functions returns 0 and no error occurred. * math/math.h: Correct comment for some M_* constants. (isgreater, isgreaterequal, isless, islessequal, islessgreater, inunordered): Rewrite to make sure the arguments are evaluated exactly once. * nis/rpcsvc/nis.x: Undo last change. * nis/rpcsvc/nis.h: Likewise. * nis/rpcsvc/nislib.h: File moved back to here. * posix/sys/types.h: Don't define socklen_t. Pretty print. * socket/sys/socket.h (bind, getsockname, connect, sendto, recvfrom, getsockopt, setsockopt, accept): Change size argument to type socklen_t. Pretty print. * manual/socket.texi: Describe socklen_t and change prototypes of socket functions to use socklen_t. * sysdeps/generic/bits/socket.h: Define socklen_t. (struct msghdr): Correct types to use socklen_t. * sysdeps/unix/sysv/linux/bits/socket.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise. * stdio-common/printf_fp.c (__printf_fp): Correct rouding of number 1.0 < x < 8.0. * stdio-common/tfformat.c: Add new tests for above bug. * stdlib/strtod.c: Fix typo. * string/Makefile (headers): Add bits/string.h. (CFLAGS-*): Add -D__NO_STRING_INLINES. * string/string.h: Include <bits/string.h> if optimizing and __NO_STRING_INLINES is not defined. * sysdeps/stub/bits/string.h: New file. * sysdeps/powerpc/bits/fenv.h: Fix typos. * sysdeps/unix/sysv/linux/if_index.c: Let functions return ENOSYS if SIOGIFINDEX is not defined. * sysdeps/wordsize-32/inttypes.h: Pretty print. * sysdeps/wordsize-64/inttypes.h: Pretty print. * termios/cfsetspeed.c: Rewrite loop to do what it shall do. * wcsmbs/Makefile (tests): Add tst-wcstof. * wcsmbs/tst-wcstof.c: New file. 1997-08-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/__longjmp.c: Replace call to abort by infinite loop, to avoid dragging stdio into the dynamic linker. 1997-08-02 19:44 H.J. Lu <hjl@gnu.ai.mit.edu> * nis/nis_findserv.c (xid, xid_seed, xid_lookup): Make them u_int32_t. 1997-08-03 Andreas Jaeger <aj@arthur.rhein-neckar.de> * posix/wordexp.c (parse_tilde): Fix calls to __getpwnam_r and __getpwuid_r. Include <stdio.h> to get prototypes of *printf. (exec_comm): Remove unneeded variable *sh. * libc.map: Add wordexp, wordfree. * posix/Makefile (routines): Add wordexp. 1997-08-03 Andreas Jaeger <aj@arthur.rhein-neckar.de> * posix/wordexp.c: Correct typo in comment. (wordexp): Likewise. * manual/errno.texi (Error Codes): Fix typo. 1997-08-03 15:28 Ulrich Drepper <drepper@cygnus.com> * csu/initfini.c (SECTION): Don't put quotes around section name since this is not understood by all assemblers. Patch by Klaus Espenlaub <kespenla@hydra.informatik.uni-ulm.de>.
Diffstat (limited to 'manual/socket.texi')
-rw-r--r--manual/socket.texi38
1 files changed, 30 insertions, 8 deletions
diff --git a/manual/socket.texi b/manual/socket.texi
index cc39bec452..0353eb7ed3 100644
--- a/manual/socket.texi
+++ b/manual/socket.texi
@@ -128,6 +128,28 @@ protocol} which you can request by specifying 0 as the protocol
number. And that's what you should normally do---use the default.
@end itemize
+Throughout the following description at various places
+variables/parameters to denote sizes are required. And here the trouble
+starts. In the first implementations the type of these variables was
+simply @code{int}. This type was on almost all machines of this time 32
+bits wide and so a de-factor standard required 32 bit variables. This
+is important since references to variables of this type are passed to
+the kernel.
+
+But now the POSIX people came and unified the interface with their words
+"all size values are of type @code{size_t}". But on 64 bit machines
+@code{size_t} is 64 bits wide and so variable references are not anymore
+possible.
+
+A solution provides the Unix98 specification which finally introduces a
+type @code{socklen_t}. This type is used in all of the cases in
+previously changed to use @code{size_t}. The only requirement of this
+type is that it is an unsigned type of at least 32 bits. Therefore,
+implementations which require references to 32 bit variables be passed
+can be as happy as implementations which right from the start of 64 bit
+values.
+
+
@node Communication Styles
@section Communication Styles
@@ -358,7 +380,7 @@ For examples of use, see @ref{File Namespace}, or see @ref{Inet Example}.
@comment sys/socket.h
@comment BSD
-@deftypefun int bind (int @var{socket}, struct sockaddr *@var{addr}, size_t @var{length})
+@deftypefun int bind (int @var{socket}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{bind} function assigns an address to the socket
@var{socket}. The @var{addr} and @var{length} arguments specify the
address; the detailed format of the address depends on the namespace.
@@ -406,7 +428,7 @@ Internet socket. The prototype for this function is in the header file
@comment sys/socket.h
@comment BSD
-@deftypefun int getsockname (int @var{socket}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
+@deftypefun int getsockname (int @var{socket}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
The @code{getsockname} function returns information about the
address of the socket @var{socket} in the locations specified by the
@var{addr} and @var{length-ptr} arguments. Note that the
@@ -1688,7 +1710,7 @@ program must do, using the @code{connect} function, which is declared in
@comment sys/socket.h
@comment BSD
-@deftypefun int connect (int @var{socket}, struct sockaddr *@var{addr}, size_t @var{length})
+@deftypefun int connect (int @var{socket}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{connect} function initiates a connection from the socket
with file descriptor @var{socket} to the socket whose address is
specified by the @var{addr} and @var{length} arguments. (This socket
@@ -1833,7 +1855,7 @@ queue.
@comment sys/socket.h
@comment BSD
-@deftypefun int accept (int @var{socket}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
+@deftypefun int accept (int @var{socket}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
This function is used to accept a connection request on the server
socket @var{socket}.
@@ -2327,7 +2349,7 @@ more information about the @code{connect} function.
@comment sys/socket.h
@comment BSD
-@deftypefun int sendto (int @var{socket}, void *@var{buffer}. size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, size_t @var{length})
+@deftypefun int sendto (int @var{socket}, void *@var{buffer}. size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{sendto} function transmits the data in the @var{buffer}
through the socket @var{socket} to the destination address specified
by the @var{addr} and @var{length} arguments. The @var{size} argument
@@ -2356,7 +2378,7 @@ also tells you where it was sent from. This function is declared in
@comment sys/socket.h
@comment BSD
-@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
+@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
The @code{recvfrom} function reads one packet from the socket
@var{socket} into the buffer @var{buffer}. The @var{size} argument
specifies the maximum number of bytes to be read.
@@ -2583,7 +2605,7 @@ They are declared in @file{sys/socket.h}.
@comment sys/socket.h
@comment BSD
-@deftypefun int getsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, size_t *@var{optlen-ptr})
+@deftypefun int getsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t *@var{optlen-ptr})
The @code{getsockopt} function gets information about the value of
option @var{optname} at level @var{level} for socket @var{socket}.
@@ -2613,7 +2635,7 @@ The @var{optname} doesn't make sense for the given @var{level}.
@comment sys/socket.h
@comment BSD
-@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, size_t @var{optlen})
+@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t @var{optlen})
This function is used to set the socket option @var{optname} at level
@var{level} for socket @var{socket}. The value of the option is passed
in the buffer @var{optval}, which has size @var{optlen}.