Commit Graph

6948 Commits

Author SHA1 Message Date
Michael Kerrisk cc4423f732 j0.3, strerror.3, y0.3: wspfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05 11:01:22 +01:00
Michael Kerrisk 58a6844d20 brk.2, chmod.2, gethostname.2, setpgid.2, wait4.2, atoi.3, fwide.3, getlogin.3, printf.3, strtoul.3, wprintf.3: Consistency fix-up in FTMs
Generally, place '||' at start of a line, rather than the end of
the previous line.

Rationale: this placement clearly indicates that that each piece
is an alternative.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05 11:01:22 +01:00
Michael Kerrisk 16fe373c85 qecvt.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05 11:01:22 +01:00
Michael Kerrisk b15b92a585 fsync.2, gethostname.2, stat.2, getutent.3: Minor consistency clean-ups in FTMs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05 11:01:22 +01:00
Michael Kerrisk 9d2adbae20 Various pages: Simplify mark-up for Feature Test Macro requirements
Different source styles are used in different pages to achieve the
same formatted output, and in some cases the source mark-up is a
rather convoluted combination of .RS/.RE/.TP/.PD macros. Simplify
this greatly, and unify all of the pages to use more or less the
same source code style. This makes the source code rather easier
to read, and may simplify future scripted global changes.

The feature test macro info is currently bracketed by .nf/.fi
pairs. This is not strictly necessary (i.e., it makes no
difference to the rendered output), but for the moment we keep
these "brackets" in case they may be replaced with something else.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-05 11:01:01 +01:00
Michael Kerrisk 1a412fc5cb gethostid.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 16:27:45 +01:00
Michael Kerrisk e36f10f91d Various pages: replace '.ad b' macro with '.ad'
Verified no change in rendered output

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 16:25:50 +01:00
Michael Kerrisk 3d614fb849 clock_getres.2, atan2.3, ctime.3, getcwd.3, isgreater.3, iswblank.3, scalbln.3: ffix
Consistently use 4-space indents for FTMs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 15:55:20 +01:00
Michael Kerrisk 255d42333e chroot.2, rename.2, getgrent.3, nextafter.3, ttyslot.3, wprintf.3: ffix
Bring a bit more consistency to the layout of FTMs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 15:47:04 +01:00
Michael Kerrisk c418bc9d16 grantpt.3, ptsname.3, unlockpt.3: Remove mention of _XOPEN_SOURCE_EXTENDED FTM
This rather ancient FTM is not mentioned in other pages for
reasons discussed in feature_test_macros(7).  Remove this FTM
from the three pages where it does appear.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 15:47:04 +01:00
Michael Kerrisk db198f06a8 nice.2, putenv.3, strtok.3, toascii.3, tzset.3: ffix
Where FTM requirements span multiple lines, start the FTMs on
a new line.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 15:19:02 +01:00
Michael Kerrisk 3754620f0e getpagesize.2, getdtablesize.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 15:10:10 +01:00
Michael Kerrisk 028350ffb8 exec.3: tfix
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 14:29:59 +01:00
Michael Kerrisk 10afe9f58d malloc_hook.3: tfix
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 14:29:56 +01:00
Michael Kerrisk 2bb103326f ecvt.3, gcvt.3: Update FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 14:10:59 +01:00
Michael Kerrisk 9e8a25d700 getpagesize.2, getdtablesize.3: Update/correct FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 12:13:37 +01:00
Michael Kerrisk 49b843f53a gethostid.3: Update FTM requirements for gethostid()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 11:55:58 +01:00
Michael Kerrisk 51a6f93d71 wait.2, getaddrinfo.3, getnameinfo.3: ffix: Bring greater consistency to FTM layout
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 10:10:05 +01:00
Michael Kerrisk b1a4a24634 qecvt.3: Update feature test macro requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 09:34:08 +01:00
Michael Kerrisk 4653ec6ef2 Various pages: Use .nf/.fi in SYNOPSIS
Fix various pages missed in commit
c7db92b96a.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 09:34:08 +01:00
Michael Kerrisk e3528453c0 getutent.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 08:54:44 +01:00
Michael Kerrisk fe05d0458e bsd_signal.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 08:53:50 +01:00
Michael Kerrisk 464ba16d1e scandir.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-04 08:48:01 +01:00
Michael Kerrisk 5b72a11386 string.3: tfix
Reported-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03 20:50:04 +01:00
Michael Kerrisk 05d13bfb42 string.3: SEE ALSO: add bstring(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03 13:10:04 +01:00
Michael Kerrisk 28f288d395 bstring.3: SEE ALSO: add string(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03 13:10:04 +01:00
Michael Kerrisk c7db92b96a Various pages: Use .nf/.fi in SYNOPSIS
The majority of pages use .nf/.fi in SYNOPSIS, but there are
still many that don't and use .br to achieve newlines. Fix many
of those. This brings greater consistency to the pages, which
eases editing and may ease future scripted edits to the pages.

Many of these changes were script-assisted, with some additional
manual edits.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03 13:09:47 +01:00
Michael Kerrisk 511bb71b0c Various pages: Further clean-ups after "bring more whitespace consistency in SYNOPSIS"
Yet more clean-ups after commit
15d6565317.

Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-03 13:09:36 +01:00
Michael Kerrisk ff21c173ea wordexp.3: ffix
Reported-by: "Alejandro Colomar" <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-02 20:57:59 +01:00
Alejandro Colomar 771aecbeff Various pages: Consistently use 'unsigned int'
Most pages use 'unsigned int' (and the kernel too).
Make them all do so.

$ find man? -type f \
  | xargs sed -i \
	-e 's/unsigned \*/unsigned int */g'
	-e 's/unsigned "/unsigned int "/g';

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-02 08:31:43 +01:00
Michael Kerrisk e878a2de3e get_phys_pages.3: Minor relocation of text
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01 23:38:00 +01:00
Alejandro Colomar 984126f454 off64_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01 23:31:50 +01:00
Michael Kerrisk 7b5d39f48f Various pages: clean-ups after "bring more whitespace consistency in SYNOPSIS"
Cleann-ups after commit 15d6565317.

Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01 23:28:14 +01:00
Michael Kerrisk 15d6565317 Various pages: bring more whitespace consistency in SYNOPSIS
The use of vertical white space in the SYNOPSIS sections
is rather inconsistent. Make it more consistent, subject to the
following heuristics:

* Prefer no blank lines between function signatures by default.
* Where many functions are defined in the SYNOPSIS, add blank
  lines where needed to improve readability, possibly by using
  blank lines to separate logical groups of functions.

Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01 12:40:22 +01:00
Michael Kerrisk 742694e926 gethostbyname.3: Move mention of <sys/socket.h> from SYNOPSIS to DESCRIPTION
The functions are all declared in <netdb.h>. <sys/socket.h> is only
needed for the AF_* constants.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-01 12:26:47 +01:00
Michael Kerrisk 460aeeb46d puts.3: Reorder functions more logically (group related fuinctions together)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 23:38:02 +01:00
Michael Kerrisk cbd813e73c getdirentries.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 22:50:57 +01:00
Michael Kerrisk d4f9c56ac5 drand48.3: tfix (Oxford comma)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 21:19:28 +01:00
Michael Kerrisk 1210ac324b dl_iterate_phdr.3: wsppfix
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 21:16:41 +01:00
Michael Kerrisk 9834f61da2 wait4.2, endian.3, isalpha.3, unlocked_stdio.3: Minor consistency fix for Feature Test Macro info
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 11:05:26 +01:00
Michael Kerrisk ea40ab1199 strsignal.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 11:05:26 +01:00
Michael Kerrisk 7d8d2f0941 Various pages: s/Glibc versions </Glibc </ in Feature Test Macro discussions
Use a more compact notation that will render less wide
on the terminal.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 11:05:22 +01:00
Michael Kerrisk 38c1dbe910 pread.2, rename.2, syscall.2, utimensat.2, gethostid.3, rcmd.3, seekdir.3, setnetgrent.3, strerror.3, strsignal.3: ffix: Various tweaks for greater consistency in Feature Test Macros
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 10:48:51 +01:00
Michael Kerrisk 0129eef26c chown.2, ffs.3, fpclassify.3, gamma.3, getgrent.3, ilogb.3, strdup.3: ffix
Bring a bit more consistency to Feature Test Macro information
(mainly .PP between differnt FTM lists).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 10:27:24 +01:00
Michael Kerrisk 98c9347c15 Various pages: Formatting fix
Use .PP (which gives a bit of vertical white space) rather than
.br to separate functions in Feature Test Macro requirement lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 09:55:48 +01:00
Michael Kerrisk 1faebd253c Various pages: srcfix: remove redundant .br
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 09:55:48 +01:00
Alejandro Colomar a6f73f75e6 get_phys_pages.3: glibc gets the info from sysinfo(2) since 2.23
See glibc's commit: 0ce657c576bf1b24
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=0ce657c576bf1b24

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-31 09:18:04 +01:00
Jakub Wilk 704b5ab54c ftime.3: 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>
2020-12-30 09:30:17 +01:00
Michael Kerrisk 312b0eb182 userfaultfd.2, posix_spawn.3: srcfix: remove redundant .PP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-27 12:40:30 +01:00
Michael Kerrisk 0421538981 pthread_mutexattr_setrobust.3: wfix: remove redundant comments
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-27 12:40:30 +01:00
Michael Kerrisk 46b20ca1bb ioctl_ns.2, keyctl.2, memfd_create.2, pidfd_send_signal.2, poll.2, seccomp.2, signalfd.2, timerfd_create.2, unshare.2, dlinfo.3, duplocale.3, fopencookie.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, insque.3, printf.3, pthread_attr_init.3, pthread_cancel.3, pthread_create.3, pthread_mutexattr_setrobust.3, pthread_setaffinity_np.3, qsort.3, sem_wait.3, core.5, elf.5, aio.7, epoll.7, pkeys.7, system_data_types.7, unix.7: Use periods more consistently inside code comments
In general, complete sentences in free-standing comments
should be terminated by periods.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-27 12:32:44 +01:00
Michael Kerrisk c6beb8a167 bind.2, clone.2, dup.2, futex.2, mprotect.2, open_by_handle_at.2, pivot_root.2, select_tut.2, shmop.2, timer_create.2, userfaultfd.2, getaddrinfo.3, getaddrinfo_a.3, inet_net_pton.3, malloc_info.3, mbstowcs.3, newlocale.3, posix_spawn.3, pthread_sigmask.3, shm_open.3, strtol.3, inotify.7, user_namespaces.7: Add periods at end of sentences in comments
Try to bring a little more consistency on the use of periods
in comments in example code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-27 12:32:44 +01:00
Michael Kerrisk 1297239d41 slist.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-23 14:24:43 +01:00
Michael Kerrisk c5127de6ff stailq.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-23 14:23:39 +01:00
Michael Kerrisk f52cb55283 list.3, slist.3, stailq.3, tailq.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-23 14:20:50 +01:00
Michael Kerrisk c2e81ff964 seccomp.2, circleq.3, list.3, malloc_hook.3, slist.3, stailq.3, tailq.3, ip.7, unix.7: tfix
Remove "." at the end of sentence fragments/short single sentences
in comments.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-23 14:17:30 +01:00
Alejandro Colomar eaa18d3c44 Various pages: Remove explicit blank lines, replacing them with .PP when appropriate
Rationale:
$ man 7 man-pages 2>/dev/null | sed -n /Paragraphs/,/^$/p
       Paragraphs should be separated by suitable markers (usually
       either .PP or .IP).  Do not separate paragraphs using blank
       lines,  as  this  results  in poor rendering in some output
       formats (such as PostScript and PDF).

Fix:
$ sed -i -e '1,/^\.EX/s/^$/.PP/' -e '/^\.EE/,/^\.EX/s/^$/.PP/' man?/*

And then some manual adjustments.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-23 13:19:10 +01:00
Michael Kerrisk fbe926ebdf mallinfo2.3: New link to mallinfo(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:08:09 +01:00
Michael Kerrisk e9e534537d mallinfo.3: Update example program to use mallinfo2()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:08:09 +01:00
Michael Kerrisk 5bf7268349 mallinfo.3: Document mallinfo2() and note that mallinfo() is deprecated
Document the mallinfo2() function added in glibc 2.33.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:08:09 +01:00
Michael Kerrisk 37fac7c6b2 ftime.3: glibc 2.33 has removed ftime()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:08:09 +01:00
Michael Kerrisk 5ebc9e0a0a pthread_attr_setsigmask_np.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:00:09 +01:00
Michael Kerrisk 0c9ab4fcb7 nl_langinfo.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:00:09 +01:00
Michael Kerrisk 15974546a2 isfdtype.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:00:09 +01:00
Michael Kerrisk 46ab01a33a aio_suspend.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-22 12:00:09 +01:00
Michael Kerrisk 9f43659f85 getent.1, access.2, cacheflush.2, chroot.2, clock_getres.2, fcntl.2, getrusage.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, link.2, llseek.2, mmap.2, mount.2, readv.2, restart_syscall.2, semctl.2, set_mempolicy.2, set_tid_address.2, shmctl.2, sigaction.2, sigaltstack.2, spu_create.2, statfs.2, subpage_prot.2, syscalls.2, timer_getoverrun.2, uselib.2, INFINITY.3, __ppc_set_ppr_med.3, bstring.3, btree.3, ctime.3, fgetc.3, fopen.3, getcontext.3, gethostbyname.3, getnetent.3, getprotoent.3, getservent.3, inet.3, j0.3, list.3, makecontext.3, nextafter.3, posix_memalign.3, profil.3, pthread_tryjoin_np.3, puts.3, rcmd.3, resolver.3, rtime.3, sigsetops.3, strnlen.3, tailq.3, elf.5, filesystems.5, nscd.conf.5, proc.5, utmp.5, attributes.7, ipv6.7, packet.7, pthreads.7, signal-safety.7, signal.7, spufs.7, system_data_types.7, tcp.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-21 16:19:35 +01:00
Michael Kerrisk fd39178d4a rcmd.3: SEE ALSO: remove intro(2)
There's no reason to link to intro(2)...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-21 10:36:39 +01:00
Michael Kerrisk 5b2ab95fed regex.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 12:01:36 +01:00
Michael Kerrisk 87e8e9e479 pthread_attr_setguardsize.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 12:00:42 +01:00
Michael Kerrisk 8c20c31ad1 pthread_attr_setstacksize.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 12:00:12 +01:00
Michael Kerrisk 6a5f3c599c pthread_mutexattr_setrobust.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 11:58:53 +01:00
Michael Kerrisk 7f3c0a5fcb pthread_attr_setstackaddr.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 11:56:47 +01:00
Michael Kerrisk 3bf920615d pthread_attr_setdetachstate.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-20 11:56:07 +01:00
John A. Leuenhagen c93376e8ba strtol.3: tfix
Signed-off-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-15 10:23:33 +01:00
Michael Kerrisk b5dae39596 modf.3: tfix
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976312

Reported-by: Bill Allombert <ballombe@debian.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-03 10:47:48 +01:00
Michael Kerrisk 45323bbef7 strnlen.3: Fix a small inconsistency in the text
Quoting Heinrich:

    The strnlen.3 manpage has the following sentence:

    "In doing this, strnlen() looks only at the first maxlen
    characters in the string pointed to by s and never beyond
    s+maxlen."

    This sentence is self-contradictory:

    The last visited character implied by "first maxlen
    characters" is s[maxlen-1].

    Given that "beyond a" does not include "a", the last visited
    character implied by "never beyond s+maxlen" is s[maxlen].

    A consistent sentence would be

    "In doing this, strnlen() looks only at the first maxlen
    characters in the string pointed to by s and never beyond
    s+maxlen-1."

    I would prefer

    "In doing this, strnlen() looks only at the first maxlen
    characters in the string pointed to by s and never beyond
    s[maxlen-1]"

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-28 10:00:23 +01:00
Michael Kerrisk 9bc4ab60e6 lseek64.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 13:28:12 +01:00
Michael Kerrisk 6c9fd46b05 pthread_tryjoin_np.3: Note that pthread_timedjoin_np() uses CLOCK_REALTIME, but there's a bug
Learned from an email converasation with Mike Crowe, and
verified by experiment.

Reported-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 10:32:03 +01:00
Michael Kerrisk e0b19c5b50 lseek64.3: NOTES: describe the origin of lseek64() in LFS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 10:01:25 +01:00
Michael Kerrisk 83f0bca3b1 lseek64.3: Remove sentence saying lseek64() is an alias for llseek()
As far as I can see, it is instead simply an alias for a
wrapper that calls _llseek(). Saying it's an alias for "llseek()"
seems confusing.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 09:42:00 +01:00
Michael Kerrisk 50f5ae5389 lseek64.3: Remove section numbers from interface list
We're talking of a mix of wrapper functions and system calls
in this page. lseek() is both a system and a wrapper function,
and this page is mostly describing the wrapper

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 09:32:38 +01:00
Michael Kerrisk 522c24f1cb lseek64.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 09:31:01 +01:00
Michael Kerrisk 8369c0f737 lseek64.3: Minor clarifications
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 09:24:56 +01:00
Michael Kerrisk 90f1c92fd3 lseek64.3: srcfix: add some comments to remind myself of some details
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 07:26:52 +01:00
Michael Kerrisk eca874e183 lseek64.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 07:08:12 +01:00
Michael Kerrisk 62d506c7a2 getnameinfo.3: tfix
Reported-by: Sebastian Kirmayer <man-pages@kirmayer.eu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 06:54:02 +01:00
Michael Kerrisk 1876c40aed lseek64.3: srcfix: Add a lore link to some background on these APIs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 00:00:24 +01:00
Michael Kerrisk 5ef9b068ec getnameinfo.3: tfix
Reported-by: Sebastian Kirmayer <sebastian@kirmayer.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-22 23:56:03 +01:00
Alejandro Colomar e7ff75357d capget.2, execve.2, readv.2, socketpair.2, utime.2, utimensat.2, getloadavg.3, proc.5, mount_namespaces.7, unix.7: ffix
{.IR var [x]} -> {.I var[x]}

There were around 15 entries of the former,
and around 360 of the latter.

Found using:
$ grep -rn '^\.I[ |R].* \[.*\]' |sort

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-21 23:33:07 +01:00
Michael Kerrisk 6430ba7a90 makecontext.3: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-17 13:12:18 +01:00
Michael Kerrisk e7a5700f23 getcontext.3, signal.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-17 09:55:02 +01:00
Michael Kerrisk 3a38254934 getcontext.3: SEE ALSO: add signal(7)
The signal(7) manual page has some useful info related
to ucontext_t.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-17 09:53:34 +01:00
Michael Kerrisk 2f29697700 getcontext.3: Mention SA_SIGINFO flag when talking about 3-argument signal handler
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 21:57:48 +01:00
Michael Kerrisk 1680bd6e73 getcontext.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 21:57:48 +01:00
Michael Kerrisk ebf47ac9da uselib.2, posix_memalign.3, profil.3, rtime.3: Remove some text about libc/libc5
With this change, there remain almost no vestiges of information
about the long defunct Linux libc.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 12:29:42 +01:00
Michael Kerrisk d678063436 ioctl_tty.2, matherr.3, cciss.4, sk98lin.4: ffix: use proper table for formatting, not .nf/.fi
This gives better PDF rendering.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 11:26:23 +01:00
Michael Kerrisk 67bc5d49be scandir.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 11:26:23 +01:00
Michael Kerrisk fdf5dbe784 nextafter.3: Remove duplicate "BUGS" section heading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:23:00 +01:00
Michael Kerrisk af8d2ec2c1 CIRCLEQ_EMPTY.3, CIRCLEQ_FIRST.3, CIRCLEQ_FOREACH.3, CIRCLEQ_FOREACH_REVERSE.3, CIRCLEQ_HEAD_INITIALIZER.3, CIRCLEQ_LAST.3, CIRCLEQ_LOOP_NEXT.3, CIRCLEQ_LOOP_PREV.3, CIRCLEQ_NEXT.3, CIRCLEQ_PREV.3: Add missing links to circleq.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:23:00 +01:00
Michael Kerrisk 3112110398 list.3: NAME: remove LIST_PREV, which is not documented in this page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:23:00 +01:00
Michael Kerrisk 4f6d0749d0 pthread_attr_getsigmask_np.3: New link to pthread_attr_setsigmask_np.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:23:00 +01:00
Michael Kerrisk 7a92eea0de chroot.2, memfd_create.2, tailq.3: Fix unbalanced .nf/.fi
Reported-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 23:33:33 +01:00
Michael Kerrisk 2ec12d3f32 getutent.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 22:30:02 +01:00
Alejandro Colomar d556548bf4 getent.1, fanotify_mark.2, fcntl.2, futex.2, membarrier.2, mmap.2, mount.2, msgctl.2, readv.2, semctl.2, set_mempolicy.2, shmctl.2, syscalls.2, abs.3, bstring.3, btree.3, ctime.3, drand48.3, fgetc.3, fopen.3, gethostbyname.3, getnetent.3, getprotoent.3, getservent.3, INFINITY.3, __ppc_set_ppr_med.3, inet.3, j0.3, makecontext.3, printf.3, puts.3, resolver.3, sigsetops.3, elf.5, nscd.conf.5, proc.5, inotify.7, ipv6.7, spufs.7, system_data_types.7: Use Oxford comma
Found using:
pcregrep -rnM "^\.[B|I]R .*,\n\.[B|I].*[^,]\nand" man? |grep ^man |sort

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 21:30:30 +01:00
Alejandro Colomar 73cf5b8390 strerror.3: tfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-05 10:50:54 +01:00
Michael Kerrisk 2b851e6ffd errno.3: Note another possible cause of the EMFILE error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-02 13:15:37 +01:00
Michael Kerrisk 3fde8c2e45 memusage.1, pldd.1, sprof.1, add_key.2, bind.2, bpf.2, clone.2, dup.2, epoll_ctl.2, eventfd.2, fanotify_init.2, fanotify_mark.2, futex.2, getdents.2, getpid.2, getrlimit.2, intro.2, ioctl_fat.2, ioctl_ns.2, kcmp.2, keyctl.2, membarrier.2, memfd_create.2, mprotect.2, msgctl.2, msgop.2, nfsservctl.2, open.2, open_by_handle_at.2, openat2.2, outb.2, perf_event_open.2, pivot_root.2, recv.2, recvmmsg.2, request_key.2, sched_setaffinity.2, sched_setattr.2, seccomp.2, select.2, send.2, signalfd.2, spu_run.2, sysctl.2, timer_create.2, userfaultfd.2, wait.2, CPU_SET.3, abs.3, argz_add.3, backtrace.3, bsearch.3, bswap.3, clock_getcpuclockid.3, cmsg.3, dl_iterate_phdr.3, dlinfo.3, dlopen.3, drand48.3, drand48_r.3, duplocale.3, encrypt.3, endian.3, envz_add.3, errno.3, ffs.3, fopencookie.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getline.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, hsearch.3, insque.3, intro.3, lrint.3, lround.3, lseek64.3, mallinfo.3, malloc_hook.3, malloc_info.3, mbsinit.3, mbstowcs.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, perror.3, posix_fallocate.3, posix_spawn.3, printf.3, psignal.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setname_np.3, pthread_sigmask.3, qsort.3, rand.3, random.3, rpc.3, rtnetlink.3, scalbln.3, shm_open.3, stdarg.3, strcat.3, strerror.3, strfmon.3, strptime.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, tsearch.3, wordexp.3, loop.4, vcs.4, veth.4, core.5, locale.5, slabinfo.5, cgroup_namespaces.7, cpuset.7, credentials.7, fanotify.7, feature_test_macros.7, inotify.7, ip.7, kernel_lockdown.7, man.7, mount_namespaces.7, namespaces.7, pid_namespaces.7, rtld-audit.7, sigevent.7, sock_diag.7, standards.7, unix.7, user_namespaces.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:56:08 +01:00
Michael Kerrisk 152ce70f53 pthread_attr_init.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:06:53 +01:00
Michael Kerrisk 706d4f73ae pthread_attr_init.3: SEE ALSO: add pthread_attr_init(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +01:00
Michael Kerrisk 96841f0e25 pthread_sigmask.3: SEE ALSO: add pthread_attr_setsigmask_np(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +01:00
Michael Kerrisk 340f4f9e7c pthread_attr_setsigmask_np.3: New page for pthread_attr_setsigmask_np() + pthread_attr_getsigmask_np()
Add a page documenting the pthread_attr_setsigmask_np(3) and
pthread_attr_getsigmask_np() functions added in glibc 2.32.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +01:00
Michael Kerrisk e9c09849cc dlopen.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-31 10:17:00 +01:00
Alejandro Colomar 93f369892a strtol.3: EXAMPLES: Simplify errno checking
(No expected change in behavior,)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:12:22 +01:00
Alejandro Colomar b924e6b65a strtol.3: EXAMPLES: As the default base, use special value 0
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:11:25 +01:00
Alejandro Colomar d01c330357 strtol.3: EXAMPLES: Delimit output string using ""
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:11:12 +01:00
Michael Kerrisk f36f4f855b strtol.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 07:01:01 +01:00
Michael Kerrisk b6a968bca7 strtol.3: srcfix: Add myself to copyright
I added the xample program in 2006, but omitted to add myself to the
copyright.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 20:00:23 +01:00
Michael Kerrisk 8573214f58 lseek64.3: Since glibc 2.28. the 'llseek' symbol is no longer available
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:08:18 +01:00
Michael Kerrisk 3af4e9733e posix_fallocate.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Érico Rolim d5ee3a149e posix_fallocate.3: add EOPNOTSUPP error code.
As can be seen in

https://git.musl-libc.org/cgit/musl/tree/src/fcntl/posix_fallocate.c?id=73cc775bee53300c7cf759f37580220b18ac13d3

musl libc returns the syscall's errors directly, which means it
doesn't perform the same emulation as glibc, and can return
EOPNOTSUPP to an application, which isn't listed in ERRORS.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Alejandro Colomar c5af3bfc1a dev_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 06:58:59 +01:00
Michael Kerrisk 43891c16ed argz_add.3, envz_add.3: Point out that 'error_t' is an integer type
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-26 17:13:33 +01:00
Michael Kerrisk 588b77dc9d argz_add.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-26 16:51:15 +01:00
Michael Kerrisk dd427377e2 argz_add.3, envz_add.3: Remove sentence that conveys no useful info
The sentence "Handle with care" in CONFORMING TO conveys no useful
information. Remove it.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-26 16:25:51 +01:00
Michael Kerrisk fd6f7ef2f7 argz_add.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-26 16:24:49 +01:00
Alejandro Colomar c89a843c28 stailq.3: SEE ALSO: Add insque(3), queue(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-26 06:49:31 +01:00
Alejandro Colomar 94964749a5 clockid_t: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 22:17:47 +01:00
Alejandro Colomar 083d4e6a47 circleq.3, insque.3, list.3, slist.3, tailq.3: SEE ALSO: queue(3) -> queue(7)
queue.3 has been moved to queue.7.

Fix SEE ALSO accordingly.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 22:17:28 +01:00
Alejandro Colomar 68fab1113e queue.3: Link to queue(7)
queue has been for so many years in Section 3,
and still is in Section 3 in most manuals.

For legacy reasons,
especially because hyperlinks to the online manual pages
would break otherwise,
a link queue.3 -> queue(7) is necessary.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 22:17:13 +01:00
Alejandro Colomar d9a0505f71 queue.3, queue.7: Move queue.3 to queue.7
After forking slist.3, list.3, tailq.3, stailq.3 & circleq.3
in the previous commits,
this page no longer belongs in Section 3 of the manual pages.

According to its contents, the most suitable section is Section 7.

Because of legacy reasons, a link queue.3 -> queue(7)
would be appropriate.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 22:17:05 +01:00
Michael Kerrisk 11fd5e7c2a membarrier.2, openat2.2, insque.3, proc.5, tzfile.5, hier.7: Minor grammar fix
Don't hyphenate after adjective ending in "ly". See, for example:
https://www.dragoman.ist/compound-modifiers-with-words-ending-in-ly/
https://www.merriam-webster.com/words-at-play/6-common-hypercorrections-and-how-to-avoid-them/between-you-and-i

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 13:12:57 +01:00
Dmitry V. Levin ba273524e7 tailq.3: tfix
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 13:07:43 +01:00
Michael Kerrisk 9484d926ff stailq.3, tailq.3: Minor fix: replace ".Ss" lines with ".PP"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:31:25 +01:00
Michael Kerrisk df10ec359a circleq.3, list.3, queue.3, slist.3, stailq.3, tailq.3: Minor grammar fix
Don't hyphenate after adjective ending in "ly". See, for example:
https://www.dragoman.ist/compound-modifiers-with-words-ending-in-ly/
https://www.merriam-webster.com/words-at-play/6-common-hypercorrections-and-how-to-avoid-them/between-you-and-i

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:23:43 +01:00
Michael Kerrisk df1a46a560 circleq.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:19:44 +01:00
Alejandro Colomar 13e59b9684 circleq.3, list.3, slist.3, stailq.3, tailq.3: Use the 'struct' keyword when appropriate
This helps differentiate 'TYPE' in some arguments from
'struct TYPE *var' in others, and is technically more correct.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:15:47 +01:00
Michael Kerrisk d03e886304 queue.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:11:25 +01:00
Alejandro Colomar d43abf2771 queue.3: Fix & update after forking circleq.3, list.3, slist.3, stailq.3 & tailq.3
- ffix: Use man markup
- Remove specific notes about code size increase
  and execution time increase,
  as they were (at least) inaccurate.
  Instead, a generic note has been added.
- Structure the text into subsections.
- Remove sections that were empty after the forks.
- Clearly relate macro names (SLIST, TAILQ, ...)
  to a human readable name of which data structure
  they implement.

Reported-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:09:38 +01:00
Alejandro Colomar 90a60096ba queue.3: Add self to copyright notice
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 12:09:27 +01:00
Michael Kerrisk 3fe1b81c69 strerrorname_np.3: New link to strerror(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:58:01 +01:00
Michael Kerrisk a8556aef87 strerrordesc_np.3: New link to strerror(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:58:01 +01:00
Michael Kerrisk d2c55aa77d strerror.3: Document strerrorname_np() and strerrordesc_np()
strerrorname_np() and strerrordesc_np() were added in glibc 2.32.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:58:01 +01:00
Michael Kerrisk fddad21b8f sigdescr_np.3: New link to strsignal.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:48:31 +01:00
Michael Kerrisk 818c17af67 sigabbrev_np.3: New link to strsignal.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:48:31 +01:00
Michael Kerrisk 5dc64eddfd strsignal.3: Document sigabbrev_np() and sigdescr_np().
sigabbrev_np() and sigdescr_np() were added in glibc 2.32.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:48:31 +01:00
Alejandro Colomar bfc09cdd9a queue.3: SEE ALSO: Add tailq(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:56 +01:00
Alejandro Colomar ec1ce1f00e TAILQ_CONCAT.3, TAILQ_EMPTY.3, TAILQ_ENTRY.3, TAILQ_FIRST.3, TAILQ_FOREACH.3, TAILQ_FOREACH_REVERSE.3, TAILQ_HEAD.3, TAILQ_HEAD_INITIALIZER.3, TAILQ_INIT.3, TAILQ_INSERT_AFTER.3, TAILQ_INSERT_BEFORE.3, TAILQ_INSERT_HEAD.3, TAILQ_INSERT_TAIL.3, TAILQ_LAST.3, TAILQ_NEXT.3, TAILQ_PREV.3, TAILQ_REMOVE.3, TAILQ_SWAP.3: Link to the new tailq(3) page instead of queue(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:50 +01:00
Alejandro Colomar ec99c74df3 tailq.3: Add remaining details to complete the page
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:45 +01:00
Alejandro Colomar ace2899780 tailq.3: ffix: Use man markup
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:40 +01:00
Alejandro Colomar cf5b6a7745 tailq.3: Copy and adapt code from queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:35 +01:00
Alejandro Colomar 7b8d4bbf32 queue.3, tailq.3: EXAMPLES: Move code from queue.3 to tailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:31 +01:00
Alejandro Colomar 32d12807a8 queue.3, tailq.3: DESCRIPTION: Move code from queue.3 to tailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:26 +01:00
Alejandro Colomar af64b7276f queue.3, tailq.3: SYNOPSIS: Move code from queue.3 to tailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:21 +01:00
Alejandro Colomar f8f346bc7f queue.3, tailq.3: NAME: Move code from queue.3 to tailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:16 +01:00
Alejandro Colomar 1a5756108b tailq.3: New page that will hold the (tailq) contents of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:42:08 +01:00
Alejandro Colomar b1db934051 circleq.3, list.3, slist.3, stailq.3: Fix return type of macros
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 10:34:07 +01:00
Alejandro Colomar 9fed47b65d queue.3: SEE ALSO: Add stailq(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:52 +01:00
Alejandro Colomar 852fd77395 STAILQ_CONCAT.3, STAILQ_EMPTY.3, STAILQ_ENTRY.3, STAILQ_FIRST.3, STAILQ_FOREACH.3, STAILQ_HEAD.3, STAILQ_HEAD_INITIALIZER.3, STAILQ_INIT.3, STAILQ_INSERT_AFTER.3, STAILQ_INSERT_HEAD.3, STAILQ_INSERT_TAIL.3, STAILQ_NEXT.3, STAILQ_REMOVE.3, STAILQ_REMOVE_HEAD.3: Link to the new stailq(3) page instead of queue(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:45 +01:00
Alejandro Colomar 906766f590 stailq.3: Add remaining details to complete the page
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:38 +01:00
Alejandro Colomar 00ba3a085e stailq.3: ffix: Use man markup
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:33 +01:00
Alejandro Colomar fc89a378d6 stailq.3: Copy and adapt code from queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:28 +01:00
Alejandro Colomar d47b080534 queue.3, stailq.3: EXAMPLES: Move stailq example from queue.3 to stailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:22 +01:00
Alejandro Colomar cdba777fd5 queue.3, stailq.3: DESCRIPTION: Move stailq specific code from queue.3 to stailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:18 +01:00
Alejandro Colomar 17ef240dbf queue.3, stailq.3: SYNOPSIS: Move code from queue.3 to stailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:13 +01:00
Alejandro Colomar e029607481 queue.3, stailq.3: NAME: Move code from queue.3 to stailq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:08 +01:00
Alejandro Colomar 27f9e01adf stailq.3: New page that will hold the (stailq) contents of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:49:03 +01:00
Alejandro Colomar 8fe75257c6 circleq.3: ffix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:43:56 +01:00
Alejandro Colomar 14992403c8 queue.3: SEE ALSO: Add circleq(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:47 +02:00
Alejandro Colomar eadc4573fb CIRCLEQ_ENTRY.3, CIRCLEQ_HEAD.3, CIRCLEQ_INIT.3, CIRCLEQ_INSERT_AFTER.3, CIRCLEQ_INSERT_BEFORE.3, CIRCLEQ_INSERT_HEAD.3, CIRCLEQ_INSERT_TAIL.3, CIRCLEQ_REMOVE.3: Link to the new circleq(3) page instead of queue(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:35 +02:00
Alejandro Colomar ccb0db7f35 circleq.3: Add remaining details to complete the page
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:27 +02:00
Alejandro Colomar 086acf39f1 circleq.3: ffix: Use man markup
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:21 +02:00
Alejandro Colomar 0d1891f3b6 circleq.3: Copy and adapt code from queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:16 +02:00
Alejandro Colomar 68ed526e29 queue.3: ffix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:11 +02:00
Alejandro Colomar 8306d5cb87 circleq.3, queue.3: EXAMPLES: Move circleq example program from queue.3 to circleq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:06 +02:00
Alejandro Colomar 66bb7b4db4 circleq.3, queue.3: DESCRIPTION: Move circleq specific code from queue.3 to circleq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:13:00 +02:00
Alejandro Colomar 8ad9d90ccf circleq.3, queue.3: SYNOPSIS: Move code from queue.3 to circleq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:12:56 +02:00
Alejandro Colomar 90502e3efa circleq.3, queue.3: NAME: Move code from queue-3 to circleq.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:12:50 +02:00
Alejandro Colomar 151c1cffc5 circleq.3: New page that will hold the (circleq) content of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:12:44 +02:00
Alejandro Colomar 31e6e673b1 queue.3: Sort alphabetically
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:11:49 +02:00
Alejandro Colomar 20131a9b3b slist.3: tfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-23 18:10:57 +02:00
Alejandro Colomar fbe553e912 list.3: Sort alphabetically
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:46:42 +02:00
Michael Kerrisk a45701ef72 list.3, slist.3, strcmp.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:33:04 +02:00
Alejandro Colomar c49f19edef queue.3: SEE ALSO: Add slist(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:37 +02:00
Alejandro Colomar e988825f2c SLIST_EMPTY.3, SLIST_ENTRY.3, SLIST_FIRST.3, SLIST_FOREACH.3, SLIST_HEAD.3, SLIST_HEAD_INITIALIZER.3, SLIST_INIT.3, SLIST_INSERT_AFTER.3, SLIST_INSERT_HEAD.3, SLIST_NEXT.3, SLIST_REMOVE.3, SLIST_REMOVE_HEAD.3: Link to the new slist(3) page instead of queue(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:30 +02:00
Alejandro Colomar 22f12126de slist.3: Add details
Add remaining details to complete the page.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:24 +02:00
Alejandro Colomar bb8164dec0 slist.3: ffix: Use man markup
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:19 +02:00
Alejandro Colomar 6a1c4d6fc4 slist.3: Copy and adapt code from queue.3
A few fixes to note:

- Sorted alphabetically some macros
- ffix: remove alignment spaces in example (as in list.3)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:13 +02:00
Alejandro Colomar 21b0363fd0 queue.3, slist.3: EXAMPLES: Move example program from queue.3 to slist.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:31:07 +02:00
Alejandro Colomar 8d526f6322 queue.3, slist.3: DESCRIPTION: Move slist specific code from queue.3 to slist.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:30:54 +02:00
Alejandro Colomar 36eac952da queue.3, slist.3: SYNOPSIS: Move code from queue.3 to list.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:30:49 +02:00
Alejandro Colomar 96234e9ef8 queue.3, slist.3: NAME: Move code from queue.3 to slist.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:30:42 +02:00
Alejandro Colomar 9f2d647444 slist.3: New page that will hold the (slist) contents of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 19:30:35 +02:00
Michael Kerrisk d3f0057ec7 list.3: Minor fix to grammar
Fix a preexisting grammar issue in text taken from queue.3.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:49:54 +02:00
Michael Kerrisk 7e5e369998 list.3: Minor tweak's to Alex's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:48:03 +02:00
Michael Kerrisk c460d23963 list.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:42:08 +02:00
Michael Kerrisk ef4138a9f3 list.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:41:39 +02:00
Alejandro Colomar 4c95e2afae queue.3: SEE ALSO: Add list(3)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:58 +02:00
Alejandro Colomar b44784d752 LIST_EMPTY.3, LIST_ENTRY.3, LIST_FIRST.3, LIST_FOREACH.3, LIST_HEAD.3, LIST_HEAD_INITIALIZER.3, LIST_INIT.3, LIST_INSERT_AFTER.3, LIST_INSERT_BEFORE.3, LIST_INSERT_HEAD.3, LIST_NEXT.3, LIST_REMOVE.3: Link to the new list.3 page instead of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:52 +02:00
Alejandro Colomar ce6606e121 list.3: Add details
list.3: NAME: Add description
list.3: DESCRIPTION: Add short description
list.3: SEE ALSO: Add insque(3) and queue(3)
list.3: BUGS: Note LIST_FOREACH() limitations
list.3: RETURN VALUE: Add details about the return value of those macros that "return" a value

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:45 +02:00
Alejandro Colomar 87241f17f6 list.3: ffix: Use man markup
list.3: NAME: ffix: Use man markup
list.3: SYNOPSIS: ffix: Use man markup
list.3: DESCRIPTION: ffix: Use man markup
list.3: DESCRIPTION: ffix: Use man markup
list.3: CONFORMING TO: ffix: Use man markup
list.3: EXAMPLES: ffix: Use man markup

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:37 +02:00
Alejandro Colomar 481854f548 list.3: Copy and adapt code from queue.3
list.3: SYNOPSIS: Copy include from queue.3
list.3: DESCRIPTION: Copy description about naming of macros from queue.3
list.3: DESCRIPTION: Remove unrelated code to adapt to this page
list.3: DESCRIPTION: Remove lines pointing to the EXAMPLES
list.3: CONFORMING TO: Copy from queue.3
list.3: CONFORMING TO: Adapt to this page

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:27 +02:00
Alejandro Colomar be7973e6b1 list.3, queue.3: EXAMPLES: Move example program from queue.3 to list.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:20 +02:00
Alejandro Colomar 13514abe53 list.3, queue.3: DESCRIPTION: Move list specific code from queue.3 to list.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:12 +02:00
Alejandro Colomar 6ac2278707 list.3, queue.3: SYNOPSIS: Move code from queue.3 to list.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:35:04 +02:00
Alejandro Colomar 71b0fc4a75 list.3, queue.3: NAME: Move code from queue.3 to list.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:34:57 +02:00
Alejandro Colomar 815041a539 list.3: New page that will hold the (list) contents of queue.3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-21 06:34:47 +02:00
Alejandro Colomar 2b557a7dc7 clock_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-18 18:51:37 +02:00
Michael Kerrisk 185f4da527 mallinfo.3: srcfix: add comments noting errors in glibc info page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-17 18:49:48 +02:00
Michael Kerrisk 70fd3c08d3 mallinfo.3: The 'usmblks' is nowadays always 0
Verified from the course code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-17 18:49:48 +02:00
Alejandro Colomar 7e35a02866 regex.3: Add example program
$ gcc -Wall -Wextra -Werror -pedantic regex.c -o regex
$ ./regex.3
String = "1) John Driverhacker;
2) John Doe;
3) John Foo;
"
Matches:
#0:
offset = 25; length = 7
substring = "John Do"
#1:
offset = 38; length = 8
substring = "John Foo"

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-17 16:35:36 +02:00
Alejandro Colomar 740656b855 queue.3: stailq: Complete example
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-17 12:26:00 +02:00
Alejandro Colomar 7ef4fb8fcf queue.3: list: Complete example
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-15 20:49:50 +02:00
Michael Kerrisk 025584732f regex.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-14 18:39:09 +02:00
Alejandro Colomar 4f2f24ff13 regex.3: wfix
The wording was incorrect:

It stated that 'eflags' may be the OR of one or two of those two flags,
but then a third flag was documented
(which according to the previous wording could not be used?!).
Moreover, the wording also disallowed using 0 (i.e., no flags at all),
which POSIX specifically allows;
I tested the function with no flags and it worked fine for me,
so I guess it was a problem with the documentation,
and not with the implementation itself.

POSIX ref: https://pubs.opengroup.org/onlinepubs/9699919799/

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-14 18:37:33 +02:00
Alejandro Colomar 46b0a9d69c queue.3: circleq: Complete example
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-13 17:36:17 +02:00
Michael Kerrisk 92e4056a29 strsignal.3: Further addition on version range for sys_siglist
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 18:04:29 +02:00
Michael Kerrisk d5e7276516 perror.3: sys_errlist and sys_nerr are no longer exposed by <stdio.h>
The change came with the release of glibc 2.32.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 18:04:17 +02:00
Alejandro Colomar 5158e8ee72 queue.3: slist: Complete example
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 18:04:17 +02:00
Alejandro Colomar b3617b75f9 queue.3: Replace incomplete example by a complete example
I added the EXAMPLES section.
The examples in this page are incomplete
(you can't copy&paste&compile&run).
I fixed the one about TAILQ first,
and the rest should follow.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 14:22:20 +02:00
Alejandro Colomar 8e3a414354 regex_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 14:21:58 +02:00
Alejandro Colomar 71030dbdd2 regex.3: Remove unnecessary include
POSIX requires that the <regex.h> header shall define
the structures and symbolic constants used by the
regcomp(),  regexec(), regerror(), and regfree() functions.

Therefore, there should be no need to include <sys/types.h>
at all.

The POSIX docs don't use that include:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-11 07:38:41 +02:00
Alejandro Colomar 0de1c1dda3 off_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-07 08:45:22 +02:00
Alejandro Colomar 875d83cb57 Revert [u]int_*astN_t commits
Revert "uint_least8_t.3, uint_least16_t.3, uint_least32_t.3, uint_least64_t.3, uint_leastN_t.3: New links to system_data_types(7)"
This reverts commit a5d13a32b7.

Revert "system_data_types.7: Add uint_leastN_t family of types"
This reverts commit 3450a5621e.

Revert "int_least8_t.3, int_least16_t.3, int_least32_t.3, int_least64_t.3, int_leastN_t.3: New links to system_data_types(7)"
This reverts commit 876838354d.

Revert "system_data_types.7: Add int_leastN_t family of types"
This reverts commit f9b54d3a2e.

Revert "uint_fast8_t.3, uint_fast16_t.3, uint_fast32_t.3, uint_fast64_t.3, uint_fastN_t.3: New links to system_data_types(7)"
This reverts commit 496b1aad79.

Revert "system_data_types.7: Add uint_fastN_t family of types"
This reverts commit 3c9ae6e5a2.

Revert "int_fast8_t.3, int_fast16_t.3, int_fast32_t.3, int_fast64_t.3, int_fastN_t.3: New links to system_data_types(7)"
This reverts commit 9df81a23e5.

Revert "system_data_types.7: Add int_fastN_t family of types"
This reverts commit 8f12d3f683.

Reported-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-03 13:44:58 +02:00
Alejandro Colomar 941e891435 void.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-03 10:00:14 +02:00
Michael Kerrisk 970c890a17 strsignal.3: Note that 'sys_siglist' is nonstandard
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-02 13:07:30 +02:00
Michael Kerrisk 2d71151934 strsignal.3: Note that starting with v2.32, glibc no longer exports 'sys_siglist'
Reported-by: Hauke Fath <hf@spg.tu-darmstadt.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-02 13:05:23 +02:00
Michael Kerrisk fdecdf810f sys_siglist.3: New link to strsignal(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-02 12:57:45 +02:00
Michael Kerrisk 317203472e psignal.3, strsignal.3: Consolidate information on 'sys_siglist' in one page (strsignal(3))
Through some accident, 'sys_siglist' has been documented in
two different pages. Consolidate the information to one page
(strsignal(3)) and add 'sys_siglist" to the NAME line of that
page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-02 12:57:45 +02:00
Alejandro Colomar a5d13a32b7 uint_least8_t.3, uint_least16_t.3, uint_least32_t.3, uint_least64_t.3, uint_leastN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 17:30:29 +02:00
Alejandro Colomar 876838354d int_least8_t.3, int_least16_t.3, int_least32_t.3, int_least64_t.3, int_leastN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 17:21:17 +02:00
Alejandro Colomar 496b1aad79 uint_fast8_t.3, uint_fast16_t.3, uint_fast32_t.3, uint_fast64_t.3, uint_fastN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 17:20:40 +02:00
Alejandro Colomar 9df81a23e5 int_fast8_t.3, int_fast16_t.3, int_fast32_t.3, int_fast64_t.3, int_fastN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 17:20:19 +02:00
Alejandro Colomar b2769f6f7d uintptr_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 13:29:07 +02:00
Alejandro Colomar d6ecaa2252 intptr_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 13:28:52 +02:00
Alejandro Colomar 8d924ccfd5 malloc_get_state.3: ffix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-01 13:16:03 +02:00
Michael Kerrisk b7a12afe3f xdr.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 22:01:46 +02:00
Michael Kerrisk 4a42acaf3e rpc.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 22:00:44 +02:00
Michael Kerrisk 71c5827828 getutent.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 22:00:44 +02:00
Michael Kerrisk 2dab618c67 strftime.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 15:42:42 +02:00
Alejandro Colomar 13fb746008 FILE.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 15:33:55 +02:00
Michael Kerrisk d39ad78f73 _exit.2, access.2, acct.2, brk.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, fsync.2, futimesat.2, getdomainname.2, getgroups.2, gethostname.2, getpagesize.2, getrlimit.2, getsid.2, gettimeofday.2, kill.2, link.2, madvise.2, mincore.2, mkdir.2, mknod.2, nanosleep.2, nice.2, open.2, posix_fadvise.2, pread.2, process_vm_readv.2, readlink.2, readv.2, rename.2, select.2, semop.2, seteuid.2, setpgid.2, setreuid.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigsuspend.2, sigwaitinfo.2, stat.2, stime.2, symlink.2, sync.2, syscall.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, truncate.2, unlink.2, utimensat.2, vfork.2, vhangup.2, wait.2, wait4.2, a64l.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, atoi.3, bsd_signal.3, cbrt.3, ceil.3, cfree.3, clearenv.3, clock_getcpuclockid.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, daemon.3, dirfd.3, div.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, endian.3, erf.3, erfc.3, exec.3, exp.3, exp2.3, expm1.3, fabs.3, fdim.3, ferror.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fopen.3, fpclassify.3, frexp.3, fseeko.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, getaddrinfo.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent_r.3, getopt.3, getpass.3, getprotoent_r.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent_r.3, getservent_r.3, getspnam.3, getsubopt.3, getusershell.3, getw.3, grantpt.3, group_member.3, gsignal.3, hypot.3, ilogb.3, inet.3, inet_net_pton.3, initgroups.3, insque.3, isalpha.3, isfdtype.3, isgreater.3, iswblank.3, j0.3, killpg.3, ldexp.3, lgamma.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, malloc.3, mbsnrtowcs.3, memchr.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mq_receive.3, mq_send.3, nan.3, newlocale.3, nextafter.3, nl_langinfo.3, on_exit.3, open_memstream.3, opendir.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, pow.3, printf.3, profil.3, psignal.3, pthread_attr_setstack.3, pthread_cleanup_push_defer_np.3, pthread_kill.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_spin_init.3, pthread_spin_lock.3, ptsname.3, putenv.3, putpwent.3, qecvt.3, qsort.3, rand.3, random.3, random_r.3, rcmd.3, readdir_r.3, realpath.3, remainder.3, remquo.3, rint.3, round.3, rpmatch.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_wait.3, setbuf.3, setenv.3, setjmp.3, setnetgrent.3, siginterrupt.3, signbit.3, significand.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sockatmark.3, sqrt.3, stpcpy.3, stpncpy.3, strdup.3, strerror.3, strfromd.3, strnlen.3, strsep.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, syslog.3, tan.3, tanh.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpnam.3, toascii.3, toupper.3, towlower.3, towupper.3, trunc.3, ttyslot.3, tzset.3, ualarm.3, unlocked_stdio.3, unlockpt.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wordexp.3, wprintf.3, y0.3: srcfix: use better macros in SYNOPSIS
Around the text:
"Feature Test Macro Requirements for glibc..."
replace ".in -4n/.in" with ".RS -4/.RE".
The latter form is more idiomatic use of man macros.
The nroff output is unchanged.

Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 15:12:12 +02:00
Michael Kerrisk 161b8eda4d clone.2, io_submit.2, select.2, shmget.2, getcontext.3, malloc_info.3, mtrace.3, posix_spawn.3, strfromd.3, proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 14:24:12 +02:00
Alejandro Colomar b93cf1e1da uint8_t.3, uint16_t.3, uint32_t.3, uint64_t.3, uintN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 13:43:32 +02:00
Alejandro Colomar f30ba1fbcb int8_t.3, int16_t.3, int32_t.3, int64_t.3, intN_t.3: New links to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 13:43:21 +02:00
Alejandro Colomar c3ed59072e uintmax_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 13:43:09 +02:00
Alejandro Colomar 333e127b94 intmax_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 13:42:57 +02:00
Alejandro Colomar f8e0d67e80 va_list.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-26 22:12:26 +02:00
Alejandro Colomar 0c3e8eb330 double_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25 13:50:29 +02:00
Alejandro Colomar fa712444b4 float_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25 13:49:03 +02:00
Alejandro Colomar ffd4b5b90f lconv.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25 09:58:57 +02:00
Alejandro Colomar 203a500f25 getgrent_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>
2020-09-25 09:57:26 +02:00
Alejandro Colomar 8f53215faa lldiv_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 13:04:40 +02:00
Alejandro Colomar 79cb0be81a ldiv_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 13:03:41 +02:00
Alejandro Colomar b3b22e7f4d div_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 13:03:09 +02:00
Alejandro Colomar 72eee6454f imaxdiv_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 12:07:21 +02:00
Michael Kerrisk 2e7e669c2e strfromd.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 10:02:00 +02:00
Michael Kerrisk 861d36ba31 pldd.1, bpf.2, clone.2, dup.2, ioctl_fat.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, pivot_root.2, request_key.2, sched_setaffinity.2, seccomp.2, select.2, statx.2, dl_iterate_phdr.3, dlinfo.3, dlopen.3, insque.3, newlocale.3, printf.3, pthread_setname_np.3, rpc.3, stdarg.3, strfmon.3, veth.4, proc.5, slabinfo.5, cgroup_namespaces.7, cgroups.7, cpuset.7, fanotify.7, inotify.7, mount_namespaces.7, sock_diag.7, user_namespaces.7, ld.so.8: Use \(aq instead of ' inside monospace fonts
Use \(aq to get an unslanted single quote inside monospace code
blocks. Using a simple ' results in a slanted quote inside PDFs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:32:31 +02:00
Alejandro Colomar ab7a387479 fexcept_t.3: New link to system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-23 15:30:45 +02:00
Michael Kerrisk 54b35f3a8d id_t.3: New link to system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 10:39:33 +02:00
Michael Kerrisk 1e02faf49b gid_t.3: New link to system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 10:30:08 +02:00
Michael Kerrisk ac93017ede uid_t.3: New link to system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 10:23:14 +02:00
Michael Kerrisk 8e331675f3 pid_t.3: New link to system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 09:52:08 +02:00
Michael Kerrisk 50270e97ed sigset_t.3: New link to system_data_types.7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 09:31:14 +02:00
Alejandro Colomar 100e4aaaea fenv_t.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-21 20:43:56 +02:00
Alejandro Colomar fce28f1448 siginfo_t.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-20 22:10:42 +02:00
Alejandro Colomar 96c63a40af aiocb.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18 23:27:22 +02:00
Alejandro Colomar 62f4b73a5e regmatch_t.3: New link for new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18 22:45:02 +02:00
Alejandro Colomar 1c0569eac3 regoff_t.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18 22:31:15 +02:00
Alejandro Colomar f723e17664 ptrdiff_t.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18 22:19:56 +02:00
Alejandro Colomar 231b22152a size_t.3: New link to new documented type in system_data_types(7)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18 22:06:55 +02:00
Michael Kerrisk 9f2a6007d1 intro.2, intro.3, feature_test_macros.7, standards.7: SEE ALSO: add system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17 22:54:01 +02:00
Alejandro Colomar 9334a43e41 sigval.3, ssize_t.3, suseconds_t.3, time_t.3, timer_t.3, timespec.3, timeval.3: New links to new system_data_types(7) page
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17 22:54:01 +02:00
Marko Hrastovec a23b00988a freeaddrinfo.3: Fix memory leaks in freeaddrinfo() examples
[mtk: the coding style used in the example could lead people to
inject memory leaks in their code if they cut/paste/modify the
code to replace "exit" paths with "return" paths from a library
function.]

[Marko, from the mail thread discussing this patch:]
You are right about terminating the process. However, people copy
that example and put the code in a function changing "exit" to
"return". There are a bunch of examples like that here
https://beej.us/guide/bgnet/html/#poll, for instance. That error
bothered me when reading the network programming guide
https://beej.us/guide/bgnet/html/. Than I looked for information
elsewhere:

https://stackoverflow.com/questions/6712740/valgrind-reporting-that-getaddrinfo-is-leaking-memory

https://stackoverflow.com/questions/15690303/server-client-sockets-freeaddrinfo3-placement

And finally, I checked manual pages and saw where these errors
come from.

When you change that to a function and return without doing
freeaddrinfo, that is a memory leak. I believe an example should
show good programming practices. Relying on exiting and clearing
the memory in that case is not such a case. In my opinion, these
examples lead people to make mistakes in their programs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17 09:12:24 +02:00
Alejandro Colomar 8eb90116f1 add_key.2, clock_getres.2, clone.2, futex.2, getdents.2, getpid.2, getrlimit.2, ioctl_ns.2, kcmp.2, keyctl.2, memfd_create.2, request_key.2, stat.2, timer_create.2, wait.2, clock_getcpuclockid.3, dl_iterate_phdr.3, getgrent_r.3, getpwent_r.3, getpwnam.3, posix_spawn.3, pthread_getcpuclockid.3, strcat.3, feature_test_macros.7, user_namespaces.7: Switch printf() casts to use [u]intmax_t + %ju / %jd
Let's move to the 21st century. Instead of casting system data
types to long/long long/etc. in printf() calls, instead cast to
intmax_t or uintmax_t, the largest available signed/unsigned
integer types.

[mtk: rewrote commit message]

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-15 07:39:19 +02:00
Alejandro Colomar 627a256ed6 malloc_hook.3: Remove unneeded cast, and print 'size_t' with "%zu"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-13 07:44:06 +02:00
Alejandro Colomar dc97703b4a eventfd.2, mprotect.2, pidfd_open.2, spu_run.2, timer_create.2, bswap.3, dl_iterate_phdr.3, endian.3, pthread_attr_init.3, pthread_getattr_np.3, vcs.4, rtld-audit.7: In printf(): s/0x%/%#/ except when followed by X instead of x
Use printf()'s '#' flag character to prepend the string "0x".

However, when the number is printed in uppercase, and the prefix
is in lowercase, the string "0x" needs to be manually written.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12 08:38:20 +02:00
Alejandro Colomar ec8b00033c getaddrinfo_a.3: Use C99 style to declare loop counter variables
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12 08:38:20 +02:00
Alejandro Colomar ae85f653e4 msgctl.2, outb.2, abs.3, dl_iterate_phdr.3, drand48.3, drand48_r.3, encrypt.3, ffs.3, lrint.3, lround.3, ntp_gettime.3, printf.3, random.3, scalbln.3, scanf.3, strtol.3, strtoul.3, utmp.5, feature_test_macros.7, rtld-audit.7: Omit 'int' keyword for 'short', 'long' and 'long long' types, both signed and 'unsigned'
For consistency.

The types are written both with and without the redundant 'int' keyword
all over the man-pages.  However, the most used form, by far, is the one
without 'int'.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12 08:37:41 +02:00
Michael Kerrisk 7d9746136e pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3: Use correct type (size_t) for some variables
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 14:24:56 +02:00
Michael Kerrisk 404990aeb9 pthread_getattr_np.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 14:22:59 +02:00
Jakub Wilk 581c3ea730 bswap.3: Use strtoull() for parsing 64-bit numbers
Before, on 32-bit systems:

    $ ./a.out 0x0123456789abcdef
    0xffffffff ==> 0xffffffff00000000

After:

    $ ./a.out 0x0123456789abcdef
    0x123456789abcdef ==> 0xefcdab8967452301

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 14:11:10 +02:00
Alejandro Colomar 0ef3e1b730 clock_getcpuclockid.3: Remove unneeded cast
Member 'tv_nsec' of 'struct timespec' is of type 'long' (see time.h.0p),
and therefore, the cast is completely redundant.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 13:04:21 +02:00
Michael Kerrisk 49f06c0010 pthread_setname_np.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar cbb22338cf 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>
2020-09-11 11:33:28 +02:00
Alejandro Colomar 1656c1702d 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>
2020-09-11 09:17:50 +02:00
Alejandro Colomar cf254328fe 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>
2020-09-11 09:17:45 +02:00
Alejandro Colomar 9a84e3383f 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>
2020-09-11 08:43:37 +02:00
Alejandro Colomar 4e4e6e5e14 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>
2020-09-11 08:43:14 +02:00
Alejandro Colomar 2bbfed1b16 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>
2020-09-11 08:41:18 +02:00
Jakub Wilk a99abf87e2 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>
2020-09-10 12:40:34 +02:00
Michael Kerrisk ea4cec5f87 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>
2020-09-10 11:48:08 +02:00
Michael Kerrisk 4f247e780f getopt.3: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-10 09:35:27 +02:00
Mike Frysinger 4e0df17fce posix_spawn.3: tfix
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-08 07:29:33 +02:00
Alejandro Colomar b33535f535 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>
2020-09-08 07:26:00 +02:00
Alejandro Colomar 037c6fd4ee 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>
2020-09-07 22:21:52 +02:00
Alejandro Colomar a3eeca342d 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>
2020-09-07 12:32:03 +02:00
Alejandro Colomar a1eb1a6a33 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>
2020-09-07 12:31:10 +02:00
Michael Kerrisk 7497e9d8c8 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>
2020-09-07 11:21:06 +02:00
Alejandro Colomar 0ca5f06155 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>
2020-09-07 11:00:05 +02:00
Alejandro Colomar 29a95ad159 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>
2020-09-07 10:59:47 +02:00
Michael Kerrisk 51c1b1031b dlopen.3: Revert accidentally applied "dlopen.3: Remove unneeded cast"
This reverts commit ffa50fbf01.
2020-09-06 16:58:45 +02:00
Alejandro Colomar 9ba82f225c 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>
2020-09-06 14:58:37 +02:00
Alejandro Colomar 684130db5c 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>
2020-09-06 14:58:29 +02:00
Alejandro Colomar a0303c05c4 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>
2020-09-06 14:57:50 +02:00
Alejandro Colomar ffa50fbf01 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>
2020-09-06 14:56:18 +02:00
Alejandro Colomar 7ac7f6510b 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>
2020-09-06 14:52:22 +02:00
Alejandro Colomar 0e00826840 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>
2020-09-05 21:42:00 +02:00
Alejandro Colomar c7e5aa83d2 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>
2020-09-05 17:40:44 +02:00
Alejandro Colomar 69003a5891 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>
2020-09-05 17:27:46 +02:00
Michael Kerrisk 88893a773c 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>
2020-09-05 17:20:12 +02:00
Michael Kerrisk 48d0510307 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>
2020-09-05 16:34:34 +02:00
Alejandro Colomar 3b7e518d44 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>
2020-09-05 16:22:21 +02:00
Alejandro Colomar 0091da30d5 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>
2020-09-05 16:21:33 +02:00
Alejandro Colomar a7751aafaa 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>
2020-09-05 16:19:44 +02:00
Alejandro Colomar 5780a2e798 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 23766e41b5 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar baa51272f5 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 9ddabae6e7 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 06c4d5d588 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 7c813ea528 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 9e81cf89e5 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 6a38293919 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar c6683e64ba 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar facc3c56fe 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 8e4dfb59d7 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar d5307ece21 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 3aa268080f 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>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 8ec19d1240 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>
2020-09-05 14:49:42 +02:00
Michael Kerrisk 78da9b6b29 bind.2, ioctl_ns.2, open_by_handle_at.2, duplocale.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +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
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
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 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 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
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 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 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
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 980a26282d openpty.3: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:11 +02:00
Michael Kerrisk 7f9cf51802 unlockpt.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:11 +02:00
Michael Kerrisk e87eb066cc ttyname.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:11 +02:00
Michael Kerrisk 965cd80037 ptsname.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:11 +02:00
Michael Kerrisk 1f5529f250 grantpt.3: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:11 +02:00