]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
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>
4 years agoprocess_madvise.2: Defer to madvise(2) for description of 'advice' flags
Michael Kerrisk [Sat, 13 Feb 2021 21:40:11 +0000 (22:40 +0100)] 
process_madvise.2: Defer to madvise(2) for description of 'advice' flags

Rather than repeating the description of MADV_COLD and MADV_PAGEOUT
in two pages, centralize the discussion in madvise(2), and refer
from process_madvise(2) ro madvise(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomadvise.2: Add descriptions of MADV_COLD and MADV_PAGEOUT
Michael Kerrisk [Sat, 13 Feb 2021 20:19:15 +0000 (21:19 +0100)] 
madvise.2: Add descriptions of MADV_COLD and MADV_PAGEOUT

Taken from process_madvise(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: Minor clarification regarding partial advice scenario
Michael Kerrisk [Sat, 13 Feb 2021 20:10:04 +0000 (21:10 +0100)] 
process_madvise.2: Minor clarification regarding partial advice scenario

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: SYNOPSIS: Fix prototype parameter type
Alejandro Colomar [Thu, 11 Feb 2021 17:44:57 +0000 (18:44 +0100)] 
process_madvise.2: SYNOPSIS: Fix prototype parameter type

The type of vlen is 'size_t', and not 'unsigned int'.  Fix it.

......

$ grep_syscall process_madvise
mm/madvise.c:1161:
SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
size_t, vlen, int, behavior, unsigned int, flags)
include/linux/syscalls.h:887:
asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec,
size_t vlen, int behavior, unsigned int flags);

function grep_syscall()
{
if ! [ -v 1 ]; then
>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
return ${EX_USAGE};
fi

find * -type f \
|grep '\.c$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';

find * -type f \
|grep '\.[ch]$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoprocess_madvise.2: Add note about missing glibc wrapper
Alejandro Colomar [Thu, 11 Feb 2021 17:44:55 +0000 (18:44 +0100)] 
process_madvise.2: Add note about missing glibc wrapper

Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27380>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomove_pages.2: Add notes about missing glibc wrappers
Alejandro Colomar [Thu, 11 Feb 2021 17:44:53 +0000 (18:44 +0100)] 
move_pages.2: Add notes about missing glibc wrappers

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoshm_overview.7: SEE ALSO: add memfd_create(2)
Michael Kerrisk [Fri, 12 Feb 2021 19:33:16 +0000 (20:33 +0100)] 
shm_overview.7: SEE ALSO: add memfd_create(2)

People interested POSIX shared memory may also be interested
in memfd and file sealing.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoopen.2, rename.2: Refer to tmpfs rather than shmem
Alyssa Ross [Wed, 10 Feb 2021 17:42:45 +0000 (17:42 +0000)] 
open.2, rename.2: Refer to tmpfs rather than shmem

Skimming open(2), I was surprised not to see tmpfs mentioned as a
filesystem supported by O_TMPFILE.

If I'm understanding correctly (I'm very possibly not!), tmpfs is
a filesystem built on shmem, so I think it's more correct (and
probably much more widely understandable) to refer to tmpfs here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorename.2: wfix
Michael Kerrisk [Wed, 10 Feb 2021 21:05:34 +0000 (22:05 +0100)] 
rename.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agonetdevice.7: wfix
Michael Kerrisk [Tue, 9 Feb 2021 19:22:11 +0000 (20:22 +0100)] 
netdevice.7: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agonetdevice.7: ffix
Michael Kerrisk [Tue, 9 Feb 2021 19:19:42 +0000 (20:19 +0100)] 
netdevice.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agommap2.2: Fix prototype parameter types
Alejandro Colomar [Sun, 7 Feb 2021 12:57:47 +0000 (13:57 +0100)] 
mmap2.2: Fix prototype parameter types

There are many slightly different prototypes for this syscall,
but none of them is like the documented one.
Of all the different prototypes,
let's document the asm-generic one.

This manual page was actually using a prototype similar to
mmap(2), but there's no glibc wrapper function called mmap2(2),
as the wrapper for this syscall is mmap(2).  Therefore, the
documented prototype should be the kernel one.

......

.../linux$ grep_syscall mmap2
arch/csky/kernel/syscall.c:17:
SYSCALL_DEFINE6(mmap2,
unsigned long, addr,
unsigned long, len,
unsigned long, prot,
unsigned long, flags,
unsigned long, fd,
off_t, offset)
arch/microblaze/kernel/sys_microblaze.c:46:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags, unsigned long, fd,
unsigned long, pgoff)
arch/nds32/kernel/sys_nds32.c:12:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
       unsigned long, prot, unsigned long, flags,
       unsigned long, fd, unsigned long, pgoff)
arch/powerpc/kernel/syscalls.c:60:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len,
unsigned long, prot, unsigned long, flags,
unsigned long, fd, unsigned long, pgoff)
arch/riscv/kernel/sys_riscv.c:37:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags,
unsigned long, fd, off_t, offset)
arch/s390/kernel/sys_s390.c:49:
SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg)
arch/sparc/kernel/sys_sparc_32.c:101:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags, unsigned long, fd,
unsigned long, pgoff)
arch/ia64/include/asm/unistd.h:30:
asmlinkage unsigned long sys_mmap2(
unsigned long addr, unsigned long len,
int prot, int flags,
int fd, long pgoff);
arch/ia64/kernel/sys_ia64.c:139:
asmlinkage unsigned long
sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
arch/m68k/kernel/sys_m68k.c:40:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
arch/parisc/kernel/sys_parisc.c:275:
asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long fd,
unsigned long pgoff)
arch/powerpc/include/asm/syscalls.h:15:
asmlinkage long sys_mmap2(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
arch/sh/include/asm/syscalls.h:8:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
  unsigned long prot, unsigned long flags,
  unsigned long fd, unsigned long pgoff);
arch/sh/kernel/sys_sh.c:41:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
arch/sparc/kernel/systbls.h:23:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
  unsigned long prot, unsigned long flags,
  unsigned long fd, unsigned long pgoff);
include/asm-generic/syscalls.h:14:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
.../linux$

function grep_syscall()
{
if ! [ -v 1 ]; then
>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
return ${EX_USAGE};
fi

find * -type f \
|grep '\.c$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';

find * -type f \
|grep '\.[ch]$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomlock.2: mlock2(): Fix prototype parameter types
Alejandro Colomar [Sun, 7 Feb 2021 12:46:12 +0000 (13:46 +0100)] 
mlock.2: mlock2(): Fix prototype parameter types

The documented prototype for mlock2() was a mix of the
glibc wrapper prototype and the kernel syscall prototype.
Let's document the glibc wrapper prototype, which is shown below.

......

.../glibc$ grep_glibc_prototype mlock2
sysdeps/unix/sysv/linux/bits/mman-shared.h:55:
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
.../glibc$

function grep_glibc_prototype()
{
if ! [ -v 1 ]; then
>&2 echo "Usage: ${FUNCNAME[0]} <func>";
return ${EX_USAGE};
fi

find * -type f \
|grep '\.h$' \
|sort -V \
|xargs pcregrep -Mn \
  "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoexecveat.2: srcfix: add a link to glibc bug requesting wrapper
Michael Kerrisk [Tue, 9 Feb 2021 18:35:53 +0000 (19:35 +0100)] 
execveat.2: srcfix: add a link to glibc bug requesting wrapper

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoexecveat.2: Fix prototype
Alejandro Colomar [Sun, 7 Feb 2021 11:43:25 +0000 (12:43 +0100)] 
execveat.2: Fix prototype

It's been 6 years since execveat(2) was added to the kernel,
and there's still no glibc wrapper.  Let's document the kernel
syscall prototype.

I reported a bug against glibc requesting a wrapper;
when glibc adds the wrapper, this commit should probably be
reverted.

......

.../linux$ grep_syscall execveat
fs/exec.c:2062:
SYSCALL_DEFINE5(execveat,
int, fd, const char __user *, filename,
const char __user *const __user *, argv,
const char __user *const __user *, envp,
int, flags)
fs/exec.c:2083:
COMPAT_SYSCALL_DEFINE5(execveat, int, fd,
       const char __user *, filename,
       const compat_uptr_t __user *, argv,
       const compat_uptr_t __user *, envp,
       int,  flags)
include/linux/compat.h:815:
asmlinkage long compat_sys_execveat(int dfd, const char __user *filename,
     const compat_uptr_t __user *argv,
     const compat_uptr_t __user *envp, int flags);
include/linux/syscalls.h:980:
asmlinkage long sys_execveat(int dfd, const char __user *filename,
const char __user *const __user *argv,
const char __user *const __user *envp, int flags);
.../linux$

function grep_syscall()
{
if ! [ -v 1 ]; then
>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
return ${EX_USAGE};
fi

find * -type f \
|grep '\.c$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';

find * -type f \
|grep '\.[ch]$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27364>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoipc.2: Fix prototype parameter types
Alejandro Colomar [Sun, 7 Feb 2021 12:36:55 +0000 (13:36 +0100)] 
ipc.2: Fix prototype parameter types

The types for some of the parameters are incorrect
(different than the kernel).  Fix them.
Below are shown the types that the kernel uses.

......

.../linux$ grep_syscall ipc
ipc/syscall.c:110:
SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
unsigned long, third, void __user *, ptr, long, fifth)
ipc/syscall.c:205:
COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
u32, third, compat_uptr_t, ptr, u32, fifth)
include/linux/compat.h:874:
asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
include/linux/syscalls.h:1221:
asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
unsigned long third, void __user *ptr, long fifth);
.../linux$

function grep_syscall()
{
if ! [ -v 1 ]; then
>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
return ${EX_USAGE};
fi

find * -type f \
|grep '\.c$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';

find * -type f \
|grep '\.[ch]$' \
|sort -V \
|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorpc.3: ffix
Michael Kerrisk [Tue, 9 Feb 2021 18:16:43 +0000 (19:16 +0100)] 
rpc.3: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostat.2: Remove <unistd.h> from synopsis
Jonathan Wakely [Tue, 9 Feb 2021 12:01:17 +0000 (13:01 +0100)] 
stat.2: Remove <unistd.h> from synopsis

There seems to be no reason <unistd.h> is shown here, so remove it.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetpriority.2, recv.2, fts.3: wfix
Michael Kerrisk [Sun, 7 Feb 2021 10:38:49 +0000 (11:38 +0100)] 
getpriority.2, recv.2, fts.3: wfix

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>
4 years agoferror.3: POSIX.1-2008: these functions won't change 'errno' if 'stream' is valid
Michael Kerrisk [Sun, 7 Feb 2021 10:11:24 +0000 (11:11 +0100)] 
ferror.3: POSIX.1-2008: these functions won't change 'errno' if 'stream' is valid

See https://www.austingroupbugs.net/view.php?id=401.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoferror.3: Add a RETURN VALUE section
Michael Kerrisk [Sun, 7 Feb 2021 09:37:44 +0000 (10:37 +0100)] 
ferror.3: Add a RETURN VALUE section

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