aboutsummaryrefslogtreecommitdiffstats
path: root/man3
AgeCommit message (Collapse)AuthorFilesLines
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>
2021-03-03getgrnam.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+7
POSIX does NOT specify these functions to use 'restrict'. However, glibc uses 'restrict' in getgrnam_r(), getgrgid_r(). Users might be surprised by this! Let's use it here too! .../glibc$ grep_glibc_prototype getgrnam_r grp/grp.h:148: extern int getgrnam_r (const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../glibc$ grep_glibc_prototype getgrgid_r grp/grp.h:140: extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../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-03getgrent_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+6
glibc uses 'restrict' in getgrent_r(), fgetgrent_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getgrent_r grp/grp.h:131: extern int getgrent_r (struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../glibc$ grep_glibc_prototype fgetgrent_r grp/grp.h:161: extern int fgetgrent_r (FILE *__restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getdirentries.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+2
glibc uses 'restrict' in getdirentries(). Let's use it here too. .../glibc$ grep_glibc_prototype getdirentries dirent/dirent.h:353: extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off_t *__restrict __basep) __THROW __nonnull ((2, 4)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getdate.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
glibc uses 'restrict' in getdate_r(). Let's use it here too. .../glibc$ grep_glibc_prototype getdate_r time/time.h:297: extern int getdate_r (const char *__restrict __string, struct tm *__restrict __resbufp); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getaddrinfo_a.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-6/+6
glibc uses 'restrict' in getaddrinfo_a(). Let's use it here too. .../glibc$ grep_glibc_prototype getaddrinfo_a resolv/netdb.h:690: extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], int __ent, struct sigevent *__restrict __sig); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getaddrinfo.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-5/+6
Both POSIX and glibc use 'restrict' in getaddrinfo(). Let's use it here too. .../glibc$ grep_glibc_prototype getaddrinfo; resolv/netdb.h:660: extern int getaddrinfo (const char *__restrict __name, const char *__restrict __service, const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fseek.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in fgetpos(). Let's use it here too. glibc: ============================= fgetpos libio/stdio.h:736: int fgetpos (FILE *restrict stream, fpos_t *restrict pos); Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fread.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-4/+5
Both POSIX and glibc use 'restrict' in these functions. Let's use it here too. glibc: ============================= fread libio/stdio.h:651: size_t fread (void *restrict ptr, size_t size, size_t n, FILE *restrict stream) wur; ============================= fwrite libio/stdio.h:657: size_t fwrite (const void *restrict ptr, size_t size, size_t n, FILE *restrict s); Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fputws.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in fputws(). Let's use it here too. glibc: ============================= fputws wcsmbs/wchar.h:765: int fputws (const wchar_t *restrict ws, FILE *restrict stream); Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fopen.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+5
Both POSIX and glibc use 'restrict' for some of these functions. Let's use it here too. glibc: ============================= fopen libio/stdio.h:246: FILE *fopen (const char *restrict filename, const char *restrict modes) wur; ============================= fdopen libio/stdio.h:279: FILE *fdopen (int fd, const char *modes) THROW wur; ============================= freopen libio/stdio.h:252: FILE *freopen (const char *restrict filename, const char *restrict modes, FILE *restrict stream) wur; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fopencookie.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
glibc uses 'restrict' for fopencookie(). Let's use it here too. glibc: libio/stdio.h:285: FILE *fopencookie (void *restrict magic_cookie, const char *restrict modes, cookie_io_functions_t io_funcs) THROW wur; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fgetws.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Both POSIX and glibc use 'restrict' for fgetws(). Let's use it here too. glibc: wcsmbs/wchar.h:758: wchar_t *fgetws (wchar_t *restrict ws, int n, FILE *restrict stream); Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03fgetc.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Both POSIX and glibc use 'restrict' in fgets(). Let's use it here too. glibc: libio/stdio.h:568: char *fgets (char *restrict s, int n, FILE *restrict stream) wur attr_access ((write_only__, 1, 2)); Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03envz_add.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-12/+13
Glibc uses 'restrict' for these functions Let's use it here too. ============================= envz_add string/envz.h:49: error_t envz_add (char **restrict envz, size_t *restrict envz_len, const char *restrict name, const char *restrict value) THROW; ============================= envz_entry string/envz.h:33: char *envz_entry (const char *restrict envz, size_t envz_len, const char *restrict name) THROW attribute_pure__; ============================= envz_get string/envz.h:39: char *envz_get (const char *restrict envz, size_t envz_len, const char *restrict name) THROW attribute_pure__; ============================= envz_merge string/envz.h:57: error_t envz_merge (char **restrict envz, size_t *restrict envz_len, const char *restrict envz2, size_t envz2_len, int override) THROW; ============================= envz_remove string/envz.h:63: void envz_remove (char **restrict envz, size_t *restrict envz_len, const char *restrict name) THROW; ============================= envz_strip string/envz.h:68: void envz_strip (char **restrict envz, size_t *restrict envz_len) THROW; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03ecvt.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+4
POSIX.1-2001 and glibc use 'restrict' for these functions. Let's use it here too. glibc: ============================= ecvt stdlib/stdlib.h:872: char *ecvt (double value, int ndigit, int *restrict decpt, int *restrict sign) THROW nonnull ((3, 4)) wur; ============================= fcvt stdlib/stdlib.h:878: char *fcvt (double value, int ndigit, int *restrict decpt, int *restrict sign) THROW nonnull ((3, 4)) wur; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03ecvt_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+10
Glibc uses 'restrict' for these functions ============================= ecvt_r stdlib/stdlib.h:902: int ecvt_r (double value, int ndigit, int *restrict decpt, int *restrict sign, char *restrict buf, size_t len) THROW nonnull ((3, 4, 5)); ============================= fcvt_r stdlib/stdlib.h:905: int fcvt_r (double value, int ndigit, int *restrict decpt, int *restrict sign, char *restrict buf, size_t len) THROW nonnull ((3, 4, 5)); ============================= qecvt_r stdlib/stdlib.h:909: int qecvt_r (long double value, int ndigit, int *restrict decpt, int *restrict sign, char *restrict buf, size_t len) THROW nonnull ((3, 4, 5)); ============================= qfcvt_r stdlib/stdlib.h:913: int qfcvt_r (long double value, int ndigit, int *restrict decpt, int *restrict sign, char *restrict buf, size_t len) THROW nonnull ((3, 4, 5)); 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-03drand48_r.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-8/+14
Glibc uses 'restrict' for some of the functions in this page: ============================= drand48_r stdlib/stdlib.h:501: int drand48_r (struct drand48_data *restrict buffer, double *restrict result) THROW nonnull ((1, 2)); ============================= erand48_r stdlib/stdlib.h:503: int erand48_r (unsigned short int xsubi[3], struct drand48_data *restrict buffer, double *restrict result) THROW nonnull ((1, 2)); ============================= lrand48_r stdlib/stdlib.h:508: int lrand48_r (struct drand48_data *restrict buffer, long int *restrict result) THROW nonnull ((1, 2)); ============================= nrand48_r stdlib/stdlib.h:511: int nrand48_r (unsigned short int xsubi[3], struct drand48_data *restrict buffer, long int *restrict result) THROW nonnull ((1, 2)); ============================= mrand48_r stdlib/stdlib.h:517: int mrand48_r (struct drand48_data *restrict buffer, long int *restrict result) THROW nonnull ((1, 2)); ============================= jrand48_r stdlib/stdlib.h:520: int jrand48_r (unsigned short int xsubi[3], struct drand48_data *restrict buffer, long int *restrict result) THROW nonnull ((1, 2)); ============================= srand48_r stdlib/stdlib.h:526: int srand48_r (long int seedval, struct drand48_data *buffer) THROW nonnull ((2)); ============================= seed48_r stdlib/stdlib.h:529: int seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer) THROW nonnull ((1, 2)); ============================= lcong48_r stdlib/stdlib.h:532: int lcong48_r (unsigned short int param[7], struct drand48_data *buffer) THROW nonnull ((1, 2)); 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-03dlsym.3: SYNOPSIS: Use 'restrict' in prototypes; add missing 'const' tooAlejandro Colomar1-2/+3
POSIX specifies that the parameters of dlsym() shall be 'restrict'. Glibc uses 'restrict' too. Let's use it here too. The glibc specific dlvsym() also uses 'restrict'. Its 2nd and 3rd parameters are 'const' too. Fix the prototypes to add these qualifiers. ...... .../glibc$ grep_glibc_prototype dlsym dlfcn/dlfcn.h:64: extern void *dlsym (void *__restrict __handle, const char *__restrict __name) __THROW __nonnull ((2)); .../glibc$ grep_glibc_prototype dlvsym dlfcn/dlfcn.h:73: extern void *dlvsym (void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) __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-03dlinfo.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
Glibc uses 'restrict' for dlinfo(). Let's use it here too. ...... .../glibc$ grep_glibc_prototype dlinfo dlfcn/dlfcn.h:123: extern int dlinfo (void *__restrict __handle, int __request, void *__restrict __arg) __THROW __nonnull ((1, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03ctime.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+7
POSIX does NOT specify ctime_r() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! ...... .../glibc$ grep_glibc_prototype ctime_r timezone/private.h:504: char *ctime_r(time_t const *, char *); timezone/private.h:712: char *ctime_r(time_t const *, char *); time/time.h:153: extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __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-03ctime.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-3/+5
POSIX specifies that the parameters of asctime_r(), gmtime_r(), and localtime_r() shall be restrict. Glibc uses 'restrict' too. Let's use it here too. ctime_r will be covered in a future commit, as the glibc implementation differs from POSIX. ...... ============================= asctime timezone/private.h:501: char *asctime(struct tm const *); time/time.h:139: char *asctime (const struct tm *tp) THROW; ============================= asctime_r timezone/private.h:502: char *asctime_r(struct tm const *restrict, char *restrict); timezone/private.h:522: char *asctime_r(struct tm const *restrict, char *restrict); timezone/private.h:711: char *asctime_r(struct tm const *, char *); time/time.h:149: char *asctime_r (const struct tm *restrict tp, char *restrict buf) THROW; ============================= ctime timezone/private.h:503: char *ctime(time_t const *); time/time.h:142: char *ctime (const time_t *timer) THROW; ============================= ctime_r timezone/private.h:504: char *ctime_r(time_t const *, char *); timezone/private.h:712: char *ctime_r(time_t const *, char *); time/time.h:153: char *ctime_r (const time_t *restrict timer, char *restrict buf) THROW; ============================= gmtime timezone/private.h:512: struct tm *gmtime(time_t const *); time/time.h:119: struct tm *gmtime (const time_t *timer) THROW; ============================= gmtime_r timezone/private.h:513: struct tm *gmtime_r(time_t const *restrict, struct tm *restrict); time/time.h:128: struct tm *gmtime_r (const time_t *restrict timer, struct tm *restrict tp) THROW; ============================= localtime timezone/private.h:514: struct tm *localtime(time_t const *); time/time.h:123: struct tm *localtime (const time_t *timer) THROW; ============================= localtime_r timezone/private.h:515: struct tm *localtime_r(time_t const *restrict, struct tm *restrict); time/time.h:133: struct tm *localtime_r (const time_t *restrict timer, struct tm *restrict tp) THROW; ============================= mktime timezone/private.h:516: time_t mktime(struct tm *); time/time.h:82: time_t mktime (struct tm *tp) THROW; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03crypt.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+1
Glibc uses 'restrict' for the 3rd parameter of crypt_r(). Let's use it here too. ...... .../glibc$ grep_glibc_prototype crypt_t crypt/crypt.h:63: extern char *crypt_r (const char *__phrase, const char *__salt, struct crypt_data * __restrict __data) __THROW __nonnull ((1, 2, 3)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03memcpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
POSIX specifies that the parameters of memcpy() shall be 'restrict'. Glibc uses 'restrict' too. Let's use it here too. It's especially important in memcpy(), as it's been a historical source of bugs. ...... .../glibc$ grep_glibc_prototype memcpy posix/regex_internal.h:746: { memcpy (dest, src, sizeof (bitset_t)); string/string.h:43: extern void *memcpy (void *__restrict __dest, const void *__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-03memccpy.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-1/+2
POSIX specifies that the parameters of memccpy() shall be 'restrict'. Glibc uses 'restrict' too. Let's use it here too. ...... .../glibc$ grep_glibc_prototype memccpy string/string.h:54: extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03asprintf.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+3
Glibc uses 'restrict' for [v]asprintf(). Let's use it here too. ...... .../glibc$ grep_glibc_prototype asprintf libio/stdio.h:372: extern int asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur; .../glibc$ grep_glibc_prototype vasprintf libio/stdio.h:366: extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, __gnuc_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03argz_add.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-18/+23
Glibc uses 'restrict' for some of the functions in this page: ============================= argz_add string/argz.h:76: error_t argz_add (char **restrict argz, size_t *restrict argz_len, const char *restrict str) THROW; ============================= argz_add_sep string/argz.h:82: error_t argz_add_sep (char **restrict argz, size_t *restrict argz_len, const char *restrict string, int delim) THROW; ============================= argz_append string/argz.h:70: error_t argz_append (char **restrict argz, size_t *restrict argz_len, const char *restrict buf, size_t buf_len) THROW; ============================= argz_count string/argz.h:54: size_t argz_count (const char *argz, size_t len) THROW attribute_pure__; ============================= argz_create string/argz.h:40: error_t argz_create (char *const argv[], char **restrict argz, size_t *restrict len) THROW; ============================= argz_create_sep string/argz.h:47: error_t argz_create_sep (const char *restrict string, int sep, char **restrict argz, size_t *restrict len) THROW; ============================= argz_delete string/argz.h:88: void argz_delete (char **restrict argz, size_t *restrict argz_len, char *restrict entry) THROW; ============================= argz_extract string/argz.h:61: void argz_extract (const char *restrict argz, size_t len, char **restrict argv) THROW; ============================= argz_insert string/argz.h:98: error_t argz_insert (char **restrict argz, size_t *restrict argz_len, char *restrict before, const char *restrict entry) THROW; ============================= argz_next string/argz.h:128: char *argz_next (const char *restrict argz, size_t argz_len, const char *restrict entry) THROW; ============================= argz_replace string/argz.h:106: error_t argz_replace (char **restrict argz, size_t *restrict argz_len, const char *restrict str, const char *restrict with, unsigned int *restrict replace_count); ============================= argz_stringify string/argz.h:67: void argz_stringify (char *argz, size_t len, int sep) THROW; 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-03pthread_create.3: Fix a signedness error in the example codeMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03pthread_create.3: Fix undeclared variable error in example programMichael Kerrisk1-1/+1
Reported-by: Paran Lee <p4ranlee@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03ftw.3: SYNOPSIS: Remove duplicate headerAlejandro Colomar1-2/+0
Both functions have the same header. There's no reason to separate the prototypes repeating the header. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03getopt.3: ffixAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20aio_suspend.3: SYNOPSIS: Use 'restrict' in prototypesAlejandro Colomar1-2/+6
POSIX does NOT specify aio_suspend() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! ...... .../glibc$ grep_glibc_prototype aio_suspend rt/aio.h:167: extern int aio_suspend (const struct aiocb *const __list[], int __nent, const struct timespec *__restrict __timeout) __nonnull ((1)); .../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-02-19setjmp.3: SYNOPSIS: Use 'noreturn' in prototypesAlejandro Colomar1-2/+2
POSIX specifies that [sig]longjmp() shall not return, transferring control back to the caller of [sig]setjmp(). Glibc uses __attribute__((__noreturn__)) for [sig]longjmp(). Let's use standard C11 'noreturn' in the manual page. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19pthread_exit.3: SYNOPSIS: Use 'noreturn' in prototypesAlejandro Colomar1-1/+1
POSIX specifies that pthread_exit() shall not return. Glibc uses __attribute__((__noreturn__)). Let's use standard C11 'noreturn' in the manual page. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19exit.3: SYNOPSIS: Use 'noreturn' in prototypesAlejandro Colomar1-1/+1
POSIX specifies that exit() shall not return. Glibc uses __attribute__((__noreturn__)). Let's use standard C11 'noreturn' in the manual page. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19err.3: SYNOPSIS: Use 'noreturn' in prototypesAlejandro Colomar1-4/+4
Glibc uses __attribute__((__noreturn__)) for [v]err[x](). These functions never return. Let's use standard C11 'noreturn' in the manual page. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19abort.3: SYNOPSIS: Use 'noreturn' in prototypesAlejandro Colomar1-1/+1
POSIX specifies that abort() shall not return. Glibc uses __attribute__((__noreturn__)). Let's use standard C11 'noreturn' in the manual page. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19error.3: Clarify the meaning of 'status==0' for error(3)Michael Kerrisk1-1/+2
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Reported-by: Walter Harms <wharms@bfs.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-18strerror.3: VERSIONS: Document that strerrorname_np() and strerrordesc_np() ↵Alejandro Colomar1-0/+6
functions first appeared on glibc 2.32 Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15simpleq.3, stailq.3, queue.7, SIMPLEQ_*.3: Document SIMPLEQ_*() as an alias ↵Alejandro Colomar15-0/+45
to STAILQ_*() macros Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09rpc.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07getpriority.2, recv.2, fts.3: wfixMichael Kerrisk1-3/+1
These pages have the odd wording 'the external variable errno', which does not occur in other pages. Make these pages conform with the norm. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07ferror.3: POSIX.1-2008: these functions won't change 'errno' if 'stream' is ↵Michael Kerrisk1-1/+10
valid See https://www.austingroupbugs.net/view.php?id=401. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07ferror.3: Add a RETURN VALUE sectionMichael Kerrisk1-0/+12
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07ferror.3: Remove fileno(3) content that was migrated to new fileno(3) pageMichael Kerrisk1-40/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07fileno.3: Split fileno(3) content out of ferror(3) into new pageMichael Kerrisk1-1/+117
fileno(3) differs from the other functions in various ways. For example, it is governed by different standards, and can set 'errno'. Conversely, the other functions are about examining the status of a stream, while fileno(3) simply obtains the underlying file descriptor. Furthermore, splitting this function out allows for some cleaner upcoming changes in ferror(3). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06setbuf.3: POSIX doesn't require to errno to be unchanged after successful ↵Michael Kerrisk1-0/+15
setbuf() See https://www.austingroupbugs.net/view.php?id=397#c799 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06setbuf.3: tfixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-01malloc_trim.3: Remove mention of free() callDmitry Vorobev1-9/+0
'malloc_trim' was and is never called from the 'free' function. see related bug in glibc tracker: https://sourceware.org/bugzilla/show_bug.cgi?id=2531. or '__int_free' function. Only the top part of the heap is trimmed after some calls to 'free', which is different from 'malloc_trim' which also releases memory in between chunks from all the arenas/heaps. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-29tmpfile.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-28rcmd.3: tfix (logical quoting style)Michael Kerrisk1-1/+1
Reported-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-24semget.2, shm_open.3: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-24random.3: srcfix: Don't break proper names into different linesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-24fopencookie.3: wsfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21Various pages: use "\-" to generate real minus in circumstances where ↵Michael Kerrisk14-34/+34
appropriate Use \- for math formulas, pathnames, manual page cross references, etc. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21Various pages: use real minus signs in pathnamesMichael Kerrisk3-3/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21confstr.3: ffix: Use real minus sign inside a stringMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21Various pages: Inside code blocks (.EX/.EE) use \- to get real minus signsMichael Kerrisk29-51/+51
A real minus can be cut and pasted... THere are a few exceptions that gave been excluded in the this change. For example, where there' is a string such as "<p1-name>", where p1-name is soome sort of pseudo-identifier. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-20fread.3: Swap size and nmemb paramsAlessandro Bono1-2/+2
It works both way, but this one feels more right. We are reading four elements sizeof(*buffer) bytes each. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-20circleq.3: Fix CIRCLEQ_LOOP_*() return typeAlejandro Colomar1-4/+14
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-18system.3: ffixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-18system.3: Document bug and workaround when the command name starts with a hypenAlejandro Colomar1-0/+20
man-pages bug: 211029 https://bugzilla.kernel.org/show_bug.cgi?id=211029 Complete workaround example (it was too long for the page, but it may be useful here): ...... $ sudo ln -s -T /usr/bin/echo /usr/bin/-echo; $ cc -o system_hyphen -x c - ; #include <stdlib.h> int main(void) { system(" -echo Hello world!"); exit(EXIT_SUCCESS); } $ ./system_hyphen; Hello world! Reported-by: Ciprian Dorin Craciun <ciprian.craciun@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-17ulimit.3: tfixAlyssa Ross1-1/+1
The parentheses here make it look like a function rather than a command. This was a typo introduced by a script-assisted global edit. 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-01-15crypt.3: Update crypt() FTM requirements to note glibc 2.28 changesMichael Kerrisk1-1/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-15crypt.3: Reformat FTM info (in preparation for next patch)Michael Kerrisk1-2/+16
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-10malloc.3: Document that realloc(p, 0) is specific to glibc and nonportableAlejandro Colomar1-1/+17
A more detailed notice is on realloc(3p). ...... $ man 3p realloc \ |sed -n \ -e '/APPLICATION USAGE/,/^$/p' \ -e '/FUTURE DIRECTIONS/,/^$/p'; APPLICATION USAGE The description of realloc() has been modified from pre‐ vious versions of this standard to align with the ISO/IEC 9899:1999 standard. Previous versions explicitly permitted a call to realloc(p, 0) to free the space pointed to by p and return a null pointer. While this be‐ havior could be interpreted as permitted by this version of the standard, the C language committee have indicated that this interpretation is incorrect. Applications should assume that if realloc() returns a null pointer, the space pointed to by p has not been freed. Since this could lead to double-frees, implementations should also set errno if a null pointer actually indicates a failure, and applications should only free the space if errno was changed. FUTURE DIRECTIONS This standard defers to the ISO C standard. While that standard currently has language that might permit real‐ loc(p, 0), where p is not a null pointer, to free p while still returning a null pointer, the committee responsible for that standard is considering clarifying the language to explicitly prohibit that alternative. Bug: 211039 <https://bugzilla.kernel.org/show_bug.cgi?id=211039> Reported-by: Johannes Pfister <johannes.pfister@josttech.ch> Cc: libc-alpha@sourceware.org Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-10Various pages: srcfix: Remove redundant .PPAlejandro Colomar2-2/+2
.PP are redundant just after .SH or .SS. Remove them. $ find man? -type f \ |xargs sed -i '/^\.S[HS]/{n;/\.PP/d}'; Plus a couple manual edits. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-10Revert "stailq.3, utmp.5, time_namespaces.7: srcfix: remove redundant .PP"Michael Kerrisk1-0/+1
Do this in order to apply a better patch from Alex Colomar. This reverts commit f7fc28f97a1012631f835adcbfdcd3a048fa31b2.
2021-01-10xcrypt.3: srcfix: use .PP rather than .LPMichael Kerrisk1-1/+1
.LP is equivalent .PP, but the latter is what is used throughout man-pages. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-10shm_open.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-10stailq.3, utmp.5, time_namespaces.7: srcfix: remove redundant .PPMichael Kerrisk1-1/+0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09getfsent.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09mprotect.2, readv.2, sigaltstack.2, sigreturn.2, ctime.3, scandir.3, ↵Michael Kerrisk2-2/+2
random.4, pkeys.7: ffix: s/-1/\-1/ Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09time.1, ioctl_console.2, daemon.3, updwtmp.3, mouse.4, smartpqi.4: tfix ↵Michael Kerrisk2-2/+2
(Oxford comma) Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09Various pages: tfix (Oxford comma)Michael Kerrisk2-2/+2
Found using: git grep -lE '^[^.].*,.*,.*[^,] (and|or)\>' Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09tailq.3: srcfix: remove redundant .PPMichael Kerrisk1-2/+0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09Various pages: tfix (Oxford comma)Michael Kerrisk16-17/+17
Discovered using: git grep -lE '^[^.].*, [^ ]*[^,] (or|and)\>' Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09round.3: wsfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09circleq.3, list.3, slist.3, stailq.3, queue.7: tfix (Oxford comma)Michael Kerrisk4-4/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09encrypt.3: wfixMichael Kerrisk1-1/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09ioctl_console.2, msgctl.2, msgget.2, msgop.2, semctl.2, semget.2, semop.2, ↵Michael Kerrisk1-10/+5
shm_open.3, shmget.2, shmop.2: ERRORS: remove redundant statement that 'errno' is set This is implied in every other manual page. There is no need to state it explicitly in these pages. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09setlocale.3: Restructure a particularly difficult sentenceMichael Kerrisk1-11/+17
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-08Various pages: tfix: Use Oxford commaAlejandro Colomar5-6/+6
Found using: $ pcregrep -rnM "^\.[B|I]R .*,\n\.[B|I].*[^,]\nor" man? \ |grep ^man \ |sort; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-08close.2, getpriority.2, ioctl_userfaultfd.2, expm1.3, lio_listio.3, rcmd.3, ↵Alejandro Colomar3-5/+5
lirc.4, mount_namespaces.7: tfix: Fix punctuation Found using: $ pcregrep -rnM '^..[^"].*[^.]\.\n[a-z]' man? Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07rcmd.3: wfix (errno)Michael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07Various pages: Various improvements in wording in RETURN VALUEMichael Kerrisk4-13/+18
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07Various pages: Standardize wording around setting of 'errno' on errorMichael Kerrisk11-34/+33
In the RETURN VALUE sections, a number of different wordings are used in to describe the fact that 'errno' is set on error. There's no reason for the difference in wordings, since the same thing is being described in each case. Switch to a standard wording that is the same as FreeBSD and similar to the wording used in POSIX.1. In this change, miscellaneous descriptions of the setting of 'errno' are reworded to the norm of "is set to indicate the error". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07Various pages: Standardize wording around setting of 'errno' on errorMichael Kerrisk2-3/+4
In the RETURN VALUE sections, a number of different wordings are used in to describe the fact that 'errno' is set on error. There's no reason for the difference in wordings, since the same thing is being described in each case. Switch to a standard wording that is the same as FreeBSD and similar to the wording used in POSIX.1. In this change, reword various cases saying that 'errno' is set "appropriately" to "is set to indicate the error". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07Various pages: Standardize wording around setting of 'errno' on errorMichael Kerrisk38-42/+43
In the RETURN VALUE sections, a number of different wordings are used in to describe the fact that 'errno' is set on error. There's no reason for the difference in wordings, since the same thing is being described in each case. Switch to a standard wording that is the same as FreeBSD and similar to the wording used in POSIX.1. In this change, fix some instances stating that 'errno' is set "appropriately" to instead say "to indicate the error". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07Various pages: Standardize wording around setting of 'errno' on errorMichael Kerrisk27-29/+29
In the RETURN VALUE sections, a number of different wordings are used in to describe the fact that 'errno' is set on error. There's no reason for the difference in wordings, since the same thing is being described in each case. Switch to a standard wording that is the same as FreeBSD and similar to the wording used in POSIX.1. In this change, "to indicate the cause of the error" is changed to "to indicate the error". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07wordexp.3: Minor wording fixes in RETURN VALUEMichael Kerrisk1-3/+6
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-07clone.2, ioctl_tty.2, syslog.2, setlocale.3, stdio.3, console_codes.4, ↵Michael Kerrisk2-67/+199
inode.7, namespaces.7, netlink.7, signal-safety.7, socket.7: Better table formatting In particular, allow for rendering in widths different from (especially less than) 80 columns. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06slist.3: tfixMichael Kerrisk1-1/+1
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06Various pages: add missing .nf/.fi in FTM infoMichael Kerrisk30-3/+65
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06rcmd.3: srcfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06Various pages: Remove redundant escaping of space characters in FTM infoMichael Kerrisk152-252/+252
Since we are using .nf/.fi to bracket FTM info, escaping space characters serves no space and clutters the source. Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06circleq.3, list.3, slist.3, stailq.3, tailq.3: Improve readability, ↵Alejandro Colomar5-509/+433
especially in SYNOPSIS - Group macros by kinds. - Align so that it's easiest to distinguish differences between related macros. (Align all continuations for consistency on PDF.) - Fix minor typos. - Remove redundant text: 'The macro xxx() ...': The first paragraph already says that these are macros. 'circular|tail|... queue': Don't need to repeat every time. Generic text makes it easier to spot the differences. - Fit lines into 78 columns. - Reorder descriptions to match SYNOPSIS, and add subsections to DESCRIPTION. - srcfix: fix a few semantic newlines. I noticed a bug which should be fixed next: CIRCLEQ_LOOP_*() return a 'struct TYPE *'. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06Various pages: Formatting tweaks after "Improve formatting in ATTRIBUTES"Michael Kerrisk31-75/+161
Various ATTRIBUTES table improvements following the previous commit. In particular, make use of T{...T} to allow wrapping in table cells that have a lot of text. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06Various pages: Improve formatting in ATTRIBUTESMichael Kerrisk516-713/+2923
Make the formatting more consistent inside the tables in the ATTRIBUTES sections. Make the source code more uniform; in particular, eliminate the use of custom tweaks using 'lbwNN'/'lwNN' and .br macros. In addition, ensure that hyphenation and text justification do not occur inside the tables. This is a script-driven edit: [[ PAGE_LIST=$(git grep -l 'SH ATTRIBUTES' man[23]) # Strip out any preexisting .sp/.br/.ad macros sed -i '/SH ATTR/,/^\.SH/{/^\.sp/d; /^\.br/d; /\.ad/d}' $PAGE_LIST # Eliminate any use of 'wNN' in tables; default first column # to fill unused space sed -i '/SH ATTR/,/^\.SH/s/lbw[0-9]*/lb/g' $PAGE_LIST sed -i '/SH ATTR/,/^\.SH/s/lw[0-9]*/l/g' $PAGE_LIST sed -i '/SH ATTR/,/^\.SH/s/^lb /lbx /' $PAGE_LIST # Nest the tables inside ".ad l"+".nh" and ".hy"+".ad"+".sp 1" # ".ad l" ==> no right justification of text in table cells # ".nh" ==> No hyphenation in table cells # ".sp 1" ==> ensure a blank line before the next section heading sed -i '/SH ATTR/,/^\.SH/{/\.TS/i.ad l\n.nh }' $PAGE_LIST sed -i '/SH ATTR/,/^\.SH/{/\.TE/a.hy\n.ad\n.sp 1 }' $PAGE_LIST # In a few of the tables, the third column has a lot of text, so # make that column wide (rather than the first column) sed -i '/^lbx/{s/lbx/lb/;s/lb$/lbx/}' \ man3/bindresvport.3 \ man3/fmtmsg.3 man3/gethostbyname.3 man3/getlogin.3 \ man3/getnetent.3 man3/getprotoent.3 man3/getpwent.3 \ man3/getservent.3 man3/getspnam.3 man3/getutent.3 man3/glob.3 \ man3/login.3 \ man3/setnetgrent.3 \ man3/wordexp.3 ]] Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-06getlogin.3: ffixMichael Kerrisk1-1/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05Various pages: Use internally consistent continuation indents in SYNOPSISMichael Kerrisk12-29/+28
In the SYNOPSIS, a long function prototype may need to be continued over to the next line. The continuation line is indented according to the following rules: 1. If there is a single such prototype that needs to be continued, then align the continuation line so that when the page is rendered on a fixed-width font device (e.g., on an xterm) the continuation line starts just below the start of the argument list in the line above. (Exception: the indentation may be adjusted if necessary to prevent a very long continuation line or a further continuation line where the function prototype is very long.) Thus: int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); 2. But, where multiple functions in the SYNOPSIS require continuation lines, and the function names have different lengths, then align all continuation lines to start in the same column. This provides a nicer rendering in PDF output (because the SYNOPSIS uses a variable width font where spaces render narrower than most characters). Thus: int getopt(int argc, char * const argv[], const char *optstring); int getopt_long(int argc, char * const argv[], const char *optstring, const struct option *longopts, int *longindex); Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05Various pages: ffix: More layout consistency fixes for FTMsMichael Kerrisk18-20/+54
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05fseeko.3: Move info about obsolete FTM from SYNOPSIS to NOTESMichael Kerrisk1-1/+5
This makes the SYNOPSIS more consistent with other pages. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05j0.3, strerror.3, y0.3: wspfixMichael Kerrisk3-3/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05brk.2, chmod.2, gethostname.2, setpgid.2, wait4.2, atoi.3, fwide.3, ↵Michael Kerrisk6-8/+8
getlogin.3, printf.3, strtoul.3, wprintf.3: Consistency fix-up in FTMs Generally, place '||' at start of a line, rather than the end of the previous line. Rationale: this placement clearly indicates that that each piece is an alternative. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05qecvt.3: srcfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05fsync.2, gethostname.2, stat.2, getutent.3: Minor consistency clean-ups in FTMsMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05Various pages: Simplify mark-up for Feature Test Macro requirementsMichael Kerrisk183-1586/+1083
Different source styles are used in different pages to achieve the same formatted output, and in some cases the source mark-up is a rather convoluted combination of .RS/.RE/.TP/.PD macros. Simplify this greatly, and unify all of the pages to use more or less the same source code style. This makes the source code rather easier to read, and may simplify future scripted global changes. The feature test macro info is currently bracketed by .nf/.fi pairs. This is not strictly necessary (i.e., it makes no difference to the rendered output), but for the moment we keep these "brackets" in case they may be replaced with something else. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04gethostid.3: srcfixMichael Kerrisk1-1/+0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04Various pages: replace '.ad b' macro with '.ad'Michael Kerrisk81-81/+81
Verified no change in rendered output Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04clock_getres.2, atan2.3, ctime.3, getcwd.3, isgreater.3, iswblank.3, ↵Michael Kerrisk6-7/+7
scalbln.3: ffix Consistently use 4-space indents for FTMs. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04chroot.2, rename.2, getgrent.3, nextafter.3, ttyslot.3, wprintf.3: ffixMichael Kerrisk4-15/+9
Bring a bit more consistency to the layout of FTMs. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04grantpt.3, ptsname.3, unlockpt.3: Remove mention of _XOPEN_SOURCE_EXTENDED FTMMichael Kerrisk3-6/+6
This rather ancient FTM is not mentioned in other pages for reasons discussed in feature_test_macros(7). Remove this FTM from the three pages where it does appear. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04nice.2, putenv.3, strtok.3, toascii.3, tzset.3: ffixMichael Kerrisk4-13/+19
Where FTM requirements span multiple lines, start the FTMs on a new line. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04getpagesize.2, getdtablesize.3: tfixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04exec.3: tfixMichael Kerrisk1-2/+2
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04malloc_hook.3: tfixMichael Kerrisk1-1/+1
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04ecvt.3, gcvt.3: Update FTM requirementsMichael Kerrisk2-30/+20
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04getpagesize.2, getdtablesize.3: Update/correct FTM requirementsMichael Kerrisk1-15/+7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04gethostid.3: Update FTM requirements for gethostid()Michael Kerrisk1-3/+8
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04wait.2, getaddrinfo.3, getnameinfo.3: ffix: Bring greater consistency to FTM ↵Michael Kerrisk2-4/+8
layout Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04qecvt.3: Update feature test macro requirementsMichael Kerrisk1-1/+6
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04Various pages: Use .nf/.fi in SYNOPSISMichael Kerrisk5-2/+10
Fix various pages missed in commit c7db92b96a3f88dc146a35d6851453e3b354f4fc. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04getutent.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04bsd_signal.3: ffixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04scandir.3: ffixMichael Kerrisk1-6/+6
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03string.3: tfixMichael Kerrisk1-1/+1
Reported-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03string.3: SEE ALSO: add bstring(3)Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03bstring.3: SEE ALSO: add string(3)Michael Kerrisk1-1/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03Various pages: Use .nf/.fi in SYNOPSISMichael Kerrisk91-114/+183
The majority of pages use .nf/.fi in SYNOPSIS, but there are still many that don't and use .br to achieve newlines. Fix many of those. This brings greater consistency to the pages, which eases editing and may ease future scripted edits to the pages. Many of these changes were script-assisted, with some additional manual edits. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03Various pages: Further clean-ups after "bring more whitespace consistency in ↵Michael Kerrisk27-102/+41
SYNOPSIS" Yet more clean-ups after commit 15d6565317dad749ef57e69023139bc405caab88. Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-02wordexp.3: ffixMichael Kerrisk1-0/+2
Reported-by: "Alejandro Colomar" <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-02Various pages: Consistently use 'unsigned int'Alejandro Colomar5-9/+9
Most pages use 'unsigned int' (and the kernel too). Make them all do so. $ find man? -type f \ | xargs sed -i \ -e 's/unsigned \*/unsigned int */g' -e 's/unsigned "/unsigned int "/g'; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01get_phys_pages.3: Minor relocation of textMichael Kerrisk1-4/+3
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01off64_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-01-01Various pages: clean-ups after "bring more whitespace consistency in SYNOPSIS"Michael Kerrisk11-28/+23
Cleann-ups after commit 15d6565317dad749ef57e69023139bc405caab88. Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01Various pages: bring more whitespace consistency in SYNOPSISMichael Kerrisk112-225/+64
The use of vertical white space in the SYNOPSIS sections is rather inconsistent. Make it more consistent, subject to the following heuristics: * Prefer no blank lines between function signatures by default. * Where many functions are defined in the SYNOPSIS, add blank lines where needed to improve readability, possibly by using blank lines to separate logical groups of functions. Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>