Commit Graph

21283 Commits

Author SHA1 Message Date
Alejandro Colomar 8d635e0a7e 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>
2020-09-04 09:43:36 +02:00
Jakub Wilk 166c03a6b5 Changes.old: tfix
Remove duplicated words.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-04 09:41:46 +02:00
Alejandro Colomar 7551caeaed unix.7: wsfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-04 09:37:24 +02:00
Alejandro Colomar 64913f9cf7 mbsinit.3: wsfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-04 09:37:21 +02:00
Michael Kerrisk 2d3122a1ea fanotify.7: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:26:57 +02:00
Michael Kerrisk 0bda7dedcf fanotify_init.2, fanotify.7: Minor edits to Amir Goldstein's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:26:12 +02:00
Michael Kerrisk 1a1e4638a5 fanotify_init.2, fanotify.7: srcfix: Semantic newlines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:18:05 +02:00
Amir Goldstein ea4f577808 fanotify.7, fanotify_init.2: Document FAN_REPORT_NAME
Document fanotify_init(2) flag FAN_REPORT_NAME and the format of
the event info type FAN_EVENT_INFO_TYPE_DFID_NAME.

The fanotify_fid.c example is extended to also report the name of
the created file or subdirectory.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:16:30 +02:00
Amir Goldstein e9f14fa0bb fanotify.7, fanotify_init.2: Document FAN_REPORT_DIR_FID
Document fanotify_init(2) flag FAN_REPORT_DIR_FID and event info
type FAN_EVENT_INFO_TYPE_DFID.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:16:03 +02:00
Amir Goldstein b216da617f fanotify.7, fanotify_mark.2: Generalize documentation of FAN_REPORT_FID
With fanotify_init(2) flag FAN_REPORT_FID, the group identifies
filesystem objects by file handles in a single event info record
of type FAN_EVENT_INFO_TYPE_FID.

We intend to add support for new fanotify_init(2) flags for which
the group identifies filesystem objects by file handles and add
more event info record types.

To that end, start by changing the language of the man page to
refer to a "group that identifies filesystem objects by file
handles" instead of referring to the FAN_REPORT_FID flag and
document the extended event format structure in a more generic
manner that allows more than a single event info record and not
only a record of type FAN_EVENT_INFO_TYPE_FID.

Clarify that the object identified by the file handle refers to
the directory in directory entry modification events.

Remove a note about directory entry modification events and
monitoring a mount point that I found to be too confusing and out
of context.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:15:31 +02:00
Michael Kerrisk e7497fba60 mount.2: Minor wording improvement
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 13:51:17 +02:00
Michael Kerrisk 6a955f035e syscalls.2: Bump kernel version number
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 11:35:12 +02:00
Michael Kerrisk 373bd6e2bb syscalls.2: Add close_range (Linux 5.9)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-27 17:19:43 +02:00
Michael Kerrisk 5c14a73b2c bpf-helpers.7: Really resync against latest kernel source
Jakub points out that my last resync may accidentally have been
against an old version of the kernel source, since the resync
resulted in many deleted lines. I suspect he may be right.
Let's resync against today's current kernel.

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-26 20:55:47 +02:00
Alejandro Colomar 26499b040c cmsg.3, getaddrinfo_a.3 getgrouplist.3: Use sizeof, consistently
Use ``sizeof`` consistently through all the examples in the
following way:

- When the result of ``sizeof`` is multiplied (or otherwise
  modified), write ``sizeof`` in the first place.

Rationale:

``(sizeof(x) * INT_MAX * 2)`` doesn't overflow.

``(INT_MAX * 2 * sizeof(x))`` overflows, giving incorrect
results.

As a side effect, the parentheses of ``sizeof`` are not next to
the parentheses of the whole expression, and it is visually
easier to read.

Detailed rationale:

In C, successive multiplications are evaluated left to right (*),
and therefore here is what happens (assuming x86_64):

``(sizeof(x) * INT_MAX * 2)``:

1) sizeof(x) * INT_MAX  (the type is the largest of both, which
                         is size_t (unsigned long; uint64_t)).
2) ANS * 2        	(the type is again the largest: size_t)

``(INT_MAX * 2 * sizeof(x))``:

1) INT_MAX * 2        	(the type is the largest of both, which is
        		 int as both are int (int; int32_t), so the
        		 result is already truncated as it doesn't fit
        		 an int; at this point, the intermediate result
        		 will be 2^32 - 2 (``INT_MAX - 1``) (if I did
        		 the math right)).
2) ANS * 2        	(the type is again the largest of both: size_t;
        		 however, ANS was already incorrect, so the
        		 result will be an incorrect size_t value)

(*):        https://en.cppreference.com/w/c/language/operator_precedence

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-26 08:18:07 +02:00
Michael Kerrisk fb84ed2aae clock_getres.2: Fix type and variable name in dynamic clock code example
Use 'struct timespec', not 'struct timeval', and adjust
the variable name accordingly.

Reported-by: Tony May <tony.may@mediakind.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-26 08:10:56 +02:00
Alejandro Colomar b5cd247069 getgrouplist.3, inotify.7: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the
following way:

- Never use a space after ``sizeof``, and always use parentheses
  around the argument.

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

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-25 14:33:03 +02:00
Michael Kerrisk b32a693559 Makefile: Fix lintian.debian.org URL in comment
From the email conversation:

    From: Jakub Wilk <jwilk@jwilk.net>
    Subject: Re: [bug] Makefile: Broken link

    * Alejandro Colomar <colomar.6.4.3@gmail.com>, 2020-08-25, 12:51:
    >Line 32 on the Makefile has a broken link in a comment:
    >
    >https://lintian.debian.org/tags/manpage-has-errors-from-man.html

    This Lintian tag was renamed recently:
    https://salsa.debian.org/lintian/lintian/commit/844278682aafa1da

    The current URL is:
    https://lintian.debian.org/tags/groff-message.html

Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-25 13:55:07 +02:00
Michael Kerrisk b49ea62e96 queue.3: ffix
Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-24 17:06:59 +02:00
Michael Kerrisk c3a4e4fe36 queue.3: Minor formatting fixes for Alejandro Colomar's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-24 09:02:54 +02:00
Alejandro Colomar cbade5057d queue.3: Document CIRCLEQ_* macros
I run ``sudo make`` and then visualized the man page with
``man 3 queue``, and the contents looked good.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-24 08:50:23 +02:00
Jonathan Wakely c4c038c9dd strtod.3: Fix return value for underflow
In C89 strtod returns zero on underflow, but since C99 it can return
non-zero. This means the strtod.3 page contradicts all recent C and
POSIX standards. Both C and POSIX say "smallest normalized positive
number", but for consistency with HUGE_VAL, HUGE_VALF and HUGE_VALL
this patch uses the constants for those numbers.

Also slightly improve the presentation of return values for overflow.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 20:03:04 +02:00
Jonathan Wakely 400c2265a2 printf.3: Fix description of %a hexfloat output
The description of hexadecimal floating-point output is missing a
character describing the exponent. The guarantee of at least one digit
in the exponent is present in both C99 and POSIX.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 20:02:51 +02:00
Michael Kerrisk f15ff6fa4e seccomp.2: EXAMPLES: use SECCOMP_RET_KILL_PROCESS rather than SECCOMP_RET_KILL
See previous commit.

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 19:23:46 +02:00
Michael Kerrisk 6b0c25f101 seccomp.2: Warn against the use of SECCOMP_RET_KILL_THREAD
Killing a thread with SECCOMP_RET_KILL_THREAD is very likely
to leave the rest of the process in a broken state.

Wording pretty much taken from Rick Felker's suggestion.

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 19:23:46 +02:00
Steve Hilder cbcd119573 capabilities.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-22 22:24:02 +02:00
Michael Kerrisk 7b203a3d6d bpf-helpers.7: Resync with current kernel source
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-22 13:28:09 +02:00
Thomas Piekarski e00e18a247 cgroups.7: wfix
Removing repeated word "the"

Signed-off-by: Thomas Piekarski <t.piekarski@deloquencia.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-22 10:16:39 +02:00
Thomas Piekarski b754b41430 time_namespaces.7: wfix
Removing repeated word "the"

Signed-off-by: Thomas Piekarski <t.piekarski@deloquencia.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-22 10:16:23 +02:00
Michael Kerrisk 750fda980b Start of man-pages-5.09: updating Changes and Changes.old 2020-08-13 13:49:52 +02:00
Michael Kerrisk f9d68d8a7e Start of man-pages-5.09: updating .Announce and .lsm files 2020-08-13 13:49:52 +02:00
Michael Kerrisk 88b8586b2d Start of man-pages-5.09: renaming .Announce and .lsm files 2020-08-13 13:49:52 +02:00
Michael Kerrisk 6762f6fb56 Ready for 5.08 2020-08-13 10:03:54 +02:00
Michael Kerrisk ed6c69cab9 intro.1, clock_getres.2, execve.2, fcntl.2, iopl.2, lseek.2, mknod.2, mmap.2, mount.2, mq_getsetattr.2, pidfd_open.2, prctl.2, setns.2, sgetmask.2, sigaction.2, stat.2, statx.2, sync.2, syscalls.2, syslog.2, timerfd_create.2, umask.2, a64l.3, aio_init.3, atoi.3, dladdr.3, fread.3, getpt.3, isfdtype.3, malloc_stats.3, malloc_trim.3, mkfifo.3, mq_close.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, posix_memalign.3, posix_openpt.3, pthread_atfork.3, pthread_rwlockattr_setkind_np.3, regex.3, scanf.3, sem_close.3, sem_destroy.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sigset.3, sigvec.3, strftime.3, termios.3, console_codes.4, dsp56k.4, fd.4, lp.4, mouse.4, pts.4, sk98lin.4, dir_colors.5, proc.5, resolv.conf.5, termcap.5, utmp.5, aio.7, armscii-8.7, arp.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.7, environ.7, glob.7, inode.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, keyrings.7, koi8-r.7, koi8-u.7, mailaddr.7, man-pages.7, netdevice.7, operator.7, persistent-keyring.7, process-keyring.7, pthreads.7, pty.7, raw.7, regex.7, session-keyring.7, shm_overview.7, signal.7, socket.7, suffixes.7, thread-keyring.7, unicode.7, units.7, uri.7, user-keyring.7, user-session-keyring.7, iconvconfig.8, ld.so.8, zic.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 10:01:14 +02:00
Michael Kerrisk 6743dc4434 Changes: Ready for 5.08
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 09:55:59 +02:00
Mike Frysinger b4c38a723f drop "coding: UTF-8" header
This header is used inconsistently -- man pages are UTF-8 encoded
but not setting this marker.  It's only respected by the man-db
package, and seems a bit anachronistic at this point when UTF-8
is the standard default nowadays.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 09:36:46 +02:00
Alejandro Colomar 1d2e2ecda7 queue.3: Remove wrong code from example
There was code containing ``CIRCLEQ_*`` in the examples for ``TAILQ_*``.  It was introduced by accident in commit ``041abbe``.

From 0c9dfbe9b1ce1130e9a92d1a16fbecd4a08bbe29 Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <colomar.6.4.3@gmail.com>
Date: Wed, 12 Aug 2020 09:11:27 +0200
Subject: [PATCH] queue.3: Remove wrong code from example

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 09:27:07 +02:00
Michael Kerrisk cc863b39dd man-pages.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 12:35:22 +02:00
Michael Kerrisk 17b015b53e man-pages.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 12:34:42 +02:00
Michael Kerrisk 4fba3f2aa8 man-pages.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 12:33:20 +02:00
Michael Kerrisk 1884339410 man-pages.7: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 10:27:38 +02:00
Michael Kerrisk 5daacbdbcc man-pages.7: Add some notes on generating optimal glyphs
Getting nice renderings of ^ ` and ~ requires special
steps in the page source.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 10:27:38 +02:00
Michael Kerrisk 9ca13180d5 pldd.1, bpf.2, execve.2, futex.2, ioctl_fat.2, ioctl_tty.2, keyctl.2, signalfd.2, timerfd_create.2, __ppc_get_timebase.3, a64l.3, frexp.3, pthread_setname_np.3, regex.3, rpmatch.3, scanf.3, strfmon.3, strftime.3, termios.3, console_codes.4, vcs.4, veth.4, core.5, dir_colors.5, termcap.5, ascii.7, charsets.7, glob.7, man-pages.7, operator.7, regex.7, user_namespaces.7, zic.8: Use "\(ha" rather than "^" in code
This renders better in PDF.

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 10:22:22 +02:00
Michael Kerrisk 7b97eb9ff0 glob.7, zic.8: Use \` rather than `
\` produces better rendering in PDF.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 10:22:19 +02:00
Michael Kerrisk b7ee1a369d strftime.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:17 +02:00
Michael Kerrisk be266c07cb assert.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:17 +02:00
Michael Kerrisk af2d18b2c2 intro.1, clock_getres.2, clone.2, futex.2, ioctl_fat.2, mkdir.2, mknod.2, mmap.2, open.2, statx.2, umask.2, userfaultfd.2, glob.3, mkfifo.3, termios.3, wordexp.3, console_codes.4, sk98lin.4, vcs.4, dir_colors.5, hosts.equiv.5, proc.5, termcap.5, utmp.5, ascii.7, bpf-helpers.7, charsets.7, environ.7, glob.7, mailaddr.7, netlink.7, operator.7, suffixes.7, tcp.7, unicode.7, uri.7, zic.8: Use "\(ti" instead of "~"
A naked tilde ("~") renders poorly in PDF. Instead use "\(ti",
which renders better in a PDF, and produces the same glyph
when rendering on a terminal.

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:11 +02:00
Michael Kerrisk 18f49d7563 math_error.7: tfix
Reported-by: John Scott <jscott@posteo.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-04 21:08:06 +02:00
Alejandro Colomar 6253e7d6ec queue.3: Comment out text for functions not in glibc (related: 6559169cac)
===========
DESCRIPTION
===========

I'm documenting ``CIRCLEQ_*`` macros in queue.3.  While writing
this, I noticed that the documentation for some types of
queues/lists talked about swapping contents of two lists, but only
for some of them.  I then found that those macros (``*_SWAP``)
don't exist in my system (Debian), but exist in BSD, and I also
found that a previous commit (6559169cac) commented out a lot of
the *_SWAP macros documentation, but not all, and the reason was
that they were not present on glibc.

I checked that I didn't have any of the *_SWAP macros on my glibc,
so I think this is probably that the commit simply forgot to
comment some of
them.

=======
TESTING
=======

I did ``sudo make`` and then visualized the man page with
``man 3 queue``, and the changes looked good.

I also noticed that the subsection ``Tail queue example`` contents
were wrong, as they contained calls to CIRCLEQ_* macros.  I will
address that in a future patch, before I submit the patch
documenting CIRCLEQ_*.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-04 14:48:03 +02:00
Michael Kerrisk 0629df8b96 open.2, proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-31 22:32:59 +02:00