From: Alejandro Colomar Date: Tue, 24 Dec 2024 22:10:28 +0000 (+0100) Subject: man/man3/: Don't use 'length' to refer to buffer size X-Git-Tag: man-pages-6.10~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d180b72135ab9b73994880c3344197428b357826;p=thirdparty%2Fman-pages.git man/man3/: Don't use 'length' to refer to buffer size Signed-off-by: Alejandro Colomar --- diff --git a/man/man3/getgrent_r.3 b/man/man3/getgrent_r.3 index 6b7962e6e..aec5fcd3c 100644 --- a/man/man3/getgrent_r.3 +++ b/man/man3/getgrent_r.3 @@ -14,10 +14,10 @@ Standard C library .B #include .P .BI "int getgrent_r(struct group *restrict " gbuf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct group **restrict " gbufp ); .BI "int fgetgrent_r(FILE *restrict " stream ", struct group *restrict " gbuf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct group **restrict " gbufp ); .fi .P @@ -83,7 +83,7 @@ that can hold a \fIstruct group\fP. And next the buffer .I buf of size -.I buflen +.I size that can hold additional strings. The result of these functions, the \fIstruct group\fP read from the stream, is stored in the provided buffer @@ -150,8 +150,8 @@ Other systems use the prototype .P .in +4n .EX -struct group *getgrent_r(struct group *grp, char *buf, - int buflen); +struct group *getgrent_r(struct group *grp, char buf[.size], + int size); .EE .in .P @@ -159,7 +159,7 @@ or, better, .P .in +4n .EX -int getgrent_r(struct group *grp, char *buf, int buflen, +int getgrent_r(struct group *grp, char buf[.size], int size, FILE **gr_fp); .EE .in diff --git a/man/man3/getgrnam.3 b/man/man3/getgrnam.3 index aab969707..d87e09500 100644 --- a/man/man3/getgrnam.3 +++ b/man/man3/getgrnam.3 @@ -27,10 +27,10 @@ Standard C library .P .BI "int getgrnam_r(const char *restrict " name \ ", struct group *restrict " grp , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct group **restrict " result ); .BI "int getgrgid_r(gid_t " gid ", struct group *restrict " grp , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct group **restrict " result ); .fi .P @@ -98,7 +98,7 @@ The string fields pointed to by the members of the structure are stored in the buffer .I buf of size -.IR buflen . +.IR size . A pointer to the result (in case of success) or NULL (in case no entry was found or an error occurred) is stored in .IR *result . diff --git a/man/man3/gethostbyname.3 b/man/man3/gethostbyname.3 index 1c55d5dd6..690a3b82e 100644 --- a/man/man3/gethostbyname.3 +++ b/man/man3/gethostbyname.3 @@ -51,7 +51,7 @@ Standard C library .BI "struct hostent *gethostbyname2(const char *" name ", int " af ); .P .BI "int gethostent_r(struct hostent *restrict " ret , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." bufsize "], size_t " bufsize , .BI " struct hostent **restrict " result , .BI " int *restrict " h_errnop ); .P @@ -59,19 +59,19 @@ Standard C library .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 , +.BI " char " buf "[restrict ." bufsize "], size_t " bufsize , .BI " struct hostent **restrict " result , .BI " int *restrict " h_errnop ); .B [[deprecated]] .BI "int gethostbyname_r(const char *restrict " name , .BI " struct hostent *restrict " ret , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." bufsize "], size_t " bufsize , .BI " struct hostent **restrict " result , .BI " int *restrict " h_errnop ); .B [[deprecated]] .BI "int gethostbyname2_r(const char *restrict " name ", int " af, .BI " struct hostent *restrict " ret , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." bufsize "], size_t " bufsize , .BI " struct hostent **restrict " result , .BI " int *restrict " h_errnop ); .fi @@ -512,7 +512,7 @@ structure which will be filled in on success, and a temporary work buffer .I buf of size -.IR buflen . +.IR bufsize . After the call, .I result will point to the result on success. diff --git a/man/man3/getmntent.3 b/man/man3/getmntent.3 index 6d194d51e..9f134d6ad 100644 --- a/man/man3/getmntent.3 +++ b/man/man3/getmntent.3 @@ -38,7 +38,7 @@ Standard C library .P .BI "struct mntent *getmntent_r(FILE *restrict " streamp , .BI " struct mntent *restrict " mntbuf , -.BI " char " buf "[restrict ." buflen "], int " buflen ); +.BI " char " buf "[restrict ." size "], int " size ); .fi .P .RS -4 @@ -135,7 +135,7 @@ and stores the strings pointed to by the entries in that structure in the provided array .I buf of size -.IR buflen . +.IR size . .P The .I mntent diff --git a/man/man3/getnetent_r.3 b/man/man3/getnetent_r.3 index 5614c3cb8..8d6fcda73 100644 --- a/man/man3/getnetent_r.3 +++ b/man/man3/getnetent_r.3 @@ -16,17 +16,17 @@ Standard C library .B #include .P .BI "int getnetent_r(struct netent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct netent **restrict " result , .BI " int *restrict " h_errnop ); .BI "int getnetbyname_r(const char *restrict " name , .BI " struct netent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct netent **restrict " result , .BI " int *restrict " h_errnop ); .BI "int getnetbyaddr_r(uint32_t " net ", int " type , .BI " struct netent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct netent **restrict " result , .BI " int *restrict " h_errnop ); .P @@ -76,13 +76,13 @@ array is used to store the string fields pointed to by the returned structure. (The nonreentrant functions allocate these strings in static storage.) The size of this array is specified in -.IR buflen . +.IR size . If .I buf is too small, the call fails with the error .BR ERANGE , and the caller must try again with a larger buffer. -(A buffer of length 1024 bytes should be sufficient for most applications.) +(A buffer of size 1024 bytes should be sufficient for most applications.) .\" I can find no information on the required/recommended buffer size; .\" the nonreentrant functions use a 1024 byte buffer -- mtk. .P @@ -123,7 +123,7 @@ No more records in database. is too small. Try again with a larger buffer (and increased -.IR buflen ). +.IR size ). .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). diff --git a/man/man3/getprotoent_r.3 b/man/man3/getprotoent_r.3 index 08e87a075..09c9092fa 100644 --- a/man/man3/getprotoent_r.3 +++ b/man/man3/getprotoent_r.3 @@ -16,15 +16,15 @@ Standard C library .B #include .P .BI "int getprotoent_r(struct protoent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct protoent **restrict " result ); .BI "int getprotobyname_r(const char *restrict " name , .BI " struct protoent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct protoent **restrict " result ); .BI "int getprotobynumber_r(int " proto , .BI " struct protoent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct protoent **restrict " result ); .P .fi @@ -73,13 +73,13 @@ array is used to store the string fields pointed to by the returned structure. (The nonreentrant functions allocate these strings in static storage.) The size of this array is specified in -.IR buflen . +.IR size . If .I buf is too small, the call fails with the error .BR ERANGE , and the caller must try again with a larger buffer. -(A buffer of length 1024 bytes should be sufficient for most applications.) +(A buffer of size 1024 bytes should be sufficient for most applications.) .\" I can find no information on the required/recommended buffer size; .\" the nonreentrant functions use a 1024 byte buffer. .\" The 1024 byte value is also what the Solaris man page suggests. -- mtk @@ -113,7 +113,7 @@ No more records in database. is too small. Try again with a larger buffer (and increased -.IR buflen ). +.IR size ). .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). @@ -142,7 +142,7 @@ to retrieve the protocol record for the protocol named in its first command-line argument. If a second (integer) command-line argument is supplied, it is used as the initial value for -.IR buflen ; +.IR size ; if .BR getprotobyname_r () fails with the error @@ -154,11 +154,11 @@ The following shell session shows a couple of sample runs: .EX .RB "$" " ./a.out tcp 1" ERANGE! Retrying with larger buffer -getprotobyname_r() returned: 0 (success) (buflen=78) +getprotobyname_r() returned: 0 (success) (size=78) p_name=tcp; p_proto=6; aliases=TCP .RB "$" " ./a.out xxx 1" ERANGE! Retrying with larger buffer -getprotobyname_r() returned: 0 (success) (buflen=100) +getprotobyname_r() returned: 0 (success) (size=100) Call failed/record not found .EE .in @@ -179,21 +179,21 @@ Call failed/record not found int main(int argc, char *argv[]) { - int buflen, erange_cnt, s; + int size, erange_cnt, s; struct protoent result_buf; struct protoent *result; char buf[MAX_BUF]; \& if (argc < 2) { - printf("Usage: %s proto\-name [buflen]\[rs]n", argv[0]); + printf("Usage: %s proto\-name [size]\[rs]n", argv[0]); exit(EXIT_FAILURE); } \& - buflen = 1024; + size = 1024; if (argc > 2) - buflen = atoi(argv[2]); + size = atoi(argv[2]); \& - if (buflen > MAX_BUF) { + if (size > MAX_BUF) { printf("Exceeded buffer limit (%d)\[rs]n", MAX_BUF); exit(EXIT_FAILURE); } @@ -201,7 +201,7 @@ main(int argc, char *argv[]) erange_cnt = 0; do { s = getprotobyname_r(argv[1], &result_buf, - buf, buflen, &result); + buf, size, &result); if (s == ERANGE) { if (erange_cnt == 0) printf("ERANGE! Retrying with larger buffer\[rs]n"); @@ -210,18 +210,18 @@ main(int argc, char *argv[]) /* Increment a byte at a time so we can see exactly what size buffer was required. */ \& - buflen++; + size++; \& - if (buflen > MAX_BUF) { + if (size > MAX_BUF) { printf("Exceeded buffer limit (%d)\[rs]n", MAX_BUF); exit(EXIT_FAILURE); } } } while (s == ERANGE); \& - printf("getprotobyname_r() returned: %s (buflen=%d)\[rs]n", + printf("getprotobyname_r() returned: %s (size=%d)\[rs]n", (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : - strerror(s), buflen); + strerror(s), size); \& if (s != 0 || result == NULL) { printf("Call failed/record not found\[rs]n"); diff --git a/man/man3/getpwent_r.3 b/man/man3/getpwent_r.3 index ccb6266d5..bb502ea20 100644 --- a/man/man3/getpwent_r.3 +++ b/man/man3/getpwent_r.3 @@ -14,11 +14,11 @@ Standard C library .B #include .P .BI "int getpwent_r(struct passwd *restrict " pwbuf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct passwd **restrict " pwbufp ); .BI "int fgetpwent_r(FILE *restrict " stream \ ", struct passwd *restrict " pwbuf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct passwd **restrict " pwbufp ); .fi .P @@ -88,7 +88,7 @@ that can hold a \fIstruct passwd\fP. And next the buffer .I buf of size -.I buflen +.I size that can hold additional strings. The result of these functions, the \fIstruct passwd\fP read from the stream, is stored in the provided buffer @@ -152,7 +152,7 @@ Other systems use the prototype .in +4n .EX struct passwd * -getpwent_r(struct passwd *pwd, char *buf, int buflen); +getpwent_r(struct passwd *pwd, char buf[.size], int size); .EE .in .P @@ -161,7 +161,7 @@ or, better, .in +4n .EX int -getpwent_r(struct passwd *pwd, char *buf, int buflen, +getpwent_r(struct passwd *pwd, char buf[.size], int size, FILE **pw_fp); .EE .in diff --git a/man/man3/getpwnam.3 b/man/man3/getpwnam.3 index 17b811f59..0d41204a3 100644 --- a/man/man3/getpwnam.3 +++ b/man/man3/getpwnam.3 @@ -31,10 +31,10 @@ Standard C library .P .BI "int getpwnam_r(const char *restrict " name ", \ struct passwd *restrict " pwd , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct passwd **restrict " result ); .BI "int getpwuid_r(uid_t " uid ", struct passwd *restrict " pwd , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct passwd **restrict " result ); .fi .P @@ -104,7 +104,7 @@ The string fields pointed to by the members of the structure are stored in the buffer .I buf of size -.IR buflen . +.IR size . A pointer to the result (in case of success) or NULL (in case no entry was found or an error occurred) is stored in .IR *result . diff --git a/man/man3/getrpcent_r.3 b/man/man3/getrpcent_r.3 index 33866ef7e..704c77a09 100644 --- a/man/man3/getrpcent_r.3 +++ b/man/man3/getrpcent_r.3 @@ -15,14 +15,14 @@ Standard C library .nf .B #include .P -.BI "int getrpcent_r(struct rpcent *" result_buf ", char " buf [. buflen ], -.BI " size_t " buflen ", struct rpcent **" result ); +.BI "int getrpcent_r(struct rpcent *" result_buf ", char " buf [. size ], +.BI " size_t " size ", struct rpcent **" result ); .BI "int getrpcbyname_r(const char *" name , -.BI " struct rpcent *" result_buf ", char " buf [. buflen ], -.BI " size_t " buflen ", struct rpcent **" result ); +.BI " struct rpcent *" result_buf ", char " buf [. size ], +.BI " size_t " size ", struct rpcent **" result ); .BI "int getrpcbynumber_r(int " number , -.BI " struct rpcent *" result_buf ", char " buf [. buflen ], -.BI " size_t " buflen ", struct rpcent **" result ); +.BI " struct rpcent *" result_buf ", char " buf [. size ], +.BI " size_t " size ", struct rpcent **" result ); .P .fi .RS -4 @@ -70,13 +70,13 @@ array is used to store the string fields pointed to by the returned structure. (The nonreentrant functions allocate these strings in static storage.) The size of this array is specified in -.IR buflen . +.IR size . If .I buf is too small, the call fails with the error .BR ERANGE , and the caller must try again with a larger buffer. -(A buffer of length 1024 bytes should be sufficient for most applications.) +(A buffer of size 1024 bytes should be sufficient for most applications.) .\" I can find no information on the required/recommended buffer size; .\" the nonreentrant functions use a 1024 byte buffer -- mtk. .P @@ -109,7 +109,7 @@ No more records in database. is too small. Try again with a larger buffer (and increased -.IR buflen ). +.IR size ). .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). diff --git a/man/man3/getservent_r.3 b/man/man3/getservent_r.3 index 83ea63885..698e158a2 100644 --- a/man/man3/getservent_r.3 +++ b/man/man3/getservent_r.3 @@ -16,17 +16,17 @@ Standard C library .B #include .P .BI "int getservent_r(struct servent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct servent **restrict " result ); .BI "int getservbyname_r(const char *restrict " name , .BI " const char *restrict " proto , .BI " struct servent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct servent **restrict " result ); .BI "int getservbyport_r(int " port , .BI " const char *restrict " proto , .BI " struct servent *restrict " result_buf , -.BI " char " buf "[restrict ." buflen "], size_t " buflen , +.BI " char " buf "[restrict ." size "], size_t " size , .BI " struct servent **restrict " result ); .P .fi @@ -75,13 +75,13 @@ array is used to store the string fields pointed to by the returned structure. (The nonreentrant functions allocate these strings in static storage.) The size of this array is specified in -.IR buflen . +.IR size . If .I buf is too small, the call fails with the error .BR ERANGE , and the caller must try again with a larger buffer. -(A buffer of length 1024 bytes should be sufficient for most applications.) +(A buffer of size 1024 bytes should be sufficient for most applications.) .\" I can find no information on the required/recommended buffer size; .\" the nonreentrant functions use a 1024 byte buffer -- mtk. .P @@ -114,7 +114,7 @@ No more records in database. is too small. Try again with a larger buffer (and increased -.IR buflen ). +.IR size ). .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). @@ -143,7 +143,7 @@ to retrieve the service record for the port and protocol named in its first command-line argument. If a third (integer) command-line argument is supplied, it is used as the initial value for -.IR buflen ; +.IR size ; if .BR getservbyport_r () fails with the error @@ -155,10 +155,10 @@ The following shell session shows a couple of sample runs: .EX .RB "$" " ./a.out 7 tcp 1" ERANGE! Retrying with larger buffer -getservbyport_r() returned: 0 (success) (buflen=87) +getservbyport_r() returned: 0 (success) (size=87) s_name=echo; s_proto=tcp; s_port=7; aliases= .RB "$" " ./a.out 77777 tcp" -getservbyport_r() returned: 0 (success) (buflen=1024) +getservbyport_r() returned: 0 (success) (size=1024) Call failed/record not found .EE .in @@ -179,14 +179,14 @@ Call failed/record not found int main(int argc, char *argv[]) { - int buflen, erange_cnt, port, s; + int size, erange_cnt, port, s; struct servent result_buf; struct servent *result; char buf[MAX_BUF]; char *protop; \& if (argc < 3) { - printf("Usage: %s port\-num proto\-name [buflen]\[rs]n", argv[0]); + printf("Usage: %s port\-num proto\-name [size]\[rs]n", argv[0]); exit(EXIT_FAILURE); } \& @@ -194,11 +194,11 @@ main(int argc, char *argv[]) protop = (strcmp(argv[2], "null") == 0 || strcmp(argv[2], "NULL") == 0) ? NULL : argv[2]; \& - buflen = 1024; + size = 1024; if (argc > 3) - buflen = atoi(argv[3]); + size = atoi(argv[3]); \& - if (buflen > MAX_BUF) { + if (size > MAX_BUF) { printf("Exceeded buffer limit (%d)\[rs]n", MAX_BUF); exit(EXIT_FAILURE); } @@ -206,7 +206,7 @@ main(int argc, char *argv[]) erange_cnt = 0; do { s = getservbyport_r(port, protop, &result_buf, - buf, buflen, &result); + buf, size, &result); if (s == ERANGE) { if (erange_cnt == 0) printf("ERANGE! Retrying with larger buffer\[rs]n"); @@ -215,18 +215,18 @@ main(int argc, char *argv[]) /* Increment a byte at a time so we can see exactly what size buffer was required. */ \& - buflen++; + size++; \& - if (buflen > MAX_BUF) { + if (size > MAX_BUF) { printf("Exceeded buffer limit (%d)\[rs]n", MAX_BUF); exit(EXIT_FAILURE); } } } while (s == ERANGE); \& - printf("getservbyport_r() returned: %s (buflen=%d)\[rs]n", + printf("getservbyport_r() returned: %s (size=%d)\[rs]n", (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : - strerror(s), buflen); + strerror(s), size); \& if (s != 0 || result == NULL) { printf("Call failed/record not found\[rs]n"); diff --git a/man/man3/getspnam.3 b/man/man3/getspnam.3 index 39a168d6b..a49e44d23 100644 --- a/man/man3/getspnam.3 +++ b/man/man3/getspnam.3 @@ -35,17 +35,17 @@ Standard C library .B #include .P .BI "int getspent_r(struct spwd *" spbuf , -.BI " char " buf [. buflen "], size_t " buflen ", \ +.BI " char " buf [. size "], size_t " size ", \ struct spwd **" spbufp ); .BI "int getspnam_r(const char *" name ", struct spwd *" spbuf , -.BI " char " buf [. buflen "], size_t " buflen ", \ +.BI " char " buf [. size "], size_t " size ", \ struct spwd **" spbufp ); .P .BI "int fgetspent_r(FILE *" stream ", struct spwd *" spbuf , -.BI " char " buf [. buflen "], size_t " buflen ", \ +.BI " char " buf [. size "], size_t " size ", \ struct spwd **" spbufp ); .BI "int sgetspent_r(const char *" s ", struct spwd *" spbuf , -.BI " char " buf [. buflen "], size_t " buflen ", \ +.BI " char " buf [. size "], size_t " size ", \ struct spwd **" spbufp ); .fi .P @@ -169,7 +169,7 @@ This shadow password structure contains pointers to strings, and these strings are stored in the buffer .I buf of size -.IR buflen . +.IR size . A pointer to the result (in case of success) or NULL (in case no entry was found or an error occurred) is stored in .IR *spbufp . diff --git a/man/man3/ptsname.3 b/man/man3/ptsname.3 index 5a91c9cb4..732d0db0e 100644 --- a/man/man3/ptsname.3 +++ b/man/man3/ptsname.3 @@ -16,7 +16,7 @@ Standard C library .B #include .P .BI "char *ptsname(int " fd ); -.BI "int ptsname_r(int " fd ", char " buf [. buflen "], size_t " buflen ); +.BI "int ptsname_r(int " fd ", char " buf [. size "], size_t " size ); .fi .P .RS -4 @@ -52,7 +52,7 @@ It returns the name of the slave pseudoterminal device as a null-terminated string in the buffer pointed to by .IR buf . The -.I buflen +.I size argument specifies the number of bytes available in .IR buf . .SH RETURN VALUE diff --git a/man/man3/rtnetlink.3 b/man/man3/rtnetlink.3 index c55be3f5a..57dba37f8 100644 --- a/man/man3/rtnetlink.3 +++ b/man/man3/rtnetlink.3 @@ -20,13 +20,13 @@ Standard C library .BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type \ ", NETLINK_ROUTE);" .P -.BI "int RTA_OK(struct rtattr *" rta ", int " rtabuflen ); +.BI "int RTA_OK(struct rtattr *" rta ", int " size ); .P .BI "void *RTA_DATA(struct rtattr *" rta ); .BI "unsigned int RTA_PAYLOAD(struct rtattr *" rta ); .P .BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ -", unsigned int " rtabuflen ); +", unsigned int " size ); .P .BI "unsigned int RTA_LENGTH(unsigned int " size ); .BI "unsigned int RTA_SPACE(unsigned int "size ); @@ -39,15 +39,15 @@ messages consist of a message header and appended attributes. The attributes should be manipulated only using the macros provided here. .P -.BI RTA_OK( rta ", " attrlen ) +.BI RTA_OK( rta ", " size ) returns true if .I rta points to a valid routing attribute; -.I attrlen +.I size 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 +.I size is nonzero. .P .BI RTA_DATA( rta ) @@ -56,11 +56,11 @@ returns a pointer to the start of this attribute's data. .BI RTA_PAYLOAD( rta ) returns the size of this attribute's data. .P -.BI RTA_NEXT( rta ", " attrlen ) +.BI RTA_NEXT( rta ", " size ) gets the next attribute after .IR rta . Calling this macro will update -.IR attrlen . +.IR size . You should use .B RTA_OK to check the validity of the returned pointer. diff --git a/man/man3/setaliasent.3 b/man/man3/setaliasent.3 index ed5817e41..c3dfadb7a 100644 --- a/man/man3/setaliasent.3 +++ b/man/man3/setaliasent.3 @@ -21,15 +21,15 @@ Standard C library .P .B "struct aliasent *getaliasent(void);" .BI "int getaliasent_r(struct aliasent *restrict " result , -.BI " char " buffer "[restrict ." buflen "], \ -size_t " buflen , +.BI " char " buffer "[restrict ." size "], \ +size_t " size , .BI " struct aliasent **restrict " res ); .P .BI "struct aliasent *getaliasbyname(const char *" name ); .BI "int getaliasbyname_r(const char *restrict " name , .BI " struct aliasent *restrict " result , -.BI " char " buffer "[restrict ." buflen "], \ -size_t " buflen , +.BI " char " buffer "[restrict ." size "], \ +size_t " size , .BI " struct aliasent **restrict " res ); .fi .SH DESCRIPTION diff --git a/man/man3/setnetgrent.3 b/man/man3/setnetgrent.3 index bc6f041dd..88b24cbca 100644 --- a/man/man3/setnetgrent.3 +++ b/man/man3/setnetgrent.3 @@ -24,7 +24,7 @@ Standard C library .BI " char **restrict " user ", char **restrict " domain ); .BI "int getnetgrent_r(char **restrict " host , .BI " char **restrict " user ", char **restrict " domain , -.BI " char " buf "[restrict ." buflen "], size_t " buflen ); +.BI " char " buf "[restrict ." size "], size_t " size ); .P .BI "int innetgr(const char *" netgroup ", const char *" host , .BI " const char *" user ", const char *" domain ); diff --git a/man/man3/strerror.3 b/man/man3/strerror.3 index e4679f4d5..14ef5d72d 100644 --- a/man/man3/strerror.3 +++ b/man/man3/strerror.3 @@ -32,10 +32,10 @@ Standard C library .BI "const char *strerrorname_np(int " errnum ); .BI "const char *strerrordesc_np(int " errnum ); .P -.BI "int strerror_r(int " errnum ", char " buf [. buflen "], size_t " buflen ); +.BI "int strerror_r(int " errnum ", char " buf [. size "], size_t " size ); /* XSI-compliant */ .P -.BI "char *strerror_r(int " errnum ", char " buf [. buflen "], size_t " buflen ); +.BI "char *strerror_r(int " errnum ", char " buf [. size "], size_t " size ); /* GNU-specific */ .P .BI "char *strerror_l(int " errnum ", locale_t " locale ); @@ -132,8 +132,8 @@ The XSI-compliant is preferred for portable applications. It returns the error string in the user-supplied buffer .I buf -of length -.IR buflen . +of size +.IR size . .P The GNU-specific .BR strerror_r () @@ -147,9 +147,9 @@ is unused). If the function stores a string in .IR buf , then at most -.I buflen +.I size bytes are stored (the string may be truncated if -.I buflen +.I size is too small and .I errnum is unknown). diff --git a/man/man3/ttyname.3 b/man/man3/ttyname.3 index fe24b8d3c..cb417684b 100644 --- a/man/man3/ttyname.3 +++ b/man/man3/ttyname.3 @@ -17,7 +17,7 @@ Standard C library .B #include .P .BI "char *ttyname(int " fd ); -.BI "int ttyname_r(int " fd ", char " buf [. buflen "], size_t " buflen ); +.BI "int ttyname_r(int " fd ", char " buf [. size "], size_t " size ); .fi .SH DESCRIPTION The function @@ -31,8 +31,8 @@ The function .BR ttyname_r () stores this pathname in the buffer .I buf -of length -.IR buflen . +of size +.IR size . .SH RETURN VALUE The function .BR ttyname () @@ -60,7 +60,7 @@ does not refer to a terminal device. .TP .B ERANGE .RB ( ttyname_r ()) -.I buflen +.I size was too small to allow storing the pathname. .SH ATTRIBUTES For an explanation of the terms used in this section, see