]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
4 years agoglob.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Fri, 5 Mar 2021 23:50:47 +0000 (00:50 +0100)] 
glob.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetsubopt.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Fri, 5 Mar 2021 23:50:46 +0000 (00:50 +0100)] 
getsubopt.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetservent_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Fri, 5 Mar 2021 23:50:45 +0000 (00:50 +0100)] 
getservent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetpwnam.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:18 +0000 (01:48 +0100)] 
getpwnam.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:17 +0000 (01:48 +0100)] 
getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetprotoent_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:16 +0000 (01:48 +0100)] 
getprotoent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetnetent_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:15 +0000 (01:48 +0100)] 
getnetent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetnameinfo.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:14 +0000 (01:48 +0100)] 
getnameinfo.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetmntent.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:13 +0000 (01:48 +0100)] 
getmntent.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetline.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:12 +0000 (01:48 +0100)] 
getline.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogethostbyname.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:11 +0000 (01:48 +0100)] 
gethostbyname.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetgrnam.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:10 +0000 (01:48 +0100)] 
getgrnam.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetgrent_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:09 +0000 (01:48 +0100)] 
getgrent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetdirentries.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:08 +0000 (01:48 +0100)] 
getdirentries.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetdate.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:07 +0000 (01:48 +0100)] 
getdate.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetaddrinfo_a.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:06 +0000 (01:48 +0100)] 
getaddrinfo_a.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agogetaddrinfo.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sun, 28 Feb 2021 00:48:05 +0000 (01:48 +0100)] 
getaddrinfo.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofseek.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:11 +0000 (15:43 +0100)] 
fseek.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofread.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:10 +0000 (15:43 +0100)] 
fread.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofputws.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:09 +0000 (15:43 +0100)] 
fputws.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofopen.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:08 +0000 (15:43 +0100)] 
fopen.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofopencookie.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:07 +0000 (15:43 +0100)] 
fopencookie.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofgetws.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:06 +0000 (15:43 +0100)] 
fgetws.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agofgetc.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:05 +0000 (15:43 +0100)] 
fgetc.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoenvz_add.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:04 +0000 (15:43 +0100)] 
envz_add.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoecvt.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:03 +0000 (15:43 +0100)] 
ecvt.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoecvt_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:02 +0000 (15:43 +0100)] 
ecvt_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agodrand48_r.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:43:01 +0000 (15:43 +0100)] 
drand48_r.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agodlsym.3: SYNOPSIS: Use 'restrict' in prototypes; add missing 'const' too
Alejandro Colomar [Wed, 24 Feb 2021 14:43:00 +0000 (15:43 +0100)] 
dlsym.3: SYNOPSIS: Use 'restrict' in prototypes; add missing 'const' too

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>
4 years agodlinfo.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:59 +0000 (15:42 +0100)] 
dlinfo.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoctime.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:58 +0000 (15:42 +0100)] 
ctime.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoctime.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:57 +0000 (15:42 +0100)] 
ctime.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agocrypt.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:56 +0000 (15:42 +0100)] 
crypt.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agomemcpy.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:55 +0000 (15:42 +0100)] 
memcpy.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agomemccpy.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:54 +0000 (15:42 +0100)] 
memccpy.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoasprintf.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:53 +0000 (15:42 +0100)] 
asprintf.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoargz_add.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Wed, 24 Feb 2021 14:42:52 +0000 (15:42 +0100)] 
argz_add.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoinode.7: tfix
Alejandro Colomar [Sat, 27 Feb 2021 11:22:18 +0000 (12:22 +0100)] 
inode.7: tfix

Epoch is 1970-01-01 00:00:00 +0000, UTC (see time(7)).

Reported-by: Walter Franzini <walter.franzini@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopthread_create.3: Fix a signedness error in the example code
Michael Kerrisk [Wed, 3 Mar 2021 21:45:16 +0000 (22:45 +0100)] 
pthread_create.3: Fix a signedness error in the example code

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopthread_create.3: Fix undeclared variable error in example program
Michael Kerrisk [Wed, 3 Mar 2021 21:36:18 +0000 (22:36 +0100)] 
pthread_create.3: Fix undeclared variable error in example program

Reported-by: Paran Lee <p4ranlee@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoftw.3: SYNOPSIS: Remove duplicate header
Alejandro Colomar [Tue, 23 Feb 2021 23:54:40 +0000 (00:54 +0100)] 
ftw.3: SYNOPSIS: Remove duplicate header

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>
4 years agoman2/openat2.2: Add RESOLVE_CACHED
Jens Axboe [Sun, 21 Feb 2021 13:12:31 +0000 (06:12 -0700)] 
man2/openat2.2: Add RESOLVE_CACHED

RESOLVE_CACHED allows an application to attempt a cache-only open
of a file. If this isn't possible, the request will fail with
-1/EAGAIN and the caller should retry without RESOLVE_CACHED set.
This will generally happen from a different context, where a slower
open operation can be performed.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetopt.3: ffix
Alejandro Colomar [Sun, 28 Feb 2021 00:50:25 +0000 (01:50 +0100)] 
getopt.3: ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoscripts/bash_aliases: tfix
Jakub Wilk [Fri, 26 Feb 2021 20:11:05 +0000 (21:11 +0100)] 
scripts/bash_aliases: tfix

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>
4 years agokcmp.2: Since Linux 5.12, kcmp() availability is unconditional
Michael Kerrisk [Tue, 2 Mar 2021 12:16:38 +0000 (13:16 +0100)] 
kcmp.2: Since Linux 5.12, kcmp() availability is unconditional

kcmp() is no longer dependent on CONFIG_CHECKPOINT_RESTORE.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agonetlink.7: Clarify details of netlink error responses
Philipp Schuster [Sat, 20 Feb 2021 22:48:36 +0000 (23:48 +0100)] 
netlink.7: Clarify details of netlink error responses

Make it clear that netlink error responses (i.e., messages with
type NLMSG_ERROR (0x2)), can be longer than sizeof(struct
nlmsgerr). In certain circumstances, the payload can be longer.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofutex.2: tfix
edef [Sat, 20 Feb 2021 20:12:23 +0000 (20:12 +0000)] 
futex.2: tfix

Signed-off-by: edef <edef@edef.eu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoscripts/bash_aliases: Add useful functions
Alejandro Colomar [Fri, 19 Feb 2021 14:32:23 +0000 (15:32 +0100)] 
scripts/bash_aliases: Add useful functions

That file should be sourced (.) from 'bashrc' (or 'bash_aliases').

It contains functions that are useful for the maintenance of this
project.

- grep_syscall()
- grep_syscall_def()
- man_section()
- man_lsfunc()
- pdfman()
- grep_glibc_prototype()

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoaio_suspend.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Fri, 19 Feb 2021 13:03:27 +0000 (14:03 +0100)] 
aio_suspend.3: SYNOPSIS: Use 'restrict' in prototypes

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>
4 years agoptrace.2: tfix
edef [Fri, 19 Feb 2021 23:54:22 +0000 (23:54 +0000)] 
ptrace.2: tfix

Signed-off-by: edef <edef@edef.eu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotime_namespaces.7: tfix
Michael Kerrisk [Sat, 20 Feb 2021 14:21:58 +0000 (15:21 +0100)] 
time_namespaces.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopciconfig_read.2: tfix
Jakub Wilk [Sat, 20 Feb 2021 13:22:30 +0000 (14:22 +0100)] 
pciconfig_read.2: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprctl.2: ffix
Michael Kerrisk [Fri, 19 Feb 2021 13:29:32 +0000 (14:29 +0100)] 
prctl.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosetjmp.3: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:59 +0000 (22:23 +0100)] 
setjmp.3: SYNOPSIS: Use 'noreturn' in prototypes

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>
4 years agopthread_exit.3: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:58 +0000 (22:23 +0100)] 
pthread_exit.3: SYNOPSIS: Use 'noreturn' in prototypes

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>
4 years agoexit.3: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:57 +0000 (22:23 +0100)] 
exit.3: SYNOPSIS: Use 'noreturn' in prototypes

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>
4 years agoerr.3: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:56 +0000 (22:23 +0100)] 
err.3: SYNOPSIS: Use 'noreturn' in prototypes

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>
4 years ago_exit.2: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:55 +0000 (22:23 +0100)] 
_exit.2: SYNOPSIS: Use 'noreturn' in prototypes

POSIX specifies that _exit() and _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>
4 years agoabort.3: SYNOPSIS: Use 'noreturn' in prototypes
Alejandro Colomar [Thu, 18 Feb 2021 21:23:54 +0000 (22:23 +0100)] 
abort.3: SYNOPSIS: Use 'noreturn' in prototypes

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>
4 years agoerror.3: Clarify the meaning of 'status==0' for error(3)
Michael Kerrisk [Fri, 19 Feb 2021 12:21:50 +0000 (13:21 +0100)] 
error.3: Clarify the meaning of 'status==0' for error(3)

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>
4 years agostrerror.3: VERSIONS: Document that strerrorname_np() and strerrordesc_np() functions...
Alejandro Colomar [Wed, 17 Feb 2021 12:23:11 +0000 (13:23 +0100)] 
strerror.3: VERSIONS: Document that strerrorname_np() and strerrordesc_np() 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>
4 years agoepoll_wait.2: CONFORMING TO: note that epoll_pwait2() is Linux-specific
Dmitry V. Levin [Wed, 17 Feb 2021 08:00:00 +0000 (08:00 +0000)] 
epoll_wait.2: CONFORMING TO: note that epoll_pwait2() is Linux-specific

Mention epoll_pwait2 in "CONFORMING TO" section.

Complements: ba47eb5e3 "epoll_wait.2: Add documentation of epoll_pwait2()"
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: Add CONFORMING TO
Michael Kerrisk [Thu, 18 Feb 2021 07:54:06 +0000 (08:54 +0100)] 
process_madvise.2: Add CONFORMING TO

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoMakefile: Fix html target bug
Michael Kerrisk [Tue, 16 Feb 2021 10:03:15 +0000 (11:03 +0100)] 
Makefile: Fix html target bug

Switching into the man? subdirectories when running man2html(1)
caused a bug where ".so dir/page.n" links were misinterpreted
(because the directory prefix was interpreted with respect to
the current directory)i, and consequently, the link files
were not correctly rendered. There's no need to switch into the
subdirectories.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoelf.5: srcfix: Remove idiosyncratic mark-up
Michael Kerrisk [Tue, 16 Feb 2021 09:51:07 +0000 (10:51 +0100)] 
elf.5: srcfix: Remove idiosyncratic mark-up

This page uses some idiosyncratic mark-up involving the use of
a groff register. The mark-up actually makes no difference to
the formatted result, but does cause man2html(1) to emit error
messages, since it does not understand the mark-up. So, remove
that mark-up.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosimpleq.3, stailq.3, queue.7, SIMPLEQ_*.3: Document SIMPLEQ_*() as an alias to STAILQ...
Alejandro Colomar [Mon, 15 Feb 2021 16:32:37 +0000 (17:32 +0100)] 
simpleq.3, stailq.3, queue.7, SIMPLEQ_*.3: Document SIMPLEQ_*() as an alias to STAILQ_*() macros

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopciconfig_read.2: SYNOPSIS: Fix prototype parameter types
Alejandro Colomar [Mon, 15 Feb 2021 13:15:32 +0000 (14:15 +0100)] 
pciconfig_read.2: SYNOPSIS: Fix prototype parameter types

Use the glibc prototypes instead of the kernel ones.
Exception: use 'int' instead of 'enum'.

......

.../glibc$ grep_glibc_prototype pciconfig_read
sysdeps/unix/sysv/linux/alpha/sys/io.h:72:
extern int pciconfig_read (unsigned long int __bus,
   unsigned long int __dfn,
   unsigned long int __off,
   unsigned long int __len,
   unsigned char *__buf) __THROW;
sysdeps/unix/sysv/linux/ia64/sys/io.h:57:
extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn,
   unsigned long int __off, unsigned long int __len,
   unsigned char *__buf);
.../glibc$ grep_glibc_prototype pciconfig_write
sysdeps/unix/sysv/linux/alpha/sys/io.h:78:
extern int pciconfig_write (unsigned long int __bus,
    unsigned long int __dfn,
    unsigned long int __off,
    unsigned long int __len,
    unsigned char *__buf) __THROW;
sysdeps/unix/sysv/linux/ia64/sys/io.h:61:
extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn,
    unsigned long int __off, unsigned long int __len,
    unsigned char *__buf);
.../glibc$ grep_glibc_prototype pciconfig_iobase
sysdeps/unix/sysv/linux/alpha/sys/io.h:66:
extern long pciconfig_iobase(enum __pciconfig_iobase_which __which,
     unsigned long int __bus,
     unsigned long int __dfn)
     __THROW __attribute__ ((const));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agovmsplice.2: SYNOPSIS: Fix prototype parameter type
Alejandro Colomar [Mon, 15 Feb 2021 13:15:26 +0000 (14:15 +0100)] 
vmsplice.2: SYNOPSIS: Fix prototype parameter type

The 3rd parameter of vmsplice() uses 'size_t' in glibc.  Fix it.

......

.../gnu/glibc$ grep_glibc_prototype vmsplice
sysdeps/unix/sysv/linux/bits/fcntl-linux.h:391:
extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
   size_t __count, unsigned int __flags);
.../gnu/glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agolookup_dcookie.2: Use standard types: u64 -> uint64_t
Alejandro Colomar [Mon, 15 Feb 2021 13:15:28 +0000 (14:15 +0100)] 
lookup_dcookie.2: Use standard types: u64 -> uint64_t

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotkill.2: SYNOPSIS: Fix prototype parameter types
Alejandro Colomar [Mon, 15 Feb 2021 13:15:24 +0000 (14:15 +0100)] 
tkill.2: SYNOPSIS: Fix prototype parameter types

All but the last parameters of t[g]kill() use 'pid_t',
both in the kernel and glibc.  Fix them.

......

.../linux/linux$ grep_syscall tkill
kernel/signal.c:3870:
SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig)
include/linux/syscalls.h:685:
asmlinkage long sys_tkill(pid_t pid, int sig);
.../linux/linux$

.../gnu/glibc$ grep_glibc_prototype tgkill
sysdeps/unix/sysv/linux/bits/signal_ext.h:29:
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
.../gnu/glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_run.2: SYNOPSIS: Fix prototype parameter types
Alejandro Colomar [Mon, 15 Feb 2021 13:15:22 +0000 (14:15 +0100)] 
spu_run.2: SYNOPSIS: Fix prototype parameter types

The 2nd and 3rd parameters of spu_run() use 'uint32_t *'.  Fix it.

......

.../linux$ grep_syscall spu_run
arch/powerpc/platforms/cell/spu_syscalls.c:80:
SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
include/linux/syscalls.h:1034:
asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
 __u32 __user *ustatus);
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_create.2: SYNOPSIS: Fix prototype parameter type
Alejandro Colomar [Mon, 15 Feb 2021 13:15:20 +0000 (14:15 +0100)] 
spu_create.2: SYNOPSIS: Fix prototype parameter type

The 'flags' parameter of spu_create() uses 'unsigned int'.  Fix it.

......

.../linux$ grep_syscall spu_create
arch/powerpc/platforms/cell/spu_syscalls.c:56:
SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
umode_t, mode, int, neighbor_fd)
include/linux/syscalls.h:1036:
asmlinkage long sys_spu_create(const char __user *name,
unsigned int flags, umode_t mode, int fd);
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosplice.2: Use 'off64_t' instead of 'loff_t'
Alejandro Colomar [Mon, 15 Feb 2021 13:15:18 +0000 (14:15 +0100)] 
splice.2: Use 'off64_t' instead of 'loff_t'

The kernel syscall uses 'loff_t', but the glibc wrapper uses 'off64_t'.
Let's document the wrapper prototype, as in other pages.

......

.../glibc$ grep_glibc_prototype splice
sysdeps/unix/sysv/linux/bits/fcntl-linux.h:398:
extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 __off64_t *__offout, size_t __len,
 unsigned int __flags);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosetfsgid.2: tfix
Alejandro Colomar [Mon, 15 Feb 2021 13:15:16 +0000 (14:15 +0100)] 
setfsgid.2: tfix

The type of fsgid is git_t, and not uid_t.  Fix it.

......

.../glibc$ grep_glibc_prototype setfsgid
sysdeps/unix/sysv/linux/sys/fsuid.h:31:
extern int setfsgid (__gid_t __gid) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosocketcall.2: tfix
Michael Kerrisk [Mon, 15 Feb 2021 19:52:43 +0000 (20:52 +0100)] 
socketcall.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosocketcall.2: wfix
Michael Kerrisk [Mon, 15 Feb 2021 19:52:24 +0000 (20:52 +0100)] 
socketcall.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosocketcall.2: Add note about missing glibc wrapper
Alejandro Colomar [Mon, 15 Feb 2021 13:15:14 +0000 (14:15 +0100)] 
socketcall.2: Add note about missing glibc wrapper

......

.../glibc$ grep_glibc_prototype socketcall
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosched_setattr.2: Add note about missing glibc wrappers
Alejandro Colomar [Mon, 15 Feb 2021 13:15:12 +0000 (14:15 +0100)] 
sched_setattr.2: Add note about missing glibc wrappers

......

.../glibc$ grep_glibc_prototype sched_setattr
.../glibc$ grep_glibc_prototype sched_getattr
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agos390_pci_mmio_write.2: SYNOPSIS: Add 'const' qualifier
Alejandro Colomar [Mon, 15 Feb 2021 13:15:10 +0000 (14:15 +0100)] 
s390_pci_mmio_write.2: SYNOPSIS: Add 'const' qualifier

s390_pci_mmio_write() uses 'const void *' instead of 'void *'.
Fix it.

......

.../linux$ grep_syscall s390_pci_mmio_write
arch/s390/pci/pci_mmio.c:119:
SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
const void __user *, user_buffer, size_t, length)
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoexecve.2: spfix
Jakub Wilk [Mon, 15 Feb 2021 13:46:58 +0000 (14:46 +0100)] 
execve.2: spfix

"Mibibytes" is a misspelling of "mebibytes",
but let's use more familiar "MiB" instead.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorename.2: wfix
Michael Kerrisk [Mon, 15 Feb 2021 12:45:19 +0000 (13:45 +0100)] 
rename.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprctl.2: Document Syscall User Dispatch
Gabriel Krisman Bertazi [Sun, 7 Feb 2021 23:47:57 +0000 (18:47 -0500)] 
prctl.2: Document Syscall User Dispatch

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoepoll_pwait2.2: New link to epoll_wait(2)
Dmitry V. Levin [Sat, 13 Feb 2021 08:00:00 +0000 (08:00 +0000)] 
epoll_pwait2.2: New link to epoll_wait(2)

Complements: ba47eb5e3 "epoll_wait.2: Add documentation of epoll_pwait2()"
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoexecve.2: Correct the versions of Linux that don't have ARG_MAX argv/envp size
Palmer Dabbelt [Sun, 14 Feb 2021 04:29:09 +0000 (20:29 -0800)] 
execve.2: Correct the versions of Linux that don't have ARG_MAX argv/envp size

I just happened upon this inconsistent text while reading `man 2
execve`.  The code in question landed in 2.6.23 as b6a2fea39318
("mm: variable length argument support").

Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotimer_settime.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:24 +0000 (00:10 +0100)] 
timer_settime.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of timer_settime()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype timer_settime
time/time.h:242:
extern int timer_settime (timer_t __timerid, int __flags,
  const struct itimerspec *__restrict __value,
  struct itimerspec *__restrict __ovalue) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotimer_create.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:23 +0000 (00:10 +0100)] 
timer_create.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of timer_create()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype timer_create
time/time.h:234:
extern int timer_create (clockid_t __clock_id,
 struct sigevent *__restrict __evp,
 timer_t *__restrict __timerid) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostat.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:22 +0000 (00:10 +0100)] 
stat.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of stat(), lstat(), and fstatat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype stat
io/sys/stat.h:205:
extern int stat (const char *__restrict __file,
 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype lstat
io/sys/stat.h:259:
extern int lstat (const char *__restrict __file,
  struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype fstatat
io/sys/stat.h:234:
extern int fstatat (int __fd, const char *__restrict __file,
    struct stat *__restrict __buf, int __flag)
     __THROW __nonnull ((2, 3));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostatx.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:21 +0000 (00:10 +0100)] 
statx.2: SYNOPSIS: Use 'restrict' in prototypes

Glibc uses 'restrict' for the types of the parameters of statx().
Let's use it here too.

......

.../glibc$ grep_glibc_prototype statx
io/bits/statx-generic.h:60:
int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __THROW __nonnull ((2, 5));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosigwaitinfo.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:20 +0000 (00:10 +0100)] 
sigwaitinfo.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of sigwaitinfo()
and sigtimedwait() shall be 'restrict'.
Glibc uses 'restrict' too.  Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigwaitinfo
signal/signal.h:264:
extern int sigwaitinfo (const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __nonnull ((1));
.../glibc$ grep_glibc_prototype sigtimedwait
signal/signal.h:272:
extern int sigtimedwait (const sigset_t *__restrict __set,
 siginfo_t *__restrict __info,
 const struct timespec *__restrict __timeout)
     __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosigprocmask.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:19 +0000 (00:10 +0100)] 
sigprocmask.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of sigprocmask()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigprocmask
signal/signal.h:232:
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
sigset_t *__restrict __oset) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosigaltstack.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:18 +0000 (00:10 +0100)] 
sigaltstack.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of sigaltstack()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigaltstack
signal/signal.h:320:
extern int sigaltstack (const stack_t *__restrict __ss,
stack_t *__restrict __oss) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosigaction.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:17 +0000 (00:10 +0100)] 
sigaction.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of sigaction()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigaction
signal/signal.h:243:
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
      struct sigaction *__restrict __oact) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoselect.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:16 +0000 (00:10 +0100)] 
select.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of [p]select()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype select
misc/sys/select.h:101:
extern int select (int __nfds, fd_set *__restrict __readfds,
   fd_set *__restrict __writefds,
   fd_set *__restrict __exceptfds,
   struct timeval *__restrict __timeout);
.../glibc$ grep_glibc_prototype pselect
misc/sys/select.h:113:
extern int pselect (int __nfds, fd_set *__restrict __readfds,
    fd_set *__restrict __writefds,
    fd_set *__restrict __exceptfds,
    const struct timespec *__restrict __timeout,
    const __sigset_t *__restrict __sigmask);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorecv.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:15 +0000 (00:10 +0100)] 
recv.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of recvfrom()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype recvfrom
socket/sys/socket.h:163:
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
 int __flags, __SOCKADDR_ARG __addr,
 socklen_t *__restrict __addr_len);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoreadlink.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:14 +0000 (00:10 +0100)] 
readlink.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of readlink() and readlinkat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype readlink
posix/unistd.h:820:
extern ssize_t readlink (const char *__restrict __path,
 char *__restrict __buf, size_t __len)
     __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3));
.../glibc$ grep_glibc_prototype readlinkat
posix/unistd.h:832:
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
   char *__restrict __buf, size_t __len)
     __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetsockopt.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:13 +0000 (00:10 +0100)] 
getsockopt.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of getsockopt()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype getsockopt
socket/sys/socket.h:208:
extern int getsockopt (int __fd, int __level, int __optname,
       void *__restrict __optval,
       socklen_t *__restrict __optlen) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetpeername.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:12 +0000 (00:10 +0100)] 
getpeername.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of getpeername()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype getpeername
socket/sys/socket.h:130:
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __len) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoaccept.2: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar [Sat, 13 Feb 2021 23:10:11 +0000 (00:10 +0100)] 
accept.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies the parameters of accept() shall be 'restrict'.
Glibc uses 'restrict' too (also for accept4()).
Let's use it here too.

......

.../glibc$ grep_glibc_prototype accept
socket/sys/socket.h:232:
extern int accept (int __fd, __SOCKADDR_ARG __addr,
   socklen_t *__restrict __addr_len);
.../glibc$ grep_glibc_prototype accept4
socket/sys/socket.h:240:
extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
    socklen_t *__restrict __addr_len, int __flags);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: Consistently use the term 'advice'
Michael Kerrisk [Sat, 13 Feb 2021 21:54:00 +0000 (22:54 +0100)] 
process_madvise.2: Consistently use the term 'advice'

The page used 'hint' and 'advice' synonymously. This leaves the
reader wondering if the terms mean the same thing, or different
things. They mean the same thing, so use just one term.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: wfix
Michael Kerrisk [Sat, 13 Feb 2021 21:48:37 +0000 (22:48 +0100)] 
process_madvise.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>