diff options
| author | Alejandro Colomar <alx@kernel.org> | 2024-11-17 18:47:53 +0100 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2024-11-17 21:51:23 +0100 |
| commit | 18e7c4597c4e72fa5210c7887273e363c456c9ee (patch) | |
| tree | 97cfd22e731a4c859ae71783d70943ff72e6cb60 /man/man3 | |
| parent | 8fc6fdd8291d906e58a175b5e1b20da680aaeb4a (diff) | |
| download | man-pages-18e7c4597c4e.tar.gz | |
man/: Terminology consistency reforms (n, size, length)
Use 'length' for the lenght of a string.
Use 'n' for the number of elements.
Use 'size' for the number of bytes. (And in wide-character string
functions, 'size' also refers to the number of wide characters.)
The change is quite large, and I might have made some mistakes.
But overall, this should improve consistency in use of these terms.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3')
| -rw-r--r-- | man/man3/aio_suspend.3 | 4 | ||||
| -rw-r--r-- | man/man3/bsearch.3 | 6 | ||||
| -rw-r--r-- | man/man3/cfree.3 | 7 | ||||
| -rw-r--r-- | man/man3/ecvt_r.3 | 10 | ||||
| -rw-r--r-- | man/man3/fread.3 | 12 | ||||
| -rw-r--r-- | man/man3/getaddrinfo.3 | 10 | ||||
| -rw-r--r-- | man/man3/getaddrinfo_a.3 | 14 | ||||
| -rw-r--r-- | man/man3/gethostbyname.3 | 16 | ||||
| -rw-r--r-- | man/man3/getipnodebyname.3 | 8 | ||||
| -rw-r--r-- | man/man3/getline.3 | 4 | ||||
| -rw-r--r-- | man/man3/getloadavg.3 | 4 | ||||
| -rw-r--r-- | man/man3/lio_listio.3 | 8 | ||||
| -rw-r--r-- | man/man3/lockf.3 | 12 | ||||
| -rw-r--r-- | man/man3/lsearch.3 | 12 | ||||
| -rw-r--r-- | man/man3/malloc.3 | 22 | ||||
| -rw-r--r-- | man/man3/mbsnrtowcs.3 | 14 | ||||
| -rw-r--r-- | man/man3/netlink.3 | 30 | ||||
| -rw-r--r-- | man/man3/posix_fallocate.3 | 16 | ||||
| -rw-r--r-- | man/man3/posix_madvise.3 | 10 | ||||
| -rw-r--r-- | man/man3/qsort.3 | 6 | ||||
| -rw-r--r-- | man/man3/rpc.3 | 4 | ||||
| -rw-r--r-- | man/man3/rtnetlink.3 | 18 | ||||
| -rw-r--r-- | man/man3/strcmp.3 | 2 | ||||
| -rw-r--r-- | man/man3/strcpy.3 | 8 | ||||
| -rw-r--r-- | man/man3/wcsnrtombs.3 | 14 | ||||
| -rw-r--r-- | man/man3/wcsrtombs.3 | 14 |
26 files changed, 142 insertions, 143 deletions
diff --git a/man/man3/aio_suspend.3 b/man/man3/aio_suspend.3 index 0e274a2d0d..a6d64495a5 100644 --- a/man/man3/aio_suspend.3 +++ b/man/man3/aio_suspend.3 @@ -15,7 +15,7 @@ Real-time library .P .B "#include <aio.h>" .P -.BI "int aio_suspend(const struct aiocb *const " aiocb_list "[], int " nitems , +.BI "int aio_suspend(const struct aiocb *const " aiocb_list "[], int " n , .BI " const struct timespec *restrict " timeout ); .fi .SH DESCRIPTION @@ -37,7 +37,7 @@ structure, see .BR nanosleep (2).) .P The -.I nitems +.I n argument specifies the number of items in .IR aiocb_list . Each item in the list pointed to by diff --git a/man/man3/bsearch.3 b/man/man3/bsearch.3 index 916563d039..23e864c5c4 100644 --- a/man/man3/bsearch.3 +++ b/man/man3/bsearch.3 @@ -20,8 +20,8 @@ Standard C library .B #include <stdlib.h> .P .BI "void *bsearch(const void " key [. size "], \ -const void " base [. size " * ." nmemb ], -.BI " size_t " nmemb ", size_t " size , +const void " base [. size " * ." n ], +.BI " size_t " n ", size_t " size , .BI " int (*" compar ")(const void [." size "], \ const void [." size ])); .fi @@ -29,7 +29,7 @@ const void [." size ])); The .BR bsearch () function searches an array of -.I nmemb +.I n objects, the initial member of which is pointed to by .IR base , diff --git a/man/man3/cfree.3 b/man/man3/cfree.3 index b9d2e6d0bb..5d27399905 100644 --- a/man/man3/cfree.3 +++ b/man/man3/cfree.3 @@ -21,12 +21,11 @@ Standard C library .BI "void cfree(void *" ptr ); .P /* In SCO OpenServer */ -.BI "void cfree(char " ptr [. size " * ." num "], unsigned int " num ", \ +.BI "void cfree(char " ptr [. size " * ." n "], unsigned int " n ", \ unsigned int " size ); .P /* In Solaris watchmalloc.so.1 */ -.BI "void cfree(void " ptr [. elsize " * ." nelem "], size_t " nelem ", \ -size_t " elsize ); +.BI "void cfree(void " ptr [. size " * ." n "], size_t " n ", size_t " size ); .fi .P .RS -4 @@ -86,7 +85,7 @@ Answer: use .P An SCO manual writes: "The cfree routine is provided for compliance to the iBCSe2 standard and simply calls free. -The num and size +The n and size arguments to cfree are not used." .SH RETURN VALUE The SunOS version of diff --git a/man/man3/ecvt_r.3 b/man/man3/ecvt_r.3 index 0ac985dec3..564eb1f849 100644 --- a/man/man3/ecvt_r.3 +++ b/man/man3/ecvt_r.3 @@ -20,17 +20,17 @@ Standard C library .P .BI "[[deprecated]] int ecvt_r(double " number ", int " ndigits , .BI " int *restrict " decpt ", int *restrict " sign , -.BI " char *restrict " buf ", size_t " len ); +.BI " char *restrict " buf ", size_t " size ); .BI "[[deprecated]] int fcvt_r(double " number ", int " ndigits , .BI " int *restrict " decpt ", int *restrict " sign , -.BI " char *restrict " buf ", size_t " len ); +.BI " char *restrict " buf ", size_t " size ); .P .BI "[[deprecated]] int qecvt_r(long double " number ", int " ndigits , .BI " int *restrict " decpt ", int *restrict " sign , -.BI " char *restrict " buf ", size_t " len ); +.BI " char *restrict " buf ", size_t " size ); .BI "[[deprecated]] int qfcvt_r(long double " number ", int " ndigits , .BI " int *restrict " decpt ", int *restrict " sign , -.BI " char *restrict " buf ", size_t " len ); +.BI " char *restrict " buf ", size_t " size ); .fi .P .RS -4 @@ -63,7 +63,7 @@ respectively, except that they do not return their result in a static buffer, but instead use the supplied .I buf of size -.IR len . +.IR size . See .BR ecvt (3) and diff --git a/man/man3/fread.3 b/man/man3/fread.3 index c56395d6b7..12baab3a75 100644 --- a/man/man3/fread.3 +++ b/man/man3/fread.3 @@ -26,18 +26,18 @@ Standard C library .nf .B #include <stdio.h> .P -.BI "size_t fread(void " ptr "[restrict ." size " * ." nmemb ], -.BI " size_t " size ", size_t " nmemb , +.BI "size_t fread(void " ptr "[restrict ." size " * ." n ], +.BI " size_t " size ", size_t " n , .BI " FILE *restrict " stream ); -.BI "size_t fwrite(const void " ptr "[restrict ." size " * ." nmemb ], -.BI " size_t " size ", size_t " nmemb , +.BI "size_t fwrite(const void " ptr "[restrict ." size " * ." n ], +.BI " size_t " size ", size_t " n , .BI " FILE *restrict " stream ); .fi .SH DESCRIPTION The function .BR fread () reads -.I nmemb +.I n items of data, each .I size bytes long, from the stream pointed to by @@ -48,7 +48,7 @@ storing them at the location given by The function .BR fwrite () writes -.I nmemb +.I n items of data, each .I size bytes long, to the stream pointed to by diff --git a/man/man3/getaddrinfo.3 b/man/man3/getaddrinfo.3 index d1ccd74a45..2540d9b33b 100644 --- a/man/man3/getaddrinfo.3 +++ b/man/man3/getaddrinfo.3 @@ -356,7 +356,7 @@ returns the protocol for the socket. .IP \[bu] A pointer to the socket address is placed in the .I ai_addr -field, and the length of the socket address, in bytes, +field, and the size of the socket address, in bytes, is placed in the .I ai_addrlen field. @@ -763,7 +763,7 @@ main(int argc, char *argv[]) { int sfd, s; char buf[BUF_SIZE]; - size_t len; + size_t size; ssize_t nread; struct addrinfo hints; struct addrinfo *result, *rp; @@ -815,16 +815,16 @@ main(int argc, char *argv[]) datagrams, and read responses from server. */ \& for (size_t j = 3; j < argc; j++) { - len = strlen(argv[j]) + 1; + size = strlen(argv[j]) + 1; /* +1 for terminating null byte */ \& - if (len > BUF_SIZE) { + if (size > BUF_SIZE) { fprintf(stderr, "Ignoring long message in argument %zu\[rs]n", j); continue; } \& - if (write(sfd, argv[j], len) != len) { + if (write(sfd, argv[j], size) != size) { fprintf(stderr, "partial/failed write\[rs]n"); exit(EXIT_FAILURE); } diff --git a/man/man3/getaddrinfo_a.3 b/man/man3/getaddrinfo_a.3 index cd955e4973..3441747192 100644 --- a/man/man3/getaddrinfo_a.3 +++ b/man/man3/getaddrinfo_a.3 @@ -21,8 +21,8 @@ Asynchronous name lookup library .B #include <netdb.h> .P .BI "int getaddrinfo_a(int " mode ", struct gaicb *" list [restrict], -.BI " int " nitems ", struct sigevent *restrict " sevp ); -.BI "int gai_suspend(const struct gaicb *const " list "[], int " nitems , +.BI " int " n ", struct sigevent *restrict " sevp ); +.BI "int gai_suspend(const struct gaicb *const " list "[], int " n , .BI " const struct timespec *" timeout ); .P .BI "int gai_error(struct gaicb *" req ); @@ -56,7 +56,7 @@ The array .I list specifies the look-up requests to process. The -.I nitems +.I n argument specifies the number of elements in .IR list . The requested look-up operations are started in parallel. @@ -165,7 +165,7 @@ function suspends execution of the calling thread, waiting for the completion of one or more requests in the array .IR list . The -.I nitems +.I n argument specifies the size of the array .IR list . The call blocks until one of the following occurs: @@ -447,12 +447,12 @@ static struct gaicb **reqs = NULL; static size_t nreqs = 0; \& static inline void * -reallocarrayf(void *p, size_t nmemb, size_t size) +reallocarrayf(void *p, size_t n, size_t size) { void *q; \& - q = reallocarray(p, nmemb, size); - if (q == NULL && nmemb != 0 && size != 0) + q = reallocarray(p, n, size); + if (q == NULL && n != 0 && size != 0) free(p); return q; } diff --git a/man/man3/gethostbyname.3 b/man/man3/gethostbyname.3 index 98478b90cf..1c55d5dd6c 100644 --- a/man/man3/gethostbyname.3 +++ b/man/man3/gethostbyname.3 @@ -37,8 +37,8 @@ Standard C library .B [[deprecated]] extern int h_errno; .P .BI "[[deprecated]] struct hostent *gethostbyname(const char *" name ); -.BI "[[deprecated]] struct hostent *gethostbyaddr(const void " addr [. len ], -.BI " socklen_t " len ", int " type ); +.BI "[[deprecated]] struct hostent *gethostbyaddr(const void " addr [. size ], +.BI " socklen_t " size ", int " type ); .P .BI "[[deprecated]] void herror(const char *" s ); .BI "[[deprecated]] const char *hstrerror(int " err ); @@ -56,7 +56,7 @@ Standard C library .BI " int *restrict " h_errnop ); .P .B [[deprecated]] -.BI "int gethostbyaddr_r(const void " addr "[restrict ." len "], socklen_t " len , +.BI "int gethostbyaddr_r(const void " addr "[restrict ." size "], socklen_t " size , .BI " int " type , .BI " struct hostent *restrict " ret , .BI " char " buf "[restrict ." buflen "], size_t " buflen , @@ -182,7 +182,7 @@ ends in a dot. The .BR gethostbyaddr () function returns a structure of type \fIhostent\fP -for the given host address \fIaddr\fP of length \fIlen\fP and address type +for the given host address \fIaddr\fP of size \fIlen\fP and address type \fItype\fP. Valid address types are .B AF_INET @@ -239,7 +239,7 @@ struct hostent { char *h_name; /* official name of host */ char **h_aliases; /* alias list */ int h_addrtype; /* host address type */ - int h_length; /* length of address */ + int h_length; /* size of address */ char **h_addr_list; /* list of addresses */ } #define h_addr h_addr_list[0] /* for backward compatibility */ @@ -262,7 +262,7 @@ or at present. .TP .I h_length -The length of the address in bytes. +The size of the address in bytes. .TP .I h_addr_list An array of pointers to network addresses for the host (in network byte @@ -447,14 +447,14 @@ Copying the does not suffice, since it contains pointers; a deep copy is required. .P In the original BSD implementation the -.I len +.I size argument of .BR gethostbyname () was an .IR int . The SUSv2 standard is buggy and declares the -.I len +.I size argument of .BR gethostbyaddr () to be of type diff --git a/man/man3/getipnodebyname.3 b/man/man3/getipnodebyname.3 index a4483c7a18..1428d38265 100644 --- a/man/man3/getipnodebyname.3 +++ b/man/man3/getipnodebyname.3 @@ -18,8 +18,8 @@ Standard C library .P .BI "[[deprecated]] struct hostent *getipnodebyname(const char *" name ", int " af , .BI " int " flags ", int *" error_num ); -.BI "[[deprecated]] struct hostent *getipnodebyaddr(const void " addr [. len ], -.BI " size_t " len ", int " af , +.BI "[[deprecated]] struct hostent *getipnodebyaddr(const void " addr [. size ], +.BI " size_t " size ", int " af , .BI " int *" "error_num" ); .BI "[[deprecated]] void freehostent(struct hostent *" "ip" ); .fi @@ -152,7 +152,7 @@ The argument points to a .I struct in_addr and -.I len +.I size must be set to .IR "sizeof(struct in_addr)" . .TP @@ -162,7 +162,7 @@ The argument points to a .I struct in6_addr and -.I len +.I size must be set to .IR "sizeof(struct in6_addr)" . .SH RETURN VALUE diff --git a/man/man3/getline.3 b/man/man3/getline.3 index 9b7be6d760..e1c5b0d637 100644 --- a/man/man3/getline.3 +++ b/man/man3/getline.3 @@ -149,7 +149,7 @@ main(int argc, char *argv[]) { FILE *stream; char *line = NULL; - size_t len = 0; + size_t size = 0; ssize_t nread; \& if (argc != 2) { @@ -163,7 +163,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } \& - while ((nread = getline(&line, &len, stream)) != \-1) { + while ((nread = getline(&line, &size, stream)) != \-1) { printf("Retrieved line of length %zd:\[rs]n", nread); fwrite(line, nread, 1, stdout); } diff --git a/man/man3/getloadavg.3 b/man/man3/getloadavg.3 index d45416da15..dad8bab0b6 100644 --- a/man/man3/getloadavg.3 +++ b/man/man3/getloadavg.3 @@ -18,7 +18,7 @@ Standard C library .nf .B #include <stdlib.h> .P -.BI "int getloadavg(double " loadavg[] ", int " nelem ); +.BI "int getloadavg(double " loadavg[] ", int " n ); .fi .P .RS -4 @@ -39,7 +39,7 @@ The function returns the number of processes in the system run queue averaged over various periods of time. Up to -.I nelem +.I n samples are retrieved and assigned to successive elements of .IR loadavg[] . The system imposes a maximum of 3 samples, representing averages diff --git a/man/man3/lio_listio.3 b/man/man3/lio_listio.3 index a75df98c38..8203047ba2 100644 --- a/man/man3/lio_listio.3 +++ b/man/man3/lio_listio.3 @@ -15,7 +15,7 @@ Real-time library .P .BI "int lio_listio(int " mode , .BI " struct aiocb *restrict const " aiocb_list [restrict], -.BI " int " nitems ", struct sigevent *restrict " sevp ); +.BI " int " n ", struct sigevent *restrict " sevp ); .fi .SH DESCRIPTION The @@ -52,7 +52,7 @@ argument is an array of pointers to structures that describe I/O operations. These operations are executed in an unspecified order. The -.I nitems +.I n argument specifies the size of the array .IR aiocb_list . Null pointers in @@ -138,7 +138,7 @@ Out of resources. .B EAGAIN .\" Doesn't happen in glibc(?) The number of I/O operations specified by -.I nitems +.I n would cause the limit .B AIO_MAX to be exceeded. @@ -157,7 +157,7 @@ asynchronous I/O completion notification.) .I mode is invalid, or .\" Doesn't happen in glibc(?) -.I nitems +.I n exceeds the limit .BR AIO_LISTIO_MAX . .TP diff --git a/man/man3/lockf.3 b/man/man3/lockf.3 index 83d5a358ff..1247fdef58 100644 --- a/man/man3/lockf.3 +++ b/man/man3/lockf.3 @@ -17,7 +17,7 @@ Standard C library .nf .B #include <unistd.h> .P -.BI "int lockf(int " fd ", int " op ", off_t " len ); +.BI "int lockf(int " fd ", int " op ", off_t " size ); .fi .P .RS -4 @@ -39,17 +39,17 @@ The file is specified by a file descriptor open for writing, the action by .IR op , and the section consists of byte positions -.IR pos .. pos + len \-1 +.IR pos .. pos + size \-1 if -.I len +.I size is positive, and -.IR pos \- len .. pos \-1 +.IR pos \- size .. pos \-1 if -.I len +.I size is negative, where .I pos is the current file position, and if -.I len +.I size is zero, the section extends from the current file position to infinity, encompassing the present and future end-of-file positions. In all cases, the section may extend past current end-of-file. diff --git a/man/man3/lsearch.3 b/man/man3/lsearch.3 index c15c072cf3..dc18d8bf85 100644 --- a/man/man3/lsearch.3 +++ b/man/man3/lsearch.3 @@ -15,13 +15,13 @@ Standard C library .B #include <search.h> .P .BI "void *lfind(const void " key [. size "], \ -const void " base [*. nmemb " * ." size ], -.BI " size_t *" nmemb ", size_t " size , +const void " base [*. n " * ." size ], +.BI " size_t *" n ", size_t " size , .BI " int(*" compar ")(const void [." size "], \ const void [." size ])); .BI "void *lsearch(const void " key [. size "], \ -void " base [*. nmemb " * ." size ], -.BI " size_t *" nmemb ", size_t " size , +void " base [*. n " * ." size ], +.BI " size_t *" n ", size_t " size , .BI " int(*" compar ")(const void [." size "], \ const void [." size ])); .fi @@ -34,7 +34,7 @@ perform a linear search for in the array .I base which has -.I *nmemb +.I *n elements of .I size bytes each. @@ -53,7 +53,7 @@ If does not find a matching element, then the .I key object is inserted at the end of the table, and -.I *nmemb +.I *n is incremented. In particular, one should know that a matching element diff --git a/man/man3/malloc.3 b/man/man3/malloc.3 index 2c2eb59fa3..953b3c77c4 100644 --- a/man/man3/malloc.3 +++ b/man/man3/malloc.3 @@ -24,9 +24,9 @@ Standard C library .P .BI "void *malloc(size_t " size ); .BI "void free(void *_Nullable " ptr ); -.BI "void *calloc(size_t " nmemb ", size_t " size ); +.BI "void *calloc(size_t " n ", size_t " size ); .BI "void *realloc(void *_Nullable " ptr ", size_t " size ); -.BI "void *reallocarray(void *_Nullable " ptr ", size_t " nmemb ", size_t " size ); +.BI "void *reallocarray(void *_Nullable " ptr ", size_t " n ", size_t " size ); .fi .P .RS -4 @@ -74,13 +74,13 @@ is NULL, no operation is performed. The .BR calloc () function allocates memory for an array of -.I nmemb +.I n elements of .I size bytes each and returns a pointer to the allocated memory. The memory is set to zero. If -.I nmemb +.I n or .I size is 0, then @@ -89,7 +89,7 @@ returns a unique pointer value that can later be successfully passed to .BR free (). .P If the multiplication of -.I nmemb +.I n and .I size would result in integer overflow, then @@ -102,7 +102,7 @@ with the result that an incorrectly sized block of memory would be allocated: .P .in +4n .EX -malloc(nmemb * size); +malloc(n * size); .EE .in .SS realloc() @@ -151,7 +151,7 @@ function changes the size of (and possibly moves) the memory block pointed to by .I ptr to be large enough for an array of -.I nmemb +.I n elements, each of which is .I size bytes. @@ -159,7 +159,7 @@ It is equivalent to the call .P .in +4n .EX -realloc(ptr, nmemb * size); +realloc(ptr, n * size); .EE .in .P @@ -408,7 +408,7 @@ and #define MALLOCARRAY(n, type) ((type *) my_mallocarray(n, sizeof(type))) #define MALLOC(type) MALLOCARRAY(1, type) \& -static inline void *my_mallocarray(size_t nmemb, size_t size); +static inline void *my_mallocarray(size_t n, size_t size); \& int main(void) @@ -424,9 +424,9 @@ main(void) } \& static inline void * -my_mallocarray(size_t nmemb, size_t size) +my_mallocarray(size_t n, size_t size) { - return reallocarray(NULL, nmemb, size); + return reallocarray(NULL, n, size); } .EE .SH SEE ALSO diff --git a/man/man3/mbsnrtowcs.3 b/man/man3/mbsnrtowcs.3 index 9cfe92ab93..27ece4221a 100644 --- a/man/man3/mbsnrtowcs.3 +++ b/man/man3/mbsnrtowcs.3 @@ -18,8 +18,8 @@ Standard C library .nf .B #include <wchar.h> .P -.BI "size_t mbsnrtowcs(wchar_t " dest "[restrict ." len "], const char **restrict " src , -.BI " size_t " nms ", size_t " len \ +.BI "size_t mbsnrtowcs(wchar_t " dest "[restrict ." size "], const char **restrict " src , +.BI " size_t " nms ", size_t " size \ ", mbstate_t *restrict " ps ); .fi .P @@ -60,7 +60,7 @@ multibyte string to a wide-character string starting at .IR dest . At most -.I len +.I size wide characters are written to .IR dest . The shift state @@ -95,7 +95,7 @@ The .I nms limit forces a stop, or -.I len +.I size non-L\[aq]\[rs]0\[aq] wide characters have been stored at .IR dest . @@ -130,11 +130,11 @@ The glibc implementation adopts the former behavior. If .I dest is NULL, -.I len +.I size is ignored, and the conversion proceeds as above, except that the converted wide characters are not written out to memory, -and that no destination length limit exists. +and that no destination size limit exists. .P In both of the above cases, if .I ps @@ -144,7 +144,7 @@ state known only to the function is used instead. .P The programmer must ensure that there is room for at least -.I len +.I size wide characters at .IR dest . diff --git a/man/man3/netlink.3 b/man/man3/netlink.3 index a9b6ab5baf..e8594ece25 100644 --- a/man/man3/netlink.3 +++ b/man/man3/netlink.3 @@ -16,13 +16,13 @@ Standard C library .B #include <asm/types.h> .B #include <linux/netlink.h> .P -.BI "int NLMSG_ALIGN(size_t " len ); -.BI "int NLMSG_LENGTH(size_t " len ); -.BI "int NLMSG_SPACE(size_t " len ); +.BI "int NLMSG_ALIGN(size_t " size ); +.BI "int NLMSG_LENGTH(size_t " size ); +.BI "int NLMSG_SPACE(size_t " size ); .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh ); -.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len ); -.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len ); -.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len ); +.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " size ); +.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " size ); +.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " size ); .fi .SH DESCRIPTION .I <linux/netlink.h> @@ -34,19 +34,19 @@ The buffer passed to and from a netlink socket should be accessed using only these macros. .TP .BR NLMSG_ALIGN () -Round the length of a netlink message up to align it properly. +Round the size of a netlink message up to align it properly. .TP .BR NLMSG_LENGTH () -Given the payload length, -.IR len , -this macro returns the aligned length to store in the +Given the payload size, +.IR size , +this macro returns the aligned size to store in the .I nlmsg_len field of the .IR nlmsghdr . .TP .BR NLMSG_SPACE () Return the number of bytes that a netlink message with payload of -.I len +.I size would occupy. .TP .BR NLMSG_DATA () @@ -64,17 +64,17 @@ didn't have the .B NLMSG_DONE set\[em]this function doesn't return NULL on end. The -.I len -argument is an lvalue containing the remaining length +.I size +argument is an lvalue containing the remaining size of the message buffer. -This macro decrements it by the length of the message header. +This macro decrements it by the size of the message header. .TP .BR NLMSG_OK () Return true if the netlink message is not truncated and is in a form suitable for parsing. .TP .BR NLMSG_PAYLOAD () -Return the length of the payload associated with the +Return the size of the payload associated with the .IR nlmsghdr . .SH VERSIONS It is often better to use netlink via diff --git a/man/man3/posix_fallocate.3 b/man/man3/posix_fallocate.3 index 29bd8f72f6..4cbd947d6d 100644 --- a/man/man3/posix_fallocate.3 +++ b/man/man3/posix_fallocate.3 @@ -13,7 +13,7 @@ Standard C library .nf .B #include <fcntl.h> .P -.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); +.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " size ); .fi .P .ad l @@ -35,7 +35,7 @@ file descriptor for the bytes in the range starting at .I offset and continuing for -.I len +.I size bytes. After a successful call to .BR posix_fallocate (), @@ -43,7 +43,7 @@ subsequent writes to bytes in the specified range are guaranteed not to fail because of lack of disk space. .P If the size of the file is less than -.IR offset + len , +.IR offset + size , then the file is increased to this size; otherwise the file size is left unchanged. .SH RETURN VALUE @@ -59,7 +59,7 @@ is not set. is not a valid file descriptor, or is not opened for writing. .TP .B EFBIG -.I offset+len +.I offset+size exceeds the maximum file size. .TP .B EINTR @@ -68,7 +68,7 @@ A signal was caught during execution. .B EINVAL .I offset was less than 0, or -.I len +.I size was less than or equal to 0, or the underlying filesystem does not support the operation. .TP @@ -120,7 +120,7 @@ POSIX.1-2008 says that an implementation give the .B EINVAL error if -.I len +.I size was 0, or .I offset was less than 0. @@ -129,13 +129,13 @@ POSIX.1-2001 says that an implementation give the .B EINVAL error if -.I len +.I size is less than 0, or .I offset was less than 0, and .I may give the error if -.I len +.I size equals zero. .SH CAVEATS In the glibc implementation, diff --git a/man/man3/posix_madvise.3 b/man/man3/posix_madvise.3 index acaeda2b8d..d8c97276c4 100644 --- a/man/man3/posix_madvise.3 +++ b/man/man3/posix_madvise.3 @@ -12,7 +12,7 @@ Standard C library .nf .B #include <sys/mman.h> .P -.BI "int posix_madvise(void " addr [. len "], size_t " len ", int " advice ); +.BI "int posix_madvise(void " addr [. size "], size_t " size ", int " advice ); .fi .P .RS -4 @@ -31,7 +31,7 @@ function allows an application to advise the system about its expected patterns of usage of memory in the address range starting at .I addr and continuing for -.I len +.I size bytes. The system is free to use this advice in order to improve the performance of memory accesses (or to ignore the advice altogether), but calling @@ -75,7 +75,7 @@ On failure, it returns a positive error number. .B EINVAL .I addr is not a multiple of the system page size or -.I len +.I size is negative. .TP .B EINVAL @@ -87,10 +87,10 @@ Addresses in the specified range are partially or completely outside the caller's address space. .SH VERSIONS POSIX.1 permits an implementation to generate an error if -.I len +.I size is 0. On Linux, specifying -.I len +.I size as 0 is permitted (as a successful no-op). .P In glibc, this function is implemented using diff --git a/man/man3/qsort.3 b/man/man3/qsort.3 index e97bdb878c..2ff1d3d322 100644 --- a/man/man3/qsort.3 +++ b/man/man3/qsort.3 @@ -25,11 +25,11 @@ Standard C library .nf .B #include <stdlib.h> .P -.BI "void qsort(void " base [. size " * ." nmemb "], size_t " nmemb ", \ +.BI "void qsort(void " base [. size " * ." n "], size_t " n ", \ size_t " size , .BI " int (*" compar ")(const void [." size "], \ const void [." size ])); -.BI "void qsort_r(void " base [. size " * ." nmemb "], size_t " nmemb ", \ +.BI "void qsort_r(void " base [. size " * ." n "], size_t " n ", \ size_t " size , .BI " int (*" compar ")(const void [." size "], \ const void [." size "], void *)," @@ -48,7 +48,7 @@ Feature Test Macro Requirements for glibc (see .SH DESCRIPTION The .BR qsort () -function sorts an array with \fInmemb\fP elements of +function sorts an array with \fIn\fP elements of size \fIsize\fP. The \fIbase\fP argument points to the start of the array. diff --git a/man/man3/rpc.3 b/man/man3/rpc.3 index 79c9587bfc..74a0c93137 100644 --- a/man/man3/rpc.3 +++ b/man/man3/rpc.3 @@ -75,7 +75,7 @@ This is the default authentication used by RPC. .P .nf .BI "AUTH *authunix_create(char *" host ", uid_t " uid ", gid_t " gid , -.BI " int " len ", gid_t " aup_gids [. len ]); +.BI " int " n ", gid_t " aup_gids [. n ]); .fi .IP Create and return an RPC authentication handle that contains @@ -87,7 +87,7 @@ is the name of the machine on which the information was created; is the user's user ID; .I gid is the user's current group ID; -.I len +.I n and .I aup_gids refer to a counted array of groups to which the user belongs. diff --git a/man/man3/rtnetlink.3 b/man/man3/rtnetlink.3 index 52ded496cc..c55be3f5a1 100644 --- a/man/man3/rtnetlink.3 +++ b/man/man3/rtnetlink.3 @@ -28,8 +28,8 @@ Standard C library .BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ ", unsigned int " rtabuflen ); .P -.BI "unsigned int RTA_LENGTH(unsigned int " length ); -.BI "unsigned int RTA_SPACE(unsigned int "length ); +.BI "unsigned int RTA_LENGTH(unsigned int " size ); +.BI "unsigned int RTA_SPACE(unsigned int "size ); .fi .SH DESCRIPTION All @@ -44,7 +44,7 @@ returns true if .I rta points to a valid routing attribute; .I attrlen -is the running length of the attribute buffer. +is the running size of the attribute buffer. When not true then you must assume there are no more attributes in the message, even if .I attrlen @@ -54,7 +54,7 @@ is nonzero. returns a pointer to the start of this attribute's data. .P .BI RTA_PAYLOAD( rta ) -returns the length of this attribute's data. +returns the size of this attribute's data. .P .BI RTA_NEXT( rta ", " attrlen ) gets the next attribute after @@ -65,14 +65,14 @@ You should use .B RTA_OK to check the validity of the returned pointer. .P -.BI RTA_LENGTH( len ) -returns the length which is required for -.I len +.BI RTA_LENGTH( size ) +returns the size which is required for +.I size bytes of data plus the header. .P -.BI RTA_SPACE( len ) +.BI RTA_SPACE( size ) returns the amount of space which will be needed in a message with -.I len +.I size bytes of data. .SH STANDARDS Linux. diff --git a/man/man3/strcmp.3 b/man/man3/strcmp.3 index 913488fd23..b027687516 100644 --- a/man/man3/strcmp.3 +++ b/man/man3/strcmp.3 @@ -172,7 +172,7 @@ main(int argc, char *argv[]) int res; \& if (argc < 3) { - fprintf(stderr, "Usage: %s <str1> <str2> [<len>]\[rs]n", argv[0]); + fprintf(stderr, "Usage: %s <str1> <str2> [<n>]\[rs]n", argv[0]); exit(EXIT_FAILURE); } \& diff --git a/man/man3/strcpy.3 b/man/man3/strcpy.3 index 9d84ddbc98..40a4823a27 100644 --- a/man/man3/strcpy.3 +++ b/man/man3/strcpy.3 @@ -164,13 +164,13 @@ main(void) char *p; char *buf1; char *buf2; - size_t len, maxsize; + size_t len, size; \& - maxsize = strlen("Hello ") + strlen("world") + strlen("!") + 1; - buf1 = malloc(sizeof(*buf1) * maxsize); + size = strlen("Hello ") + strlen("world") + strlen("!") + 1; + buf1 = malloc(sizeof(*buf1) * size); if (buf1 == NULL) err(EXIT_FAILURE, "malloc()"); - buf2 = malloc(sizeof(*buf2) * maxsize); + buf2 = malloc(sizeof(*buf2) * size); if (buf2 == NULL) err(EXIT_FAILURE, "malloc()"); \& diff --git a/man/man3/wcsnrtombs.3 b/man/man3/wcsnrtombs.3 index 09a532120d..47291ff0c5 100644 --- a/man/man3/wcsnrtombs.3 +++ b/man/man3/wcsnrtombs.3 @@ -18,9 +18,9 @@ Standard C library .nf .B #include <wchar.h> .P -.BI "size_t wcsnrtombs(char " dest "[restrict ." len "], \ +.BI "size_t wcsnrtombs(char " dest "[restrict ." size "], \ const wchar_t **restrict " src , -.BI " size_t " nwc ", size_t " len ", \ +.BI " size_t " nwc ", size_t " size ", \ mbstate_t *restrict " ps ); .fi .P @@ -62,7 +62,7 @@ the wide-character string to a multibyte string starting at .IR dest . At most -.I len +.I size bytes are written to .IR dest . The shift state @@ -95,7 +95,7 @@ is set to .I nwc wide characters have been converted without encountering a null wide character (L\[aq]\[rs]0\[aq]), -or the length limit forces a stop. +or the size limit forces a stop. In this case, .I *src is left pointing @@ -119,11 +119,11 @@ returned. If .I dest is NULL, -.I len +.I size is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that -no destination length limit exists. +no destination size limit exists. .P In both of the above cases, if @@ -134,7 +134,7 @@ state known only to the function is used instead. .P The programmer must ensure that there is room for at least -.I len +.I size bytes at .IR dest . diff --git a/man/man3/wcsrtombs.3 b/man/man3/wcsrtombs.3 index 2bbc364c77..ad6ee7b45b 100644 --- a/man/man3/wcsrtombs.3 +++ b/man/man3/wcsrtombs.3 @@ -19,9 +19,9 @@ Standard C library .nf .B #include <wchar.h> .P -.BI "size_t wcsrtombs(char " dest "[restrict ." len "], \ +.BI "size_t wcsrtombs(char " dest "[restrict ." size "], \ const wchar_t **restrict " src , -.BI " size_t " len ", mbstate_t *restrict " ps ); +.BI " size_t " size ", mbstate_t *restrict " ps ); .fi .SH DESCRIPTION If @@ -35,7 +35,7 @@ the wide-character string to a multibyte string starting at .IR dest . At most -.I len +.I size bytes are written to .IR dest . The shift state @@ -65,7 +65,7 @@ and is set to .BR EILSEQ . .IP \[bu] -The length limit forces a stop. +The size limit forces a stop. In this case, .I *src is left pointing @@ -90,11 +90,11 @@ is returned. If .I dest is NULL, -.I len +.I size is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that -no length limit exists. +no size limit exists. .P In both of the above cases, if @@ -105,7 +105,7 @@ state known only to the function is used instead. .P The programmer must ensure that there is room for at least -.I len +.I size bytes at .IR dest . |
