aboutsummaryrefslogtreecommitdiffstats
path: root/man3
AgeCommit message (Collapse)AuthorFilesLines
2021-09-11termios.3: srcfixAlejandro Colomar1-50/+76
Replace a list with .nf,.ft,.fi requests and hardcoded tabs, by commonly used (some not so common, such as TQ, but simple) macros: .RS,.RE,.TP,.TQ,.B Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-09-10termios.3: CIBAUD and IBSHIFT are implemented on Linux, just unsupported by ↵Pali Rohár1-1/+6
glibc Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-08-31malloc.3: Clarify that realloc() may move the memory blockMichael Kerrisk1-1/+2
Make it clearer, early in the discussion, that realloc() may move the block. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31malloc.3: wfixMichael Kerrisk1-1/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31malloc.3: ffixMichael Kerrisk1-1/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31malloc.3: Add some structuring to improve readabilityMichael Kerrisk1-6/+11
Add some subsection (.SS) headings and paragraph breaks in DESCRIPTION, to make the page more easily readable. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31malloc_hook.3: Modernize for glibc 2.34Paul Eggert1-3/+10
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31malloc.3: Modernize for glibc 2.34Paul Eggert1-84/+79
glibc has tightened up its rules for replacing the memory allocator. I went through the malloc man page and looked for how it documented malloc() and related functions, and fixed discrepancies with glibc malloc() documentation and/or implementation. I also reorganized the portability discussion so that portability issues can be seen more clearly. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31termios.3: Use bold style for B0Pali Rohár1-1/+3
Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31termios.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-31termios.3: Clarify zero argument for cfsetispeed()Pali Rohár1-1/+5
Zero in this case refers to literal constant 0 and not symbolic constant B0. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-27iconv.1, ldd.1, accept.2, access.2, add_key.2, arch_prctl.2, bpf.2, chmod.2, ↵Michael Kerrisk20-20/+20
chown.2, close_range.2, copy_file_range.2, execve.2, execveat.2, fanotify_mark.2, futex.2, futimesat.2, getpriority.2, intro.2, ioctl_tty.2, keyctl.2, link.2, membarrier.2, mkdir.2, mknod.2, mlock.2, mount.2, mount_setattr.2, open.2, open_by_handle_at.2, perf_event_open.2, pidfd_open.2, readlink.2, readv.2, rename.2, request_key.2, seccomp.2, sigaction.2, stat.2, statx.2, symlink.2, syscalls.2, umount.2, unlink.2, utimensat.2, wait.2, bsearch.3, fflush.3, getaddrinfo.3, getauxval.3, getopt.3, getsubopt.3, mkfifo.3, pthread_mutex_consistent.3, pthread_setname_np.3, pthread_tryjoin_np.3, scandir.3, sem_wait.3, stailq.3, strlen.3, strstr.3, termios.3, tsearch.3, wcslen.3, wcstok.3, wordexp.3, proc.5, capabilities.7, cgroups.7, fanotify.7, mount_namespaces.7, namespaces.7, path_resolution.7, pipe.7, posixoptions.7, user_namespaces.7, vdso.7, iconvconfig.8, ld.so.8: tstamp Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-27getaddrinfo.3: Note that 'errno' is set in parallel with EAI_SYSTEMAlejandro Colomar1-2/+2
The previous wording wasn't very explicit, leaving room for believing that 'errno' may be 0 after returning EAI_SYSTEM. Use a wording similar to other pages, for added consistency. [mtk: edited commit message title; also, POSIX notes that 'errno' is set in this case.] Reported-by: Cristian Morales Vega <christian.morales.vega@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-20getumask.3: Remove pageMichael Kerrisk1-67/+0
This function was never implemented on Linux. It seems pointless to retain such a page 20 years after it was written.
2021-08-18strsignal.3: wfixMichael Kerrisk1-1/+1
In NAME line, one of the instances of "sigdescr_np" should be "sigabbrev_np". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18strsignal.3: tfixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18tsearch.3: NAME: add twalk_rMichael Kerrisk1-1/+1
This function is described in the page. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18sigqueue.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18readv.2, pthread_tryjoin_np.3, stailq.3, strlen.3, wcslen.3: Arrange .SH ↵Michael Kerrisk4-25/+25
sections in correct order Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18intro.2, mount_setattr.2, seccomp_unotify.2, fflush.3, ↵Michael Kerrisk2-2/+2
pthread_mutex_consistent.3: Place SEE ALSO entries in correct order Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18chmod.2, chown.2, open.2, mkdir.2, mknod.2, readlink.2, stat.2, symlink.2, ↵Michael Kerrisk3-35/+30
mkfifo.3, scandir.3, sem_wait.3: ERRORS: combine errors into a single alphabetic list These pages split out extra errors for some APIs into a separate list. Probably, the pages are easier to ready if all errors are combined into a single list. Note that there still remain a few pages where the errors are listed separately for different APIs. For the moment, it seems best to leave those pages as is, since the error lists are largely distinct in those pages. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18arch_prctl.2, perf_event_open.2, pthread_tryjoin_np.3: ERRORS: correct ↵Michael Kerrisk1-5/+5
alphabetic order Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-18getpass.3: wfixMichael Kerrisk1-1/+0
Remove redundant phrase. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-12fanotify_mark.2, futimesat.2, mount_setattr.2, statx.2, symlink.2, mkfifo.3: ↵Michael Kerrisk1-0/+5
Refer the reader to openat(2) for explanation of why 'dirfd' is useful Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-12scandir.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-12mkfifo.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-12access.2, chmod.2, chown.2, execveat.2, futimesat.2, link.2, mkdir.2, ↵Michael Kerrisk2-2/+10
mknod.2, mount_setattr.2, open.2, open_by_handle_at.2, readlink.2, rename.2, stat.2, statx.2, symlink.2, unlink.2, utimensat.2, mkfifo.3, scandir.3: Fix EBADF error description Make the description of the EBADF error for invalid 'dirfd' more uniform. In particular, note that the error only occurs when the pathname is relative, and that it occurs when the 'dirfd' is neither valid *nor* has the value AT_FDCWD. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-10pthread_setname_np.3: EXAMPLES: remove a bug by simplify the codeMichael Kerrisk1-2/+1
From an email conversation with Alexis: Hello Alexis, On 8/6/21 7:06 PM, Alexis Wilke wrote: > Hi guys, > > The pthread_setname_np(3) manual page has an example where the second > argument is used to get a size of the thread name. > > https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html#EXAMPLES > > The current code: > > rc = pthread_getname_np(thread, thread_name, > (argc > 2) ? atoi(argv[1]) : NAMELEN); > > The suggested code: > > rc = pthread_getname_np(thread, thread_name, > (argc > 2) ? atoi(argv[2]) : NAMELEN); I agree that there's a problem, but I think we could go even simpler: rc = pthread_getname_np(thread, thread_name, NAMELEN); > I'm thinking that maybe the author meant to compute the length like so: > > rc = pthread_getname_np(thread, thread_name, > (argc > 2) ? strlen(argv[1]) + 1 : > NAMELEN); > > But I think that the atoi() points to using argv[2] as a number > representing the length. > > (Of course, it should be tested against NAMELEN as a maximum, but I > understand that examples do not always show how to verify each possible > error). I imagine that the author's intention was to allow the user to do experiments where argv[2] specified a number less than NAMELEN, in order to see the resulting ERANGE error. But, that experiment is of limited value, and complicates the code unnecessarily, IMO, so that's why I made the change above. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ Reported-by: Alexis Wilke <alexis@m2osw.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-10wcstok.3: Fix type mismatch in the exampleJakub Wilk1-2/+2
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09localedef.1, access.2, ioctl_console.2, ioctl_fslabel.2, openat2.2, write.2, ↵Michael Kerrisk5-8/+14
dlsym.3, getopt.3, nl_langinfo.3, termios.3, xcrypt.3, hosts.equiv.5, nsswitch.conf.5, cgroups.7, man-pages.7, netlink.7, system_data_types.7: srcfix: semantic newlines Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09nl_langinfo.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09getopt.3: Minor tweak to James's patchAlejandro Colomar1-1/+1
Cc: James O. D. Hunt <jamesodhunt@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09getopt.3: Further clarification of optstringJames O. D. Hunt1-1/+9
Explain that `optstring` cannot contain a semi-colon (`;`) character. [mtk: verified with a small test program; see also posix/getopt.c in the glibc sources: if (temp == NULL || c == ':' || c == ';') { if (print_errors) fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c); d->optopt = c; return '?'; } ] Also explain that `optstring` can include `+` as an option character, possibly in addition to that character being used as the first character in `optstring` to denote `POSIXLY_CORRECT` behaviour. [mtk: verified with a small test program.] Test program below. Example runs: $ ./a.out -+ opt = 43 (+); optind = 2 Got plus $ ./a.out -';' ./a.out: invalid option -- ';' opt = 63 (?); optind = 2; optopt = 59 (;) Unrecognized option (-;) Usage: ./a.out [-p arg] [-x] Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> 8x---8x---8x---8x---8x---8x---8x---8x---8x---8x---8x--- #include <ctype.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define printable(ch) (isprint((unsigned char) ch) ? ch : '#') static void /* Print "usage" message and exit */ usageError(char *progName, char *msg, int opt) { if (msg != NULL && opt != 0) fprintf(stderr, "%s (-%c)\n", msg, printable(opt)); fprintf(stderr, "Usage: %s [-p arg] [-x]\n", progName); exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { int opt, xfnd; char *pstr; xfnd = 0; pstr = NULL; while ((opt = getopt(argc, argv, "p:x+;")) != -1) { printf("opt =%3d (%c); optind = %d", opt, printable(opt), optind); if (opt == '?' || opt == ':') printf("; optopt =%3d (%c)", optopt, printable(optopt)); printf("\n"); switch (opt) { case 'p': pstr = optarg; break; case 'x': xfnd++; break; case ';': printf("Got semicolon\n"); break; case '+': printf("Got plus\n"); break; case ':': usageError(argv[0], "Missing argument", optopt); case '?': usageError(argv[0], "Unrecognized option", optopt); default: printf("Unexpected case in switch()\n"); exit(EXIT_FAILURE); } } if (xfnd != 0) printf("-x was specified (count=%d)\n", xfnd); if (pstr != NULL) printf("-p was specified with the value \"%s\"\n", pstr); if (optind < argc) printf("First nonoption argument is \"%s\" at argv[%d]\n", argv[optind], optind); exit(EXIT_SUCCESS); }
2021-08-09termios.3: wfixMichael Kerrisk1-3/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09termios.3: SPARC architecture has 4 different Bnnn constantsPali Rohár1-0/+23
SPARC is special, it does not have Bnnn constants for baud rates above 2000000. Instead it defines 4 Bnnn constants with smaller baud rates. This difference between SPARC and non-SPARC architectures is present in both glibc API (termios.h) and also kernel ioctl API (asm/termbits.h). Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09termios.3: ffixAlejandro Colomar1-7/+17
Format variable parts of words referring to a group of identifiers in italics, following groff_man(7) recommendations. Also srcfix surrounding uses of \f escape sequences to use macros Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09termios.3: Add information how to set baud rate to any other valuePali Rohár1-0/+7
Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09termios.3: Use bold style for Bnn and EXTn macro constantsPali Rohár1-2/+8
Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09termios.3: Document missing baud-rate constantsPali Rohár1-0/+12
These baud-rate macro constants are defined in bits/termios.h and are already supported. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-09regex.3: wfixнаб1-2/+2
"address of regcomp() initialized buffer" -> "address of regcomp()-initialized buffer" Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08strlen.3, wcslen.3: Recommend alternatives where input buffer might not be ↵Michael Kerrisk2-0/+10
null-terminated Reported-by: Jonny Grant <jg@jguk.org> Reported-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08getauxval.3: SEE ALSO: add execve(2)Michael Kerrisk1-0/+1
Since this page discusses program execution, a link to execve(2) seems appropriate. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08strstr.3: wfixMichael Kerrisk1-1/+0
Remove text that is probably redundant. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08strstr.3: Document special case for empty needleAlejandro Colomar1-0/+8
Reported-by: Stefan Kanthak <stefan.kanthak@nexgo.de> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08printf.3: tfixMichael Kerrisk1-1/+1
Reported-by: Sergey Petrakov <kr@spmail.info> Reported-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-07Various pages: Consistently use '*argv[]'Thomas Voss5-5/+5
Scripted change: $ find man? -type f \ | sed -i 's/int argc, char \*\*argv/int argc, char \*argv\[\]/'; Signed-off-by: Thomas Voss <thomasavoss@protonmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-07-26crypt.3: ffixMichael Kerrisk1-12/+17
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-07-25bzero.3: wfixMichael Kerrisk1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-07-25atanh.3: tfixMichael Kerrisk1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-22exit_group.2, ioprio_set.2, process_madvise.2, seccomp_unotify.2, ↵Michael Kerrisk1-1/+1
set_mempolicy.2, set_tid_address.2, bswap.3, kernel_lockdown.7: tstamp Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-20strcmp.3: tfixAlejandro Colomar1-1/+1
With a simple backslash, '\0' ended up as ' ' in the man output. Reported-by: Štěpán Němec <stepnem@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-20ferror.3: tfixthomasavoss1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-20getline.3: !*lineptr is sufficientнаб1-3/+1
No implementation or spec requires *n to be 0 to allocate a new buffer: * musl checks for !*lineptr (and sets *n=0 for later allocations) * glibc checks for !*lineptr || !*n (but only because it allocates early) * NetBSD checks for !*lineptr (and sets *n=0 for later allocations) (but specifies *n => mlen(*lineptr) >= *n as a precondition, to which this appears to be an exception) * FreeBSD checks for !*lineptr and sets *n=0 (and specifies !*lineptr as sufficient) * Lastly, POSIX.1-2017 specifies: > If *n is non-zero, the application shall ensure that *lineptr > either points to an object of size at least *n bytes, > or is a null pointer. The new wording matches POSIX, even if it arrives at the point slightly differently Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-20MIN.3: New link to MIN.3Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-20MAX.3: New page to document MAX() and MIN()Alejandro Colomar1-0/+90
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Cc: Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10cmsg.3, unix.7: Refer to seccomp_unotify(2) for an example of SCM_RIGHTS usageMichael Kerrisk1-0/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10mode_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10blksize_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10cc_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10blkcnt_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17ctime.3: Restore documentation of 'tm_gmtoff' fieldMichael Kerrisk1-0/+1
Accidentally deleted in commit ba39b288ab0714941786. Reported-by: Katsuhiro Numata <byakkomon@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-12expm1.3: tfixAkihiro Motoki1-1/+1
Signed-off-by: Akihiro Motoki <amotoki@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-12sigvec.3: tfixAkihiro Motoki1-1/+1
Signed-off-by: Akihiro Motoki <amotoki@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-12ttyslot.3: tfixAkihiro Motoki1-1/+1
Signed-off-by: Akihiro Motoki <amotoki@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-12tgamma.3: tfixAkihiro Motoki1-1/+0
Signed-off-by: Akihiro Motoki <amotoki@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11fflush.3: SEE ALSO: Add fpurge(3)Alejandro Colomar1-0/+1
fpurge(i_stream) does the same as fflush(i_stream), AFAIK. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10basename.3: wfixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10bswap.3: bswap_*() are implemented using functionsAlejandro Colomar1-7/+7
See <bits/byteswap.h> in glibc. These macros call functions of the form __bswap_N(), which use uintN_t. Even though it's true that they are macros, it's transparent to the user. The user will see their results casted to unsigned types after the conversion due to the underlying functions, so it's better to document these as the underlying functions, specifying the types. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_attr_setschedparam.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+4
Both POSIX and glibc use 'restrict' in pthread_attr_getschedparam(), pthread_attr_setschedparam(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getschedparam sysdeps/htl/pthread.h:102: extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:294: extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype pthread_attr_setschedparam sysdeps/htl/pthread.h:107: extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:299: extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in pthread_attr_getinheritsched(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getinheritsched sysdeps/htl/pthread.h:90: extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inheritsched) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:313: extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10xdr.3: SYNOPSIS: Fix prototype typesAlejandro Colomar1-2/+2
Use the same types glibc uses, and add a missing 'const'. .../glibc$ grep_glibc_prototype xdr_union sunrpc/rpc/xdr.h:315: extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp, const struct xdr_discrim *__choices, xdrproc_t __dfault) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10rpc.3: SYNOPSIS: Fix prototypes (misc.)Alejandro Colomar1-12/+13
Fix the types for the following functions: authunix_create(), callrpc(), clnt_create(), clnt_pcreateerror(), clnt_perror(), clnt_spcreateerror(), clnt_sperror(), pmap_set(), svc_register(), svcerr_progvers(). .../glibc$ grep_glibc_prototype authunix_create sunrpc/rpc/auth.h:158: extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid, int __len, __gid_t *__aup_gids); .../glibc$ grep_glibc_prototype callrpc sunrpc/rpc/clnt.h:359: extern int callrpc (const char *__host, const u_long __prognum, const u_long __versnum, const u_long __procnum, const xdrproc_t __inproc, const char *__in, const xdrproc_t __outproc, char *__out) __THROW; .../glibc$ grep_glibc_prototype clnt_create sunrpc/rpc/clnt.h:291: extern CLIENT *clnt_create (const char *__host, const u_long __prog, const u_long __vers, const char *__prot) __THROW; .../glibc$ grep_glibc_prototype clnt_pcreateerror sunrpc/rpc/clnt.h:368: extern void clnt_pcreateerror (const char *__msg); /* stderr */ .../glibc$ grep_glibc_prototype clnt_perror sunrpc/rpc/clnt.h:379: extern void clnt_perror (CLIENT *__clnt, const char *__msg); .../glibc$ grep_glibc_prototype clnt_spcreateerror sunrpc/rpc/clnt.h:369: extern char *clnt_spcreateerror(const char *__msg) __THROW; /* string */ .../glibc$ grep_glibc_prototype clnt_sperror sunrpc/rpc/clnt.h:381: extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW; .../glibc$ grep_glibc_prototype pmap_set sunrpc/rpc/pmap_clnt.h:69: extern bool_t pmap_set (const u_long __program, const u_long __vers, int __protocol, u_short __port) __THROW; .../glibc$ grep_glibc_prototype svc_register sunrpc/rpc/svc.h:188: extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog, rpcvers_t __vers, __dispatch_fn_t __dispatch, rpcprot_t __protocol) __THROW; .../glibc$ grep_glibc_prototype svcerr_progvers sunrpc/rpc/svc.h:253: extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers, rpcvers_t __high_vers) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10cpow.3: Use 'complex' after the type consistentlyAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10dladdr.3: SYNOPSIS: Add missing 'const'Alejandro Colomar1-3/+3
Glibc uses 'const' for the 1st parameter of these functions. Fix the prototypes. ...... .../glibc$ grep_glibc_prototype dladdr dlfcn/dlfcn.h:98: extern int dladdr (const void *__address, Dl_info *__info) __THROW __nonnull ((2)); .../glibc$ grep_glibc_prototype dladdr1 dlfcn/dlfcn.h:102: extern int dladdr1 (const void *__address, Dl_info *__info, void **__extra_info, int __flags) __THROW __nonnull ((2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10sched_get_priority_max.2, open_memstream.3: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const'Alejandro Colomar1-1/+1
glibc uses 'const' in pthread_setattr_default_np(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_setattr_default_np sysdeps/nptl/pthread.h:406: extern int pthread_setattr_default_np (const pthread_attr_t *__attr) __THROW __nonnull ((1)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const'Alejandro Colomar1-1/+1
Neither POSIX or glibc use 'const' in pthread_mutexattr_setrobust(). Remove it. .../glibc$ grep_glibc_prototype pthread_mutexattr_setrobust sysdeps/htl/pthread.h:355: extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); sysdeps/nptl/pthread.h:888: extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10tzset.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10strsignal.3: SYNOPSIS: Add missing 'const'Alejandro Colomar1-2/+2
glibc uses 'const' in sigdescr_np(), sigabbrev_np(). Let's use it here too. .../glibc$ grep_glibc_prototype sigdescr_np string/string.h:469: extern const char *sigdescr_np (int __sig) __THROW; .../glibc$ grep_glibc_prototype sigabbrev_np string/string.h:466: extern const char *sigabbrev_np (int __sig) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10strsignal.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10__ppc_get_timebase.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10perror.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10on_exit.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10getutmp.3: ffixAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10malloc_usable_size.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10getopt.3: Minor tweaks to James' patchAlejandro Colomar1-1/+1
The rest of the page writes the characters without naming them. Follow that convention. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10getopt.3: Clarify behaviourJames O. D. Hunt1-0/+23
Improved the `getopt(3)` man page in the following ways: 1) Defined the existing term "legitimate option character". 2) Added an additional NOTE stressing that arguments are parsed in strict order and the implications of this when numeric options are utilised. Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10setbuf.3: tfixAlejandro Colomar1-1/+1
Reported-by: Zhiheng Li <phoenix_lzh@sina.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>)Alejandro Colomar1-1/+0
In b0b19983d9a2001ce94b908a99f4c05a50fd47ee we removed <sys/types.h>. For the same reasons there, remove now <sys/ipc.h> from many pages. If someone wonders why <sys/ipc.h> was needed, the reason was to get all the definitions of IPC_* constants. However, that header is now included by <sys/msg.h>, so it's not needed anymore to explicitly include it. Quoting POSIX: "In addition, the <sys/msg.h> header shall include the <sys/ipc.h> header." There were some remaining cases where I forgot to remove <sys/types.h>; remove them now too. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_yield.3: Note that this function is deprecated since glibc 2.34Michael Kerrisk1-0/+5
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_mutexattr_setrobust.3: Note that the *_np() APIs are deprecated ↵Michael Kerrisk1-1/+2
since glibc 2.34 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_mutex_consistent.3: Note that pthread_mutexattr_setrobust() is now ↵Michael Kerrisk1-1/+2
deprecated Deprecated since glibc 2.34. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10pthread_mutex_consistent.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05scanf.3: Clarify that %n supports type modifiersAlyssa Ross1-1/+3
My initial reading of this was that type modifiers were probably not supported. But they are, and this is actually documented further up, in the type modifiers documentation. But to make it clearer, let's copy the language that printf(3) has in its %n section. Signed-off-by: Alyssa Ross <hi@alyssa.is> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05shm_open.3: wfixMichael Kerrisk1-1/+1
Reported-by: Jon Murphy <jonmurphy1618@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05socklen_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05sockaddr.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04errno.3: Fix ENODATA textAlejandro Colomar1-1/+7
ENODATA is an XSI STREAMS extension (not base POSIX). Linux reused the name for extended attributes. The current manual pages don't use ENODATA with its POSIX meaning, so use the xattr(7) specific text, and leave the POSIX meaning for a secondary paragraph. Reported-by: Mark Kettenis <kettenis@openbsd.org> Reported-by: Florian Weimer <fw@deneb.enyo.de> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04exec.3: Clarify that execvpe uses PATH from the caller, not envpJosh Triplett1-0/+7
Checked via the latest glibc source. execvpe calls getenv("PATH") and searches that; the PATH in envp does not affect the search. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04exec.3: Fix description of 'e' variantsJosh Triplett1-1/+1
The envp argument specifies the environment of the new process image, not "the environment of the caller". Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04printf.3: Minor wording tweaks to Utkarsh's patchAlejandro Colomar1-1/+1
The format string refers to the whole string passed in 'format'. The syntax referred to is that of a conversion specification, as called in the manual page. Use specific language. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04printf.3: Add overall structure of format stringUtkarsh Singh1-0/+8
Can we add a small syntax structure for format string in printf(3) manual. I personally find if easier to remember and scan. This has been taken from OpenBSD printf(3) manual. Signed-off-by: Utkarsh Singh <utkarsh190601@gmail.com> [ alx: ffix ] Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-22getent.1, ldd.1, locale.1, localedef.1, memusage.1, memusagestat.1, ↵Michael Kerrisk562-562/+562
mtrace.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, add_key.2, adjtimex.2, alloc_hugepages.2, arch_prctl.2, bdflush.2, bind.2, bpf.2, brk.2, cacheflush.2, capget.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, close_range.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fanotify_init.2, fanotify_mark.2, fcntl.2, flock.2, fork.2, fsync.2, futex.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpid.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, getxattr.2, idle.2, init_module.2, inotify_add_watch.2, inotify_rm_watch.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl.2, ioctl_console.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_fslabel.2, ioctl_getfsmap.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ipc.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open.2, open_by_handle_at.2, openat2.2, pause.2, pciconfig_read.2, perf_event_open.2, perfmonctl.2, personality.2, pidfd_getfd.2, pidfd_open.2, pidfd_send_signal.2, pipe.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readlink.2, readv.2, reboot.2, recv.2, remap_file_pages.2, removexattr.2, rename.2, request_key.2, restart_syscall.2, rmdir.2, rt_sigqueueinfo.2, s390_guarded_storage.2, s390_pci_mmio_write.2, s390_runtime_instr.2, s390_sthyi.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, set_thread_area.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, setup.2, setxattr.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, shutdown.2, sigaction.2, sigaltstack.2, signal.2, signalfd.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, stime.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscall.2, syscalls.2, sysctl.2, sysfs.2, sysinfo.2, syslog.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, uname.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3, __setfpucw.3, a64l.3, abort.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, aio_cancel.3, aio_error.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, backtrace.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, btowc.3, byteorder.3, bzero.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cbrt.3, ccos.3, ccosh.3, ceil.3, cexp.3, cexp2.3, cfree.3, cimag.3, circleq.3, clearenv.3, clock.3, clock_getcpuclockid.3, clog.3, clog10.3, clog2.3, closedir.3, cmsg.3, confstr.3, conj.3, copysign.3, cos.3, cosh.3, cpow.3, cproj.3, creal.3, crypt.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, ctermid.3, ctime.3, daemon.3, des_crypt.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dladdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, encrypt.3, endian.3, envz_add.3, erf.3, erfc.3, err.3, errno.3, error.3, ether_aton.3, euidaccess.3, exec.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fclose.3, fcloseall.3, fdim.3, fenv.3, ferror.3, fexecve.3, fflush.3, ffs.3, fgetc.3, fgetgrent.3, fgetpwent.3, fgetwc.3, fgetws.3, fileno.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fmtmsg.3, fnmatch.3, fopen.3, fopencookie.3, fpathconf.3, fpclassify.3, fpurge.3, fputwc.3, fputws.3, fread.3, frexp.3, fseek.3, fseeko.3, ftime.3, ftok.3, fts.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent.3, getnetent_r.3, getopt.3, getpass.3, getprotoent.3, getprotoent_r.3, getpt.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getrpcent_r.3, getrpcport.3, gets.3, getservent.3, getservent_r.3, getspnam.3, getsubopt.3, getttyent.3, getumask.3, getusershell.3, getutent.3, getutmp.3, getw.3, getwchar.3, glob.3, gnu_get_libc_version.3, grantpt.3, group_member.3, gsignal.3, hsearch.3, hypot.3, iconv.3, iconv_close.3, iconv_open.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, initgroups.3, insque.3, isalpha.3, isatty.3, isfdtype.3, isgreater.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, j0.3, key_setsecret.3, killpg.3, ldexp.3, lgamma.3, lio_listio.3, list.3, localeconv.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, login.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_hook.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, mempcpy.3, memset.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mpool.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, nan.3, newlocale.3, nextafter.3, nextup.3, nl_langinfo.3, ntp_gettime.3, on_exit.3, open_memstream.3, opendir.3, openpty.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, posix_spawn.3, pow.3, pow10.3, printf.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setsigmask_np.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_mutex_consistent.3, pthread_mutexattr_getpshared.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_spin_init.3, pthread_spin_lock.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, ptsname.3, putenv.3, putgrent.3, putpwent.3, puts.3, putwchar.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, rcmd.3, re_comp.3, readdir.3, readdir_r.3, realpath.3, regex.3, remainder.3, remove.3, remquo.3, resolver.3, rewinddir.3, rexec.3, rint.3, round.3, rpc.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, setlocale.3, setlogmask.3, setnetgrent.3, shm_open.3, siginterrupt.3, signbit.3, significand.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sincos.3, sinh.3, sleep.3, slist.3, sockatmark.3, sqrt.3, stailq.3, statvfs.3, stdarg.3, stdio.3, stdio_ext.3, stpcpy.3, stpncpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfmon.3, strfromd.3, strfry.3, strftime.3, string.3, strlen.3, strnlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtod.3, strtoimax.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tailq.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, towctrans.3, towlower.3, towupper.3, trunc.3, tsearch.3, ttyname.3, ttyslot.3, tzset.3, ualarm.3, ulimit.3, undocumented.3, ungetwc.3, unlocked_stdio.3, unlockpt.3, updwtmp.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstoimax.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wordexp.3, wprintf.3, xcrypt.3, xdr.3, y0.3, cciss.4, console_codes.4, dsp56k.4, hpsa.4, initrd.4, loop.4, lp.4, msr.4, random.4, rtc.4, smartpqi.4, veth.4, wavelan.4, acct.5, core.5, elf.5, hosts.5, locale.5, proc.5, resolv.conf.5, rpc.5, slabinfo.5, sysfs.5, tmpfs.5, utmp.5, address_families.7, aio.7, attributes.7, bootparam.7, capabilities.7, cgroups.7, complex.7, ddp.7, environ.7, epoll.7, fanotify.7, feature_test_macros.7, hier.7, inode.7, inotify.7, ip.7, ipv6.7, keyrings.7, locale.7, man-pages.7, man.7, math_error.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, numa.7, packet.7, pkeys.7, pthreads.7, queue.7, raw.7, rtnetlink.7, sched.7, session-keyring.7, shm_overview.7, sigevent.7, signal-safety.7, signal.7, sock_diag.7, socket.7, spufs.7, symlink.7, system_data_types.7, tcp.7, time_namespaces.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, user_namespaces.7, vdso.7, vsock.7, x25.7, iconvconfig.8, ld.so.8, ldconfig.8, sln.8, tzselect.8: tstamp Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wprintf.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+10
POSIX uses 'restrict' in *wprintf() (see [v]fwprintf(3p)). Let's use it here too. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14scandir.3: ffixMichael Kerrisk1-2/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14rcmd.3: ffixMichael Kerrisk1-11/+13
In SYNOPSIS, shift arguments right a little to make the function names stand out a little more. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wordexp.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wordexp(). Let's use it here too. .../glibc$ grep_glibc_prototype wordexp posix/wordexp.h:62: extern int wordexp (const char *__restrict __words, wordexp_t *__restrict __pwordexp, int __flags); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wmemcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+3
Both POSIX and glibc use 'restrict' in wmemcpy(). Let's use it here too. .../glibc$ grep_glibc_prototype wmemcpy wcsmbs/wchar.h:262: extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcstombs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wcstombs(). Let's use it here too. .../glibc$ grep_glibc_prototype wcstombs stdlib/stdlib.h:937: extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) __THROW __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcstok.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in wcstok(). Let's use it here too. .../glibc$ grep_glibc_prototype wcstok wcsmbs/wchar.h:217: extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcstoimax.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+4
Both POSIX and glibc use 'restrict' in wcstoimax(), wcstoumax(). Let's use it here too. .../glibc$ grep_glibc_prototype wcstoimax stdlib/inttypes.h:305: extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __THROW; .../glibc$ grep_glibc_prototype wcstoumax stdlib/inttypes.h:310: extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcsrtombs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in wcsrtombs(). Let's use it here too. .../glibc$ grep_glibc_prototype wcsrtombs wcsmbs/wchar.h:343: extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcsnrtombs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in wcsnrtombs(). Let's use it here too. .../glibc$ grep_glibc_prototype wcsnrtombs wcsmbs/wchar.h:357: extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcsncpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+3
Both POSIX and glibc use 'restrict' in wcsncpy(). Let's use it here too. .../glibc$ grep_glibc_prototype wcsncpy wcsmbs/wchar.h:92: extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcsncat.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+3
Both POSIX and glibc use 'restrict' in wcsncat(). Let's use it here too. .../glibc$ grep_glibc_prototype wcsncat wcsmbs/wchar.h:101: extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcscpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wcscpy(). Let's use it here too. .../glibc$ grep_glibc_prototype wcscpy wcsmbs/wchar.h:87: extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcscat.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wcscat(). Let's use it here too. .../glibc$ grep_glibc_prototype wcscat wcsmbs/wchar.h:97: extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcrtomb.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wcrtomb(). Let's use it here too. .../glibc$ grep_glibc_prototype wcrtomb wcsmbs/wchar.h:301: extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcpncpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+3
Both POSIX and glibc use 'restrict' in wcpncpy(). Let's use it here too. .../glibc$ grep_glibc_prototype wcpncpy wcsmbs/wchar.h:556: extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14wcpcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in wcpcpy(). Let's use it here too. .../glibc$ grep_glibc_prototype wcpcpy wcsmbs/wchar.h:551: extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14unlocked_stdio.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+12
glibc uses 'restrict' in fread_unlocked(), fwrite_unlocked(), fgets_unlocked(), fputs_unlocked(), fgetws_unlocked(), fputws_unlocked(). Let's use it here too. .../glibc$ grep_glibc_prototype fread_unlocked libio/stdio.h:678: extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __wur; .../glibc$ grep_glibc_prototype fwrite_unlocked libio/stdio.h:680: extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); .../glibc$ grep_glibc_prototype fgets_unlocked libio/stdio.h:591: extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) __wur __attr_access ((__write_only__, 1, 2)); .../glibc$ grep_glibc_prototype fputs_unlocked libio/stdio.h:667: extern int fputs_unlocked (const char *__restrict __s, FILE *__restrict __stream); .../glibc$ grep_glibc_prototype fgetws_unlocked wcsmbs/wchar.h:820: extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); .../glibc$ grep_glibc_prototype fputws_unlocked wcsmbs/wchar.h:829: extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14tsearch.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in tdelete(). Let's use it here too. .../glibc$ grep_glibc_prototype tdelete misc/search.h:138: extern void *tdelete (const void *__restrict __key, void **__restrict __rootp, __compar_fn_t __compar); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14scanf.3: SYNOPSIS: Use 'restrict' in prototypes; ffix too.Alejandro Colomar1-6/+10
Both POSIX and glibc use 'restrict' in scanf(), fscanf(), sscanf(), vscanf(), vfscanf(), vsscanf(). Let's use it here too. .../glibc$ grep_glibc_prototype scanf libio/stdio.h:397: extern int scanf (const char *__restrict __format, ...) __wur; .../glibc$ grep_glibc_prototype fscanf libio/stdio.h:391: extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __wur; .../glibc$ grep_glibc_prototype sscanf libio/stdio.h:399: extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; .../glibc$ grep_glibc_prototype vscanf libio/stdio.h:443: extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; .../glibc$ grep_glibc_prototype vfscanf libio/stdio.h:435: extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; .../glibc$ grep_glibc_prototype vsscanf libio/stdio.h:447: extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __THROW __attribute__ ((__format__ (__scanf__, 2, 0))); .../glibc$ Also reorder v* functions to match the order of non-v functions. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14sigwait.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in sigwait(). Let's use it here too. .../glibc$ grep_glibc_prototype sigwait signal/signal.h:255: extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig) __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14sigwait.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14swab.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in swab(). Let's use it here too. .../glibc$ grep_glibc_prototype swab posix/unistd.h:1147: extern void swab (const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull ((1, 2)) __attr_access ((__read_only__, 1, 3)) __attr_access ((__write_only__, 2, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strxfrm.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in strxfrm(). Let's use it here too. .../glibc$ grep_glibc_prototype strxfrm string/string.h:150: extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strtol.3, strtoul.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar2-7/+8
Both POSIX and glibc use 'restrict' in strtol(), strtoll(), strtoul(), strtoull(). Let's use it here too. .../glibc$ grep_glibc_prototype strtol stdlib/stdlib.h:176: extern long int strtol (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); .../glibc$ grep_glibc_prototype strtoll stdlib/stdlib.h:199: __extension__ extern long long int strtoll (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); .../glibc$ grep_glibc_prototype strtoul stdlib/stdlib.h:180: extern unsigned long int strtoul (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); .../glibc$ grep_glibc_prototype strtoull stdlib/stdlib.h:204: __extension__ extern unsigned long long int strtoull (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strtok.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in strtok(), strtok_r(). Let's use it here too. .../glibc$ grep_glibc_prototype strtok string/string.h:340: extern char *strtok (char *__restrict __s, const char *__restrict __delim) __THROW __nonnull ((2)); .../glibc$ grep_glibc_prototype strtok_r string/string.h:350: extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strtoimax.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+4
Both POSIX and glibc use 'restrict' in strtoimax(), strtoumax(). Let's use it here too. .../glibc$ grep_glibc_prototype strtoimax stdlib/inttypes.h:297: extern intmax_t strtoimax (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; .../glibc$ grep_glibc_prototype strtoumax stdlib/inttypes.h:301: extern uintmax_t strtoumax (const char *__restrict __nptr, char ** __restrict __endptr, int __base) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strtod.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+4
Both POSIX and glibc use 'restrict' in strtod(), strtof(), strtold(). Let's use it here too. .../glibc$ grep_glibc_prototype strtod stdlib/stdlib.h:117: extern double strtod (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); .../glibc$ grep_glibc_prototype strtof stdlib/stdlib.h:123: extern float strtof (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); .../glibc$ grep_glibc_prototype strtold stdlib/stdlib.h:126: extern long double strtold (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strsep.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
glibc uses 'restrict' in strsep(). Let's use it here too. .../glibc$ grep_glibc_prototype strsep string/string.h:455: extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strptime.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in strptime(). However, glibc doesn't specify 'restrict' for the last parameter. Let's use the most restrictive form here (although I believe both to be equivalent). .../glibc$ grep_glibc_prototype strptime time/time.h:95: extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; .../glibc$ Cc: <libc-alpha@sourceware.org> Cc: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14string.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
glibc uses 'restrict' in strsep(). Let's use it here too. .../glibc$ grep_glibc_prototype strsep string/string.h:455: extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14string.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+11
Both POSIX and glibc use 'restrict' in stpcpy(), strcat(), strcpy(), strncat(), strncpy(), strtok(), strxfrm(). Let's use it here too. .../glibc$ grep_glibc_prototype stpcpy string/string.h:475: extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strcat string/string.h:133: extern char *strcat (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strcpy string/string.h:125: extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strncat string/string.h:136: extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strncpy string/string.h:128: extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strtok string/string.h:340: extern char *strtok (char *__restrict __s, const char *__restrict __delim) __THROW __nonnull ((2)); .../glibc$ grep_glibc_prototype strxfrm string/string.h:150: extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strftime.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in strftime(). Let's use it here too. .../glibc$ grep_glibc_prototype strftime timezone/private.h:506: size_t strftime(char *restrict, size_t, char const *restrict, struct tm const *restrict); time/time.h:88: extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strfmon.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+4
Both POSIX and glibc use 'restrict' in strfmon(), strfmon_l(). Let's use it here too. .../glibc$ grep_glibc_prototype strfmon stdlib/monetary.h:38: extern ssize_t strfmon (char *__restrict __s, size_t __maxsize, const char *__restrict __format, ...) __THROW __attribute_format_strfmon__ (3, 4); .../glibc$ grep_glibc_prototype strfmon_l stdlib/monetary.h:47: extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, locale_t __loc, const char *__restrict __format, ...) __THROW __attribute_format_strfmon__ (4, 5); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in strcpy(), strncpy(). Let's use it here too. .../glibc$ grep_glibc_prototype strcpy string/string.h:125: extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strncpy string/string.h:128: extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14strcat.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in strcat(), strncat(). Let's use it here too. .../glibc$ grep_glibc_prototype strcat string/string.h:133: extern char *strcat (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strncat string/string.h:136: extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14stpncpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in stpncpy(). Let's use it here too. .../glibc$ grep_glibc_prototype stpncpy string/string.h:483: extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14stpcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in stpcpy(). Let's use it here too. .../glibc$ grep_glibc_prototype stpcpy string/string.h:475: extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14statvfs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in statvfs(). Let's use it here too. .../glibc$ grep_glibc_prototype statvfs io/sys/statvfs.h:51: extern int statvfs (const char *__restrict __file, struct statvfs *__restrict __buf) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14setnetgrent.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-5/+7
glibc uses 'restrict' in getnetgrent(), getnetgrent_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getnetgrent resolv/netdb.h:410: extern int getnetgrent (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp); .../glibc$ grep_glibc_prototype getnetgrent_r resolv/netdb.h:430: extern int getnetgrent_r (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14setbuf.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+3
Both POSIX and glibc use 'restrict' in setvbuf(), setbuf(). Let's use it here too. .../glibc$ grep_glibc_prototype setvbuf libio/stdio.h:308: extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __THROW; .../glibc$ grep_glibc_prototype setbuf libio/stdio.h:304: extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14setbuf.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
glibc uses 'restrict' in setbuffer(). Let's use it here too. .../glibc$ grep_glibc_prototype setbuffer libio/stdio.h:314: extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14setaliasent.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-6/+7
glibc uses 'restrict' in getaliasent_r(), getaliasbyname_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getaliasent_r inet/aliases.h:48: extern int getaliasent_r (struct aliasent *__restrict __result_buf, char *__restrict __buffer, size_t __buflen, struct aliasent **__restrict __result) __THROW; .../glibc$ grep_glibc_prototype getaliasbyname_r inet/aliases.h:56: extern int getaliasbyname_r (const char *__restrict __name, struct aliasent *__restrict __result_buf, char *__restrict __buffer, size_t __buflen, struct aliasent **__restrict __result) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14sem_wait.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in sem_timedwait(). Let's use it here too. .../glibc$ grep_glibc_prototype sem_timedwait sysdeps/pthread/semaphore.h:62: extern int sem_timedwait (sem_t *__restrict __sem, const struct timespec *__restrict __abstime) __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14sem_getvalue.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in sem_getvalue(). Let's use it here too. .../glibc$ grep_glibc_prototype sem_getvalue sysdeps/pthread/semaphore.h:81: extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_mutexattr_getpshared.3, pthread_rwlockattr_setkind_np.3: ffixMichael Kerrisk2-6/+6
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14scandir.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
glibc uses 'restrict' in scandirat(). Let's use it here too. .../glibc$ grep_glibc_prototype scandirat dirent/dirent.h:293: extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull ((2, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14scandir.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
POSIX does NOT specify scandir() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! .../glibc$ grep_glibc_prototype scandir dirent/dirent.h:255: extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull ((1, 2)); .../glibc$ Cc: glibc <libc-alpha@sourceware.org> Cc: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14rexec.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+6
glibc uses 'restrict' in rexec(), rexec_af(). Let's use it here too. .../glibc$ grep_glibc_prototype rexec resolv/netdb.h:477: extern int rexec (char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p); .../glibc$ grep_glibc_prototype rexec_af resolv/netdb.h:489: extern int rexec_af (char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14regex.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-6/+8
Both POSIX and glibc use 'restrict' in regcomp(), regexec(), regerror(). Let's use it here too. .../glibc$ grep_glibc_prototype regcomp posix/regex.h:644: extern int regcomp (regex_t *_Restrict_ __preg, const char *_Restrict_ __pattern, int __cflags); .../glibc$ grep_glibc_prototype regexec posix/regex.h:648: extern int regexec (const regex_t *_Restrict_ __preg, const char *_Restrict_ __String, size_t __nmatch, regmatch_t __pmatch[_Restrict_arr_], int __eflags); .../glibc$ grep_glibc_prototype regerror posix/regex.h:653: extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, char *_Restrict_ __errbuf, size_t __errbuf_size); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14realpath.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in realpath(). Let's use it here too. .../glibc$ grep_glibc_prototype realpath stdlib/stdlib.h:800: extern char *realpath (const char *__restrict __name, char *__restrict __resolved) __THROW __wur; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14readdir_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in readdir_r(). Let's use it here too. .../glibc$ grep_glibc_prototype readdir_r dirent/dirent.h:183: extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull ((1, 2, 3)) __attribute_deprecated__; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14rcmd.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-12/+14
glibc uses 'restrict' in rcmd(), rcmd_af(), iruserok_af(). Let's use it here too. .../glibc$ grep_glibc_prototype rcmd resolv/netdb.h:449: extern int rcmd (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); .../glibc$ grep_glibc_prototype rcmd_af resolv/netdb.h:461: extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); .../glibc$ grep_glibc_prototype iruserok_af resolv/netdb.h:537: extern int iruserok_af (const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14random_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+6
glibc uses 'restrict' in random_r(), initstate_r(), setstate_r(). Let's use it here too. .../glibc$ grep_glibc_prototype random_r stdlib/stdlib.h:434: extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype initstate_r stdlib/stdlib.h:440: extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __THROW __nonnull ((2, 4)); .../glibc$ grep_glibc_prototype setstate_r stdlib/stdlib.h:445: extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14qecvt.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+6
glibc uses 'restrict' in qecvt(), qfcvt(). Let's use it here too. .../glibc$ grep_glibc_prototype qecvt stdlib/stdlib.h:890: extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; .../glibc$ grep_glibc_prototype qfcvt stdlib/stdlib.h:893: extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14puts.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in fputs(). Let's use it here too. .../glibc$ grep_glibc_prototype fputs libio/stdio.h:631: extern int fputs (const char *__restrict __s, FILE *__restrict __stream); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14putpwent.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
glibc uses 'restrict' in putpwent(). Let's use it here too. .../glibc$ grep_glibc_prototype putpwent pwd/pwd.h:102: extern int putpwent (const struct passwd *__restrict __p, FILE *__restrict __f); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14putgrent.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
glibc uses 'restrict' in putgrent(). Let's use it here too. .../glibc$ grep_glibc_prototype putgrent grp/grp.h:93: extern int putgrent (const struct group *__restrict __p, FILE *__restrict __f); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_setschedparam.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in pthread_getschedparam(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_getschedparam sysdeps/htl/pthread.h:882: extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull ((2, 3)); sysdeps/nptl/pthread.h:426: extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull ((2, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_rwlockattr_setkind_np.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+4
glibc uses 'restrict' in pthread_rwlockattr_getkind_np(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_rwlockattr_getkind_np sysdeps/htl/pthread.h:633: extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:983: extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_mutexattr_getpshared.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+4
Both POSIX and glibc use 'restrict' in pthread_mutexattr_getpshared(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_mutexattr_getpshared sysdeps/htl/pthread.h:368: extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:830: extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_create.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+4
Both POSIX and glibc use 'restrict' in pthread_create(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_create sysdeps/htl/pthread.h:212: extern int pthread_create (pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, void *(*__start_routine)(void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); sysdeps/nptl/pthread.h:200: extern int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_attr_setstack.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in pthread_attr_setstack(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_setstack sysdeps/htl/pthread.h:158: extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull ((1)); sysdeps/nptl/pthread.h:367: extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull ((1)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_attr_setstacksize.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in pthread_attr_getstacksize(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getstacksize sysdeps/htl/pthread.h:192: extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:346: extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_attr_setstackaddr.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in pthread_attr_getstackaddr(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getstackaddr sysdeps/htl/pthread.h:138: extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:333: extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __THROW __nonnull ((1, 2)) __attribute_deprecated__; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_attr_setscope.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+3
Both POSIX and glibc use 'restrict' in pthread_attr_getscope(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getscope sysdeps/htl/pthread.h:125: extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __contentionscope) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:324: extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __scope) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-14pthread_attr_setschedpolicy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+3
Both POSIX and glibc use 'restrict' in pthread_attr_getschedpolicy(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getschedpolicy sysdeps/htl/pthread.h:113: extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:304: extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07pthread_attr_setguardsize.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in pthread_attr_getguardsize(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_attr_getguardsize sysdeps/htl/pthread.h:180: extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, size_t *__restrict __guardsize) __THROW __nonnull ((1, 2)); sysdeps/nptl/pthread.h:283: extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, size_t *__guardsize) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07printf.3: SYNOPSIS: Use 'restrict' in prototypes; ffix tooAlejandro Colomar1-11/+18
Both POSIX and glibc use 'restrict' in printf(), fprintf(), dprintf(), sprintf(), snprintf(), vprintf(), vfprintf(), vdprintf(), vsprintf(), vsnprintf(). Let's use it here too. .../glibc$ grep_glibc_prototype printf libio/stdio.h:332: extern int printf (const char *__restrict __format, ...); .../glibc$ grep_glibc_prototype fprintf libio/stdio.h:326: extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); .../glibc$ grep_glibc_prototype dprintf libio/stdio.h:382: extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); .../glibc$ grep_glibc_prototype sprintf libio/stdio.h:334: extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) __THROWNL; .../glibc$ grep_glibc_prototype snprintf libio/stdio.h:354: extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 3, 4))); .../glibc$ grep_glibc_prototype vprintf libio/stdio.h:347: extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); .../glibc$ grep_glibc_prototype vfprintf libio/stdio.h:341: extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); .../glibc$ grep_glibc_prototype vdprintf libio/stdio.h:379: extern int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); .../glibc$ grep_glibc_prototype vsprintf libio/stdio.h:349: extern int vsprintf (char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __THROWNL; .../glibc$ grep_glibc_prototype vsnprintf libio/stdio.h:358: extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 3, 0))); .../glibc$ ffix: Align common parameters. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07posix_spawn.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+5
POSIX uses 'restrict' in posix_spawnp(). However, glibc doesn't. Let's document here the more restrictive of them, which is POSIX. I reported a bug to glibc about this. $ man 3p posix_spawnp |sed -n '/^SYNOPSIS/,/;/p' SYNOPSIS #include <spawn.h> int posix_spawnp(pid_t *restrict pid, const char *restrict file, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *restrict attrp, char *const argv[restrict], char *const envp[restrict]); $ .../glibc$ grep_glibc_prototype posix_spawnp posix/spawn.h:85: extern int posix_spawnp (pid_t *__pid, const char *__file, const posix_spawn_file_actions_t *__file_actions, const posix_spawnattr_t *__attrp, char *const __argv[], char *const __envp[]) __nonnull ((2, 5)); .../glibc$ I conciously did an exception with respect to the right margin of the rendered page. Instead of having the right margin at 78 as usual (per Branden's recommendation), I let it use col 79 this time, to avoid breaking the prototype in an ugly way, or shifting all of the parameters to the left, unaligned with respect to the function parentheses. Bug: glibc <https://sourceware.org/bugzilla/show_bug.cgi?id=27529> Cc: G. Branden Robinson <g.branden.robinson@gmail.com> Cc: glibc <libc-alpha@sourceware.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07posix_spawn.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+5
Both POSIX and glibc use 'restrict' in posix_spawn(). Let's use it here too. .../glibc$ grep_glibc_prototype posix_spawn posix/spawn.h:72: extern int posix_spawn (pid_t *__restrict __pid, const char *__restrict __path, const posix_spawn_file_actions_t *__restrict __file_actions, const posix_spawnattr_t *__restrict __attrp, char *const __argv[__restrict_arr], char *const __envp[__restrict_arr]) __nonnull ((2, 5)); .../glibc$ I conciously did an exception with respect to the right margin of the rendered page. Instead of having the right margin at 78 as usual (per Branden's recommendation), I let it use col 79 this time, to avoid breaking the prototype in an ugly way, or shifting all of the parameters to the left, unaligned with respect to the function parentheses. Cc: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mq_receive.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+3
Both POSIX and glibc use 'restrict' in mq_timedreceive(). Let's use it here too. .../glibc$ grep_glibc_prototype mq_timedreceive rt/mqueue.h:76: extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, size_t __msg_len, unsigned int *__restrict __msg_prio, const struct timespec *__restrict __abs_timeout) __nonnull ((2, 5)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mq_getattr.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in mq_setattr(). Let's use it here too. .../glibc$ grep_glibc_prototype mq_setattr rt/mqueue.h:51: extern int mq_setattr (mqd_t __mqdes, const struct mq_attr *__restrict __mqstat, struct mq_attr *__restrict __omqstat) __THROW __nonnull ((2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mempcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+5
glibc uses 'restrict' in mempcpy(), wmempcpy(). Let's use it here too. .../glibc$ grep_glibc_prototype mempcpy string/string.h:384: extern void *mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype wmempcpy wcsmbs/wchar.h:276: extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbtowc.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in mbtowc(). Let's use it here too. .../glibc$ grep_glibc_prototype mbtowc stdlib/stdlib.h:925: extern int mbtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbstowcs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in mbstowcs(). Let's use it here too. .../glibc$ grep_glibc_prototype mbstowcs stdlib/stdlib.h:933: extern size_t mbstowcs (wchar_t *__restrict __pwcs, const char *__restrict __s, size_t __n) __THROW __attr_access ((__read_only__, 2)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbsrtowcs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in mbsrtowcs(). Let's use it here too. .../glibc$ grep_glibc_prototype mbsrtowcs wcsmbs/wchar.h:337: extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbsnrtowcs.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in mbsnrtowcs(). Let's use it here too. .../glibc$ grep_glibc_prototype mbsnrtowcs wcsmbs/wchar.h:351: extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbrtowc.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Both POSIX and glibc use 'restrict' in mbrtowc(). Let's use it here too. .../glibc$ grep_glibc_prototype mbrtowc wcsmbs/wchar.h:296: extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07mbrlen.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in mbrlen(). Let's use it here too. .../glibc$ grep_glibc_prototype mbrlen wcsmbs/wchar.h:307: extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07malloc_hook.3: SYNOPSIS: Use 'volatile' in prototypesAlejandro Colomar1-5/+5
glibc uses 'volatile' in __malloc_hook, __realloc_hook, __memalign_hook, __free_hook, and __after_morecore_hook. Let's use it here too. .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\b__malloc_hook\b.*?;'; malloc/malloc.h:168: extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook)(size_t __size, const void *) __MALLOC_DEPRECATED; .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\b__realloc_hook\b.*?;'; malloc/malloc.h:171: extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook)(void *__ptr, size_t __size, const void *) __MALLOC_DEPRECATED; .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\b__memalign_hook\b.*?;'; malloc/malloc.h:175: extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, size_t __size, const void *) __MALLOC_DEPRECATED; .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\b__free_hook\b.*?;'; malloc/malloc.h:165: extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr, const void *) __MALLOC_DEPRECATED; .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\*\w*\s*\b__malloc_initialize_hook\b.*?;'; malloc/malloc-hooks.h:22: void (*__malloc_initialize_hook) (void); .../glibc$ find * -type f \ |grep '\.h$' \ |xargs pcregrep -Mn '(?s)\*\w*\s*\b__after_morecore_hook\b.*?;'; malloc/malloc.h:179: extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) __MALLOC_DEPRECATED; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07makecontext.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+4
Both POSIX.1-2001 and glibc use 'restrict' in swapcontext(). Let's use it here too. .../glibc$ grep_glibc_prototype swapcontext stdlib/ucontext.h:41: extern int swapcontext (ucontext_t *__restrict __oucp, const ucontext_t *__restrict __ucp) __THROWNL __INDIRECT_RETURN; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07lio_listio.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in lio_listio(). However, POSIX is a bit more restrictive than glibc for the second parameter. Let's document the more restrictive POSIX variant. $ man 3p lio_listio |sed -n '/^SYNOPSIS/,/;/p' SYNOPSIS #include <aio.h> int lio_listio(int mode, struct aiocb *restrict const list[restrict], int nent, struct sigevent *restrict sig); $ .../glibc$ grep_glibc_prototype lio_listio rt/aio.h:148: extern int lio_listio (int __mode, struct aiocb *const __list[__restrict_arr], int __nent, struct sigevent *__restrict __sig) __THROW __nonnull ((2)); .../glibc$ Cc: Szabolcs Nagy <Szabolcs.Nagy@arm.com> Cc: "Joseph S. Myers" <joseph@codesourcery.com> Cc: Ulrich Drepper <drepper@redhat.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: glibc <libc-alpha@sourceware.org> Bug: glibc <https://sourceware.org/bugzilla/show_bug.cgi?id=16747> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07inet_pton.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' in inet_pton(). Let's use it here too. .../glibc$ grep_glibc_prototype inet_pton inet/arpa/inet.h:58: extern int inet_pton (int __af, const char *__restrict __cp, void *__restrict __buf) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07inet_ntop.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in inet_ntop(). Let's use it here too. .../glibc$ grep_glibc_prototype inet_ntop inet/arpa/inet.h:64: extern const char *inet_ntop (int __af, const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07iconv.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in iconv(). Let's use it here too. .../glibc$ grep_glibc_prototype iconv iconv/iconv.h:42: extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07glob.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
Both POSIX and glibc use 'restrict' in glob(). Let's use it here too. .../glibc$ grep_glibc_prototype glob posix/glob.h:146: extern int glob (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), glob_t *__restrict __pglob) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07getsubopt.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
POSIX does NOT specify getsubopt() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! .../glibc$ grep_glibc_prototype getsubopt stdlib/stdlib.h:958: extern int getsubopt (char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __THROW __nonnull ((1, 2, 3)) __wur; .../glibc$ Cc: glibc <libc-alpha@sourceware.org> Cc: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-07getservent_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+13
glibc uses 'restrict' in getservent_r(), getservbyname_r(), getservbyport_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getservent_r resolv/netdb.h:306: extern int getservent_r (struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); .../glibc$ grep_glibc_prototype getservbyname_r resolv/netdb.h:310: extern int getservbyname_r (const char *__restrict __name, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); .../glibc$ grep_glibc_prototype getservbyport_r resolv/netdb.h:316: extern int getservbyport_r (int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getpwnam.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+7
POSIX does NOT specify these functions to use 'restrict'. However, glibc uses 'restrict' in getpwnam_r(), getpwuid_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getpwnam_r pwd/pwd.h:151: extern int getpwnam_r (const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); .../glibc$ grep_glibc_prototype getpwuid_r pwd/pwd.h:145: extern int getpwuid_r (__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((2, 3, 5)); .../glibc$ Cc: glibc <libc-alpha@sourceware.org> Cc: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+7
glibc uses 'restrict' in getpwent_r(), fgetpwent_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getpwent_r pwd/pwd.h:139: extern int getpwent_r (struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 4)); .../glibc$ grep_glibc_prototype fgetpwent_r pwd/pwd.h:166: extern int fgetpwent_r (FILE *__restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getprotoent_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-7/+10
glibc uses 'restrict' in getprotoent_r(), getprotobyname_r(), getprotobynumber_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getprotoent_r resolv/netdb.h:372: extern int getprotoent_r (struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); .../glibc$ grep_glibc_prototype getprotobyname_r resolv/netdb.h:376: extern int getprotobyname_r (const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); .../glibc$ grep_glibc_prototype getprotobynumber_r resolv/netdb.h:381: extern int getprotobynumber_r (int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getnetent_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-10/+13
glibc uses 'restrict' in getnetent_r(), getnetbyname_r(), getnetbyaddr_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getnetent_r resolv/netdb.h:235: extern int getnetent_r (struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); .../glibc$ grep_glibc_prototype getnetbyname_r resolv/netdb.h:246: extern int getnetbyname_r (const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); .../glibc$ grep_glibc_prototype getnetbyaddr_r resolv/netdb.h:240: extern int getnetbyaddr_r (uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getnameinfo.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+5
Both POSIX and glibc use 'restrict' in getnameinfo(). Let's use it here too. I consciously did an exception with respect to the right margin of the rendered page. Instead of having the right margin at 78 as usual (per Branden's recommendation), I let it use col 79 this time, to avoid breaking the prototype in an ugly way. .../glibc$ grep_glibc_prototype getnameinfo resolv/netdb.h:675: extern int getnameinfo (const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, int __flags); .../glibc$ Cc: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getmntent.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+5
glibc uses 'restrict' in addmntent(), getmntent_r(). Let's use it here too. .../glibc$ grep_glibc_prototype addmntent misc/mntent.h:81: extern int addmntent (FILE *__restrict __stream, const struct mntent *__restrict __mnt) __THROW; .../glibc$ grep_glibc_prototype getmntent_r misc/mntent.h:73: extern struct mntent *getmntent_r (FILE *__restrict __stream, struct mntent *__restrict __result, char *__restrict __buffer, int __bufsize) __THROW; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getline.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+4
Both POSIX and glibc use 'restrict' in getline(), getdelim(). Let's use it here too. .../glibc$ grep_glibc_prototype getline libio/stdio.h:621: extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __wur; .../glibc$ grep_glibc_prototype getdelim libio/stdio.h:611: extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03gethostbyname.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-11/+20
glibc uses 'restrict' in gethostent_r(), gethostbyaddr_r(), gethostbyname_r(), gethostbyname2_r(). Let's use it here too. .../glibc$ grep_glibc_prototype gethostent_r resolv/netdb.h:165: extern int gethostent_r (struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); .../glibc$ grep_glibc_prototype gethostbyaddr_r resolv/netdb.h:170: extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); .../glibc$ grep_glibc_prototype gethostbyname_r resolv/netdb.h:177: extern int gethostbyname_r (const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); .../glibc$ grep_glibc_prototype gethostbyname2_r resolv/netdb.h:183: extern int gethostbyname2_r (const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>