]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
4 years agounix.7: Use sizeof() to get buffer size (instead of hardcoding macro name)
Alejandro Colomar [Thu, 10 Sep 2020 21:13:36 +0000 (23:13 +0200)] 
unix.7: Use sizeof() to get buffer size (instead of hardcoding macro name)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofread.3: Move ARRAY_SIZE logic into macro
Alejandro Colomar [Thu, 10 Sep 2020 21:13:35 +0000 (23:13 +0200)] 
fread.3: Move ARRAY_SIZE logic into macro

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agotimer_create.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Alejandro Colomar [Thu, 10 Sep 2020 21:13:27 +0000 (23:13 +0200)] 
timer_create.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agorequest_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Alejandro Colomar [Thu, 10 Sep 2020 21:13:28 +0000 (23:13 +0200)] 
request_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoadd_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Alejandro Colomar [Thu, 10 Sep 2020 21:13:29 +0000 (23:13 +0200)] 
add_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetpwent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)
Alejandro Colomar [Thu, 10 Sep 2020 21:13:34 +0000 (23:13 +0200)] 
getpwent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetgrent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)
Alejandro Colomar [Thu, 10 Sep 2020 21:13:33 +0000 (23:13 +0200)] 
getgrent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomembarrier.2: Note that glibc does not provide a wrapper
Alejandro Colomar [Thu, 10 Sep 2020 21:13:43 +0000 (23:13 +0200)] 
membarrier.2: Note that glibc does not provide a wrapper

Notes: I copied .nf and .fi from futex.2, but they made no visual difference.
What do they actually do?

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoget_phys_pages.3: Write 'long' instead of 'long int'
Alejandro Colomar [Thu, 10 Sep 2020 21:13:38 +0000 (23:13 +0200)] 
get_phys_pages.3: Write 'long' instead of 'long int'

For consistency.

Most man pages use 'long' instead of 'long int'.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetpwent_r.3: Declare variables with different types in different lines
Alejandro Colomar [Thu, 10 Sep 2020 21:13:37 +0000 (23:13 +0200)] 
getpwent_r.3: Declare variables with different types in different lines

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoaio.7: Use perror() directly
Alejandro Colomar [Thu, 10 Sep 2020 21:13:42 +0000 (23:13 +0200)] 
aio.7: Use perror() directly

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: ffix
Alejandro Colomar [Thu, 10 Sep 2020 21:13:41 +0000 (23:13 +0200)] 
loop.4: ffix

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agooffsetof.3: Use "%zu" rather than "%zd" when printing 'size_t' values
Alejandro Colomar [Thu, 10 Sep 2020 21:13:26 +0000 (23:13 +0200)] 
offsetof.3: Use "%zu" rather than "%zd" when printing 'size_t' values

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agortnetlink.7: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:42:55 +0000 (07:42 +0200)] 
rtnetlink.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoreadlink.2: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:33:34 +0000 (07:33 +0200)] 
readlink.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agortnetlink.7: tfix
Michael Kerrisk [Fri, 11 Sep 2020 05:32:56 +0000 (07:32 +0200)] 
rtnetlink.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agortnetlink.7: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:31:50 +0000 (07:31 +0200)] 
rtnetlink.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agolocale.7: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:24:36 +0000 (07:24 +0200)] 
locale.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofuse.4: srcfix
Michael Kerrisk [Fri, 11 Sep 2020 05:23:41 +0000 (07:23 +0200)] 
fuse.4: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofuse.4: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:22:16 +0000 (07:22 +0200)] 
fuse.4: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agospu_create.2: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:20:48 +0000 (07:20 +0200)] 
spu_create.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agocopy_file_range.2: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:19:38 +0000 (07:19 +0200)] 
copy_file_range.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoioctl_userfaultfd.2: ffix
Michael Kerrisk [Fri, 11 Sep 2020 05:19:04 +0000 (07:19 +0200)] 
ioctl_userfaultfd.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agodlopen.3, gnu_get_libc_version.3: tfix
Jakub Wilk [Thu, 10 Sep 2020 09:53:17 +0000 (11:53 +0200)] 
dlopen.3, gnu_get_libc_version.3: tfix

Escape hyphens.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: tfix
Jakub Wilk [Thu, 10 Sep 2020 09:56:34 +0000 (11:56 +0200)] 
loop.4: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agodlopen.3: Clarify DT_RUNPATH/DT_RPATH details
Michael Kerrisk [Thu, 10 Sep 2020 09:46:21 +0000 (11:46 +0200)] 
dlopen.3: Clarify DT_RUNPATH/DT_RPATH details

It is the DT_RUNPATH/DT_RPATH of the calling object (not the
executable) that is relevant for the library search. Verified
by experiment.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetopt.3: Minor wording fix
Michael Kerrisk [Thu, 10 Sep 2020 07:35:27 +0000 (09:35 +0200)] 
getopt.3: Minor wording fix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Minor edits to Yang Xu's patch
Michael Kerrisk [Thu, 10 Sep 2020 06:11:48 +0000 (08:11 +0200)] 
loop.4: Minor edits to Yang Xu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Add some details about lo_flags
Yang Xu [Thu, 10 Sep 2020 02:19:44 +0000 (10:19 +0800)] 
loop.4: Add some details about lo_flags

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Minor tweaks to Yang Xu's patch
Michael Kerrisk [Wed, 9 Sep 2020 13:09:47 +0000 (15:09 +0200)] 
loop.4: Minor tweaks to Yang Xu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Document LOOP_CONFIGURE ioctl
Yang Xu [Wed, 9 Sep 2020 12:05:56 +0000 (20:05 +0800)] 
loop.4: Document LOOP_CONFIGURE ioctl

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomsgop.2: Minor tweak's to Yang Xu's patch
Michael Kerrisk [Wed, 9 Sep 2020 12:17:18 +0000 (14:17 +0200)] 
msgop.2: Minor tweak's to Yang Xu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomsgop.2: Add restriction on ENOSYS error
Yang Xu [Wed, 9 Sep 2020 03:57:42 +0000 (11:57 +0800)] 
msgop.2: Add restriction on ENOSYS error

When calling msgrcv() with the MSG_COPY flag, it will report
EINVAL error even we if have disabled CONFIG_CHECKPOINT_RESTORE.
ENOSYS will be reported only if we also specify the IPC_NOWAIT
flag.

[mtk: edited commit message]

Notes from mtk:

The relevant kernel code is this:

[[
#ifdef CONFIG_CHECKPOINT_RESTORE
...
#else
static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz)
{
        return ERR_PTR(-ENOSYS);
}

...
static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long
msgtyp, int msgflg,
               long (*msg_handler)(void __user *, struct msg_msg *, size_t))
{
...
        if (msgflg & MSG_COPY) {
                if ((msgflg & MSG_EXCEPT) || !(msgflg & IPC_NOWAIT))
                        return -EINVAL;
                copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax));
...
}
]]

We'll only hit the ENOSYS error if:
(1) MSG_COPY was specified;
(2) IPC_NOWAIT was not specified; and
(3) CONFIG_CHECKPOINT_RESTORE was not enabled.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoproc.5: Note "open file description" as (better) synonym for "file handle"
Michael Kerrisk [Wed, 9 Sep 2020 10:09:56 +0000 (12:09 +0200)] 
proc.5: Note "open file description" as (better) synonym for "file handle"

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: wfix
Michael Kerrisk [Wed, 9 Sep 2020 09:08:41 +0000 (11:08 +0200)] 
loop.4: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Minor tweaks to Yang Xu's patch
Michael Kerrisk [Wed, 9 Sep 2020 09:06:01 +0000 (11:06 +0200)] 
loop.4: Minor tweaks to Yang Xu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoloop.4: Document LO_FLAGS_DIRECT_IO flag
Yang Xu [Thu, 6 Aug 2020 09:48:32 +0000 (17:48 +0800)] 
loop.4: Document LO_FLAGS_DIRECT_IO flag

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoposix_spawn.3: tfix
Mike Frysinger [Mon, 7 Sep 2020 23:46:22 +0000 (19:46 -0400)] 
posix_spawn.3: tfix

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agobsearch.3: Declare variables with different types in different lines
Alejandro Colomar [Mon, 7 Sep 2020 21:27:42 +0000 (23:27 +0200)] 
bsearch.3: Declare variables with different types in different lines

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopthread_getattr_np.3: Use "%zu" and "%zx" when printing 'size_t' values
Alejandro Colomar [Mon, 7 Sep 2020 20:17:36 +0000 (22:17 +0200)] 
pthread_getattr_np.3: Use "%zu" and "%zx" when printing 'size_t' values

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofopencookie.3: Fix bugs in example
Alejandro Colomar [Mon, 7 Sep 2020 10:21:17 +0000 (12:21 +0200)] 
fopencookie.3: Fix bugs in example

fread(3), unlike read(2) which returns a ssize_t, returns a
size_t.  It doesn't distinguish between error and enf-of-file.
Instead, either ferror(3) or feof(3) need to be checked if fread()
returned 0.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agofopencookie.3: printf()'s .* expects an int; cast accordingly
Alejandro Colomar [Mon, 7 Sep 2020 10:21:16 +0000 (12:21 +0200)] 
fopencookie.3: printf()'s .* expects an int; cast accordingly

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoerrno.3: Note that the pthreads APIs do not set errno
Michael Kerrisk [Mon, 7 Sep 2020 09:19:53 +0000 (11:19 +0200)] 
errno.3: Note that the pthreads APIs do not set errno

Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopthreads.7: Explicitly note that pthreads APIs return an errno-style value on error
Michael Kerrisk [Mon, 7 Sep 2020 09:11:30 +0000 (11:11 +0200)] 
pthreads.7: Explicitly note that pthreads APIs return an errno-style value on error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agogetline.3: Use %zd rather than %zu when printing 'ssize_t' values
Alejandro Colomar [Mon, 7 Sep 2020 08:35:28 +0000 (10:35 +0200)] 
getline.3: Use %zd rather than %zu when printing 'ssize_t' values

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agohcreate.3: Declare variables with different types in different lines
Alejandro Colomar [Mon, 7 Sep 2020 08:11:33 +0000 (10:11 +0200)] 
hcreate.3: Declare variables with different types in different lines

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agoopen.2: ERRORS: EBUSY
Michael Kerrisk [Mon, 7 Sep 2020 07:26:02 +0000 (09:26 +0200)] 
open.2: ERRORS: EBUSY

An EBUSY error case is mentioned in DESCRIPTIOn; add it to ERRORS
also.

See also https://bugzilla.kernel.org/show_bug.cgi?id=209109

Reported-by: henrik@optoscale.no
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agodlopen.3: Revert accidentally applied "dlopen.3: Remove unneeded cast"
Michael Kerrisk [Sun, 6 Sep 2020 14:58:45 +0000 (16:58 +0200)] 
dlopen.3: Revert accidentally applied "dlopen.3: Remove unneeded cast"

This reverts commit ffa50fbf01ef1ecb9cac49c28786860a9d0d3f02.

4 years agoqsort.3: Fix casts
Alejandro Colomar [Sat, 5 Sep 2020 15:15:01 +0000 (17:15 +0200)] 
qsort.3: Fix casts

`p1` (and `p2` too) is `const void *` and it comes from a
`const char **` (for legacy reasons, argv is not `const` but should be
treated as if it were).  That means, the ultimate `char` is `const`:
"a pointer to a pointer to a const char".

Let's see what is going on before the fix first, and then the fix.

Before the fix:

`(char *const *)` (I removed the space on purpose) casts `p1` to be
"a pointer to a const pointer to a non-const char".  That's clearly
not what it originally was.

Then we dereference, ending with a `char *const`, which is
"a const pointer to a non-const char".  But given that the pointer value
is passed to a function, `const` doesn't make sense there, because the
function will already take a copy of it, so it is impossible to modify
the pointer itself.

The fix:

`(const char **)` The only thing that is const is the ultimate `char`,
which is the only thing that matters, because it is the only thing
strcmp(3) has access to (everything else, i.e. the pointers, are
copies).

Then, after the dereference we end up with `const char *`, the type of
argv (more or less, as previously noted), which is also the type of the
arguments to strcmp(3).

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agobsearch.3: Fix intermediate type and remove unneeded casts
Alejandro Colomar [Sat, 5 Sep 2020 15:15:00 +0000 (17:15 +0200)] 
bsearch.3: Fix intermediate type and remove unneeded casts

Casting `const void *` to `struct mi *` should result in a warning if
done implicitly.  The explicit cast was probably silencing that warning.
`const` can and should be kept.
Now, casting `const void *` to `const struct mi *` is done implicitly.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agouser_namespaces.7: Remove unneeded cast
Alejandro Colomar [Sat, 5 Sep 2020 15:14:58 +0000 (17:14 +0200)] 
user_namespaces.7: Remove unneeded cast

Casting `void *` to `struct child_args *` is already done implicitly.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agomsgop.2: Remove unneeded casts
Alejandro Colomar [Sat, 5 Sep 2020 15:14:57 +0000 (17:14 +0200)] 
msgop.2: Remove unneeded casts

The type `struct msgbuf *` is implicitly casted to `const void *`.
Not only that, but the explicit cast to `void *` was slightly
misleading.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agopthread_sigmask.3: Remove unneeded casts
Alejandro Colomar [Sat, 5 Sep 2020 15:14:56 +0000 (17:14 +0200)] 
pthread_sigmask.3: Remove unneeded casts

The type `sigset_t *` is implicitly casted to `void *`.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agosock_diag.7: Remove unneeded casts
Alejandro Colomar [Sat, 5 Sep 2020 15:14:55 +0000 (17:14 +0200)] 
sock_diag.7: Remove unneeded casts

The type `struct sockaddr_nl *` is implicitly casted to `void *`.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agodlopen.3: Remove unneeded cast
Alejandro Colomar [Sat, 5 Sep 2020 15:14:59 +0000 (17:14 +0200)] 
dlopen.3: Remove unneeded cast

Casting `void *` to `double (*cosine)(double)` is already done
implicitly.
I had doubts about this one, but `gcc -Wall -Wextra` didn't complain
about it.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
4 years agostdarg.3: Declare variables with different types in different lines
Alejandro Colomar [Sat, 5 Sep 2020 22:09:35 +0000 (00:09 +0200)] 
stdarg.3: Declare variables with different types in different lines

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agotsearch.3: Simplify type usage and remove unneeded casts
Alejandro Colomar [Sat, 5 Sep 2020 19:42:00 +0000 (21:42 +0200)] 
tsearch.3: Simplify type usage and remove unneeded casts

The type of `val` is `int **`, and it will work with tsearch()
anyway because of implicit cast from `void *`, so declaring it as an
`int **` simplifies the code.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agofanotify.7: Pass array to read(2) directly instead of a pointer to it
Alejandro Colomar [Sat, 5 Sep 2020 11:28:45 +0000 (13:28 +0200)] 
fanotify.7: Pass array to read(2) directly instead of a pointer to it

It doesn't make any sense to pass a pointer to the array to
read(2).

It might make sense to pass a pointer to the first element of the
array, but that is already implicitly done when passing the array,
which decays to that pointer, so it's simpler to pass the array.

And anyway, the cast was unneeded, as any pointer is implicitly
cast to `void *`.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agotsearch.3: Remove unneeded cast
Alejandro Colomar [Sat, 5 Sep 2020 15:40:44 +0000 (17:40 +0200)] 
tsearch.3: Remove unneeded cast

Casting `int *` to `const void *` is already done implicitly.
Not only that, but the explicit cast to `void *` was slightly
misleading.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agotsearch.3: Use size_t for malloc() argument
Alejandro Colomar [Sat, 5 Sep 2020 10:17:24 +0000 (12:17 +0200)] 
tsearch.3: Use size_t for malloc() argument

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agosprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, open_by_handle_at...
Michael Kerrisk [Sat, 5 Sep 2020 15:18:10 +0000 (17:18 +0200)] 
sprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, open_by_handle_at.2, recvmmsg.2, sched_setaffinity.2, CPU_SET.3, backtrace.3, bsearch.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, envz_add.3, fopencookie.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, hsearch.3, mallinfo.3, malloc_info.3, mbstowcs.3, mtrace.3, pthread_create.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, qsort.3, rand.3, strcat.3, strtok.3, tsearch.3, wordexp.3, core.5, aio.7, inotify.7, sock_diag.7, unix.7, user_namespaces.7: Use C99 style to declare loop counter variables

Rather than:

    sometype x;

    for (x = ....; ...)

use

    for (sometype x = ...; ...)

This brings the declaration and use closer together (thus aiding
readability) and also clearly indicates the scope of the loop
counter variable.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agogetdents.2: ffix
Michael Kerrisk [Sat, 5 Sep 2020 14:54:19 +0000 (16:54 +0200)] 
getdents.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agogetgrouplist.3, insque.3, malloc_info.3, pthread_create.3, tsearch.3, aio.7: Use...
Michael Kerrisk [Sat, 5 Sep 2020 14:34:34 +0000 (16:34 +0200)] 
getgrouplist.3, insque.3, malloc_info.3, pthread_create.3, tsearch.3, aio.7: Use C99-style declarations for readability

Rather than writing things such as:

    struct sometype *x;
    ...
    x = malloc(sizeof(*x));

let's use C99 style so that the type info is in the same line as
the allocation:

    struct sometype *x = malloc(sizeof(*x));

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agotsearch.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:56:52 +0000 (21:56 +0200)] 
tsearch.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agopthread_create.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:52:22 +0000 (21:52 +0200)] 
pthread_create.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agombstowcs.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:51:07 +0000 (21:51 +0200)] 
mbstowcs.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoshm_open.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:55:48 +0000 (21:55 +0200)] 
shm_open.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoaio.7: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:57:28 +0000 (21:57 +0200)] 
aio.7: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agortnetlink.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:55:11 +0000 (21:55 +0200)] 
rtnetlink.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agortnetlink.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:55:00 +0000 (21:55 +0200)] 
rtnetlink.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agopthread_setaffinity_np.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:53:12 +0000 (21:53 +0200)] 
pthread_setaffinity_np.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agounix.7: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 20:24:12 +0000 (22:24 +0200)] 
unix.7: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agofanotify.7: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:58:14 +0000 (21:58 +0200)] 
fanotify.7: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agostrptime.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:56:21 +0000 (21:56 +0200)] 
strptime.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agombsinit.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:50:10 +0000 (21:50 +0200)] 
mbsinit.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agomalloc_info.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:49:17 +0000 (21:49 +0200)] 
malloc_info.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoinsque.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:47:45 +0000 (21:47 +0200)] 
insque.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agogetgrouplist.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:47:15 +0000 (21:47 +0200)] 
getgrouplist.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agogetaddrinfo.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:46:35 +0000 (21:46 +0200)] 
getaddrinfo.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agogetaddrinfo.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:46:06 +0000 (21:46 +0200)] 
getaddrinfo.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agocmsg.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:44:54 +0000 (21:44 +0200)] 
cmsg.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agocmsg.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:44:41 +0000 (21:44 +0200)] 
cmsg.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agobsearch.3: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:43:23 +0000 (21:43 +0200)] 
bsearch.3: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agosignalfd.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:41:31 +0000 (21:41 +0200)] 
signalfd.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agosysctl.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:39:56 +0000 (21:39 +0200)] 
sysctl.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoperf_event_open.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:29:33 +0000 (21:29 +0200)] 
perf_event_open.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoperf_event_open.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:29:02 +0000 (21:29 +0200)] 
perf_event_open.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoopen_by_handle_at.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:27:55 +0000 (21:27 +0200)] 
open_by_handle_at.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agofutex.2: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 19:27:01 +0000 (21:27 +0200)] 
futex.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agobind.2: Use sizeof consistently
Alejandro Colomar [Fri, 4 Sep 2020 10:19:16 +0000 (12:19 +0200)] 
bind.2: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agobind.2, ioctl_ns.2, open_by_handle_at.2, duplocale.3: tfix
Michael Kerrisk [Sat, 5 Sep 2020 12:49:16 +0000 (14:49 +0200)] 
bind.2, ioctl_ns.2, open_by_handle_at.2, duplocale.3: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agocpuset.7: tfix
Michael Kerrisk [Sat, 5 Sep 2020 12:47:55 +0000 (14:47 +0200)] 
cpuset.7: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agomemusage.1: Use %zu rather than %zd when printing 'size_t' values
Michael Kerrisk [Fri, 4 Sep 2020 07:52:02 +0000 (09:52 +0200)] 
memusage.1: Use %zu rather than %zd when printing 'size_t' values

'size_t' is an unsigned type...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agomemusage.1: wspfix
Michael Kerrisk [Fri, 4 Sep 2020 07:51:08 +0000 (09:51 +0200)] 
memusage.1: wspfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agomemusage.1: EXAMPLES: remove doubled calculations
Michael Kerrisk [Fri, 4 Sep 2020 07:49:16 +0000 (09:49 +0200)] 
memusage.1: EXAMPLES: remove doubled calculations

The same calculations are repeated in malloc() and printf() calls.
For better readability, do the calculations once.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agomemusage.1: Use sizeof consistently
Alejandro Colomar [Thu, 3 Sep 2020 10:23:52 +0000 (12:23 +0200)] 
memusage.1: Use sizeof consistently

Hi Michael,

Continuing with the series, this is the first of the last set of
patches: (2).1 as numbered in previous emails.

Regards,
Alex.

------------------------------------------------------------------------
>From ad5f958ed68079791d6e35f9d70ca5ec2a72c43b Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <colomar.6.4.3@gmail.com>
Date: Thu, 3 Sep 2020 12:11:18 +0200
Subject: [PATCH] memusage.1: Use sizeof consistently

Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agoChanges.old: tfix
Jakub Wilk [Fri, 28 Aug 2020 15:55:37 +0000 (17:55 +0200)] 
Changes.old: tfix

Remove duplicated words.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agounix.7: wsfix
Alejandro Colomar [Thu, 3 Sep 2020 20:17:05 +0000 (22:17 +0200)] 
unix.7: wsfix

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agombsinit.3: wsfix
Alejandro Colomar [Thu, 3 Sep 2020 11:05:22 +0000 (13:05 +0200)] 
mbsinit.3: wsfix

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
5 years agofanotify.7: srcfix
Michael Kerrisk [Fri, 28 Aug 2020 12:26:57 +0000 (14:26 +0200)] 
fanotify.7: srcfix

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