aboutsummaryrefslogtreecommitdiffstats
path: root/man3
AgeCommit message (Collapse)AuthorFilesLines
2020-10-01malloc_get_state.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29xdr.3: ffixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29rpc.3: ffixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29getutent.3: ffixMichael Kerrisk1-8/+5
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29strftime.3: ffixMichael Kerrisk1-2/+8
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29FILE.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29_exit.2, access.2, acct.2, brk.2, chdir.2, chmod.2, chown.2, chroot.2, ↵Michael Kerrisk240-480/+480
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-29clone.2, io_submit.2, select.2, shmget.2, getcontext.3, malloc_info.3, ↵Michael Kerrisk5-10/+10
mtrace.3, posix_spawn.3, strfromd.3, proc.5: srcfix Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29uint8_t.3, uint16_t.3, uint32_t.3, uint64_t.3, uintN_t.3: New links to ↵Alejandro Colomar5-0/+5
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-29int8_t.3, int16_t.3, int32_t.3, int64_t.3, intN_t.3: New links to ↵Alejandro Colomar5-0/+5
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-29uintmax_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29intmax_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-26va_list.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25double_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25float_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25lconv.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25getgrent_r.3: Declare variables with different types in different linesAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24lldiv_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24ldiv_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24div_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24imaxdiv_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24strfromd.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24pldd.1, bpf.2, clone.2, dup.2, ioctl_fat.2, nfsservctl.2, ↵Michael Kerrisk10-16/+16
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-23fexcept_t.3: New link to system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22id_t.3: New link to system_data_types(7)Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22gid_t.3: New link to system_data_types(7)Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22uid_t.3: New link to system_data_types(7)Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22pid_t.3: New link to system_data_types(7)Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22sigset_t.3: New link to system_data_types.7Michael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-21fenv_t.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-20siginfo_t.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18aiocb.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18regmatch_t.3: New link for new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18regoff_t.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18ptrdiff_t.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-18size_t.3: New link to new documented type in system_data_types(7)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17intro.2, intro.3, feature_test_macros.7, standards.7: SEE ALSO: add ↵Michael Kerrisk1-1/+2
system_data_types(7) Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17sigval.3, ssize_t.3, suseconds_t.3, time_t.3, timer_t.3, timespec.3, ↵Alejandro Colomar7-0/+7
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-17freeaddrinfo.3: Fix memory leaks in freeaddrinfo() examplesMarko Hrastovec1-4/+4
[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-15add_key.2, clock_getres.2, clone.2, futex.2, getdents.2, getpid.2, ↵Alejandro Colomar8-12/+21
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-13malloc_hook.3: Remove unneeded cast, and print 'size_t' with "%zu"Alejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12eventfd.2, mprotect.2, pidfd_open.2, spu_run.2, timer_create.2, bswap.3, ↵Alejandro Colomar5-8/+8
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-12getaddrinfo_a.3: Use C99 style to declare loop counter variablesAlejandro Colomar1-4/+4
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12msgctl.2, outb.2, abs.3, dl_iterate_phdr.3, drand48.3, drand48_r.3, ↵Alejandro Colomar15-75/+75
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-11pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3: Use correct ↵Michael Kerrisk3-3/+3
type (size_t) for some variables Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11pthread_getattr_np.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11bswap.3: Use strtoull() for parsing 64-bit numbersJakub Wilk1-1/+1
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-11clock_getcpuclockid.3: Remove unneeded castAlejandro Colomar1-1/+1
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-11pthread_setname_np.3: ffixMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11fread.3: Move ARRAY_SIZE logic into macroAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11getpwent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11getgrent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name)Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11get_phys_pages.3: Write 'long' instead of 'long int'Alejandro Colomar1-2/+2
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-11getpwent_r.3: Declare variables with different types in different linesAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11offsetof.3: Use "%zu" rather than "%zd" when printing 'size_t' valuesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-10dlopen.3, gnu_get_libc_version.3: tfixJakub Wilk2-2/+2
Escape hyphens. Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-10dlopen.3: Clarify DT_RUNPATH/DT_RPATH detailsMichael Kerrisk1-2/+5
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-10getopt.3: Minor wording fixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-08posix_spawn.3: tfixMike Frysinger1-3/+3
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-08bsearch.3: Declare variables with different types in different linesAlejandro Colomar1-1/+3
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07pthread_getattr_np.3: Use "%zu" and "%zx" when printing 'size_t' valuesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07fopencookie.3: Fix bugs in exampleAlejandro Colomar1-5/+5
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-07fopencookie.3: printf()'s .* expects an int; cast accordinglyAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07errno.3: Note that the pthreads APIs do not set errnoMichael Kerrisk1-0/+10
Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07getline.3: Use %zd rather than %zu when printing 'ssize_t' valuesAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07hcreate.3: Declare variables with different types in different linesAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-06dlopen.3: Revert accidentally applied "dlopen.3: Remove unneeded cast"Michael Kerrisk1-1/+1
This reverts commit ffa50fbf01ef1ecb9cac49c28786860a9d0d3f02.
2020-09-06qsort.3: Fix castsAlejandro Colomar1-1/+1
`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-06bsearch.3: Fix intermediate type and remove unneeded castsAlejandro Colomar1-2/+2
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-06pthread_sigmask.3: Remove unneeded castsAlejandro Colomar1-1/+1
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-06dlopen.3: Remove unneeded castAlejandro Colomar1-1/+1
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-06stdarg.3: Declare variables with different types in different linesAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05tsearch.3: Simplify type usage and remove unneeded castsAlejandro Colomar1-2/+2
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-05tsearch.3: Remove unneeded castAlejandro Colomar1-1/+1
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-05tsearch.3: Use size_t for malloc() argumentAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05sprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, ↵Michael Kerrisk31-84/+64
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-05getgrouplist.3, insque.3, malloc_info.3, pthread_create.3, tsearch.3, aio.7: ↵Michael Kerrisk5-11/+6
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-05tsearch.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05pthread_create.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05mbstowcs.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05shm_open.3: Use sizeof consistentlyAlejandro Colomar1-2/+2
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-05rtnetlink.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05rtnetlink.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05pthread_setaffinity_np.3: Use sizeof consistentlyAlejandro Colomar1-2/+2
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-05strptime.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05mbsinit.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05malloc_info.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05insque.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05getgrouplist.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05getaddrinfo.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05getaddrinfo.3: Use sizeof consistentlyAlejandro Colomar1-2/+2
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-05cmsg.3: Use sizeof consistentlyAlejandro Colomar1-2/+2
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-05cmsg.3: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-05bsearch.3: Use sizeof consistentlyAlejandro Colomar1-2/+2
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-05bind.2, ioctl_ns.2, open_by_handle_at.2, duplocale.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-04mbsinit.3: wsfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-26cmsg.3, getaddrinfo_a.3 getgrouplist.3: Use sizeof, consistentlyAlejandro Colomar3-3/+3
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-25getgrouplist.3, inotify.7: Use sizeof consistentlyAlejandro Colomar1-1/+1
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-24queue.3: ffixMichael Kerrisk1-0/+1
Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-24queue.3: Minor formatting fixes for Alejandro Colomar's patchMichael Kerrisk1-1/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-24queue.3: Document CIRCLEQ_* macrosAlejandro Colomar1-8/+248
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-23strtod.3: Fix return value for underflowJonathan Wakely1-6/+14
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-23printf.3: Fix description of %a hexfloat outputJonathan Wakely1-1/+3
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-13intro.1, clock_getres.2, execve.2, fcntl.2, iopl.2, lseek.2, mknod.2, ↵Michael Kerrisk31-31/+31
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-13drop "coding: UTF-8" headerMike Frysinger2-2/+0
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-13queue.3: Remove wrong code from exampleAlejandro Colomar1-12/+0
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-09pldd.1, bpf.2, execve.2, futex.2, ioctl_fat.2, ioctl_tty.2, keyctl.2, ↵Michael Kerrisk10-19/+19
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-06strftime.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06assert.3: ffixMichael Kerrisk1-1/+5
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06intro.1, clock_getres.2, clone.2, futex.2, ioctl_fat.2, mkdir.2, mknod.2, ↵Michael Kerrisk4-8/+8
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-04queue.3: Comment out text for functions not in glibc (related: 6559169cac)Alejandro Colomar1-13/+13
=========== 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-07-29openpty.3: Minor wording fixesMichael Kerrisk1-2/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29unlockpt.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29ttyname.3: wfixMichael Kerrisk1-2/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29ptsname.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29grantpt.3: Minor wording fixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29getpt.3, posix_openpt.3, pts.4: Use the term "pseudoterminal multiplexor ↵Michael Kerrisk2-3/+3
device" for /dev/ptmx Let's use some consistent terminology for this device. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29getpt.3: Minor wording fixesMichael Kerrisk1-3/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29getpt.3, pts.4: Minor wording fixesMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24Various pages: Drop t comment headerMike Frysinger30-30/+0
Historically, a comment of the following form at the top of a manual page was used to indicate too man(1) that the use of tbl(1) was required in order to process tables: '\" t However, at least as far back as 2001 (according to Branden), man-db's man(1) automatically uses tbl(1) as needed, rendering this comment unnecessary. And indeed many existing pages in man-pages that have tables don't have this comment at the top of the file. So, drop the comment from those files where it is present. [mtk: completely rewrote commit message] Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24Various pages: Use standard .\" comment styleMike Frysinger1-1/+1
The \" comment produces blank lines. Use the .\" that the vast majority of the codebase uses instead. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-21posix_memalign.3: Clarify how to free the result of posix_memalignBruno Haible1-3/+4
The man page did not tell how a memory block obtained through posix_memalign() can be freed. POSIX:2018 says it. https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html I verified using a test program that this is true for glibc. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-21wctob.3: tfixBruno Haible1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-20ioctl_fat.2, dladdr.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-17pthread_rwlockattr_setkind_np.3: Clarify a PTHREAD_RWLOCK_PREFER_WRITER_NP ↵Carlos O'Donell1-2/+3
detail Clarify that it is recursive read locks on the read-write lock that make it difficult to implement PTHREAD_RWLOCK_PREFER_WRITER_NP. Update the libc-alpha URL and provide the URL to the POSIX wording that is quoted in the comment. Reported-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Carlos O'Donell <carlos@redhat.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06intro.1, localedef.1, memusage.1, memusagestat.1, bpf.2, execve.2, fork.2, ↵Michael Kerrisk7-9/+9
keyctl.2, request_key.2, sigaction.2, signal.2, socket.2, dlopen.3, getauxval.3, gnu_get_libc_version.3, pthread_atfork.3, sem_post.3, setjmp.3, strftime.3, veth.4, locale.5, nscd.conf.5, resolv.conf.5, address_families.7, armscii-8.7, ascii.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.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, libc.7, locale.7, man.7, network_namespaces.7, persistent-keyring.7, session-keyring.7, signal.7, unicode.7, uri.7, user-keyring.7, user-session-keyring.7: ffix: replace - with real\- Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06strfmon.3: ffixMichael Kerrisk1-3/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06strfmon.3: ffixMichael Kerrisk1-1/+1
Reported-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06man[13]/*: ffix: change '--' to '\-\-' (options) or '\(em' (em-dash)Bjarni Ingi Gislason2-2/+2
Change '--' to '\-\-' for options and '--' between words to '\(em' (em-dash). Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06termios.3: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06strcmp.3: wfixMichael Kerrisk1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06strcmp.3: tfixMichael Kerrisk1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06resolver.3: tfixMichael Kerrisk1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06getusershell.3: ffixMichael Kerrisk1-3/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-02strfromd.3: ffix: use \- for minus signMichael Kerrisk1-4/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-02man3/*: ffix: change '-' to '\-' for optionsBjarni Ingi Gislason10-13/+13
Change '-' to '\-' for the prefix of names to indicate an option. Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-02ftw.3: srcfixMichael Kerrisk1-1/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-29strfromd.3: wfix (null character --> null byte)Michael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-25gethostid.3: wfix: s/is intended/was intended/Michael Kerrisk1-1/+1
The host ID might once have been intended to be globally unique, but that turned out not to feasible. Reported-by: Rich Felker <dalias@libc.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-21man3/*: srcfix: fix warnings from "mandoc -Tlint"Bjarni Ingi Gislason46-66/+6
Remove superfluous paragraph macros. Remove request ".br" if it precedes a line, that begins with a space, as such lines automatically cause a break. There is no change in the output from "nroff" and "groff". ### Examples of warnings from "mandoc -Tlint": mandoc: bindresvport.3:41:2: WARNING: skipping paragraph macro: PP after SH mandoc: crypt.3:228:2: WARNING: skipping paragraph macro: PP empty mandoc: dlinfo.3:151:2: WARNING: skipping paragraph macro: IP empty mandoc: exec.3:86:2: WARNING: skipping paragraph macro: PP after SS mandoc: getsubopt.3:45:2: WARNING: skipping paragraph macro: br before text line with leading blank Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19getdtablesize.2, sigqueue.2, clock_getres.3, clock_gettime.3, ↵Michael Kerrisk3-9/+0
clock_settime.3, attr.5, numa_maps.5: Remove old links These are all links that were created several years ago, mainly when pages were migrated to different sections, in order to allow the 'man' commands using the old section numbers to work. However, the plan was always to eventually remove them, after allowing people who cared to get used to the new section numbers. Now, after 5+ years in each case, it's time to remove these links. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19fread.3: srcfix: remove crufty lineMichael Kerrisk1-1/+0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19fread.3: Add exampleArkadiusz Drabczyk1-0/+56
Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19fread.3: Explain that file position is moved after calling fread()/fwrite()Arkadiusz Drabczyk1-0/+3
Corresponding manpage on FreeBSD already contains that information. Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19atoi.3: Minor tweaks to Arkadiusz Drabczyk's patchMichael Kerrisk1-2/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19atoi.3: Relocate BUGS sectionMichael Kerrisk1-11/+11
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19atoi.3: Add NOTES section explaining 0 return value on errorMichael Kerrisk1-0/+5
And note that this is not specified by POSIX. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19atoi.3: Explain disadvantages of atoi()Arkadiusz Drabczyk1-1/+12
I believe new users should be discouraged from using atoi() and that its disadvantages should be explained. I added the information that 0 is returned on error - although C standard and POSIX say that "If the value of the result cannot be represented, the behavior is undefined." there are some interpretations that 0 has to be returned https://stackoverflow.com/questions/38393162/what-can-i-assume-about-the-behaviour-of-atoi-on-error and this is also what happens in practice with glibc, musl and uClibc. Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15Various pages: srcfix: trim a trailing spaceBjarni Ingi Gislason6-12/+12
Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z [ "test-groff" is a developmental version of "groff" ] There is no change in the output of "nroff" and "groff". #### troff: <fts.3>:50: warning: trailing space #### troff: <getgrnam.3>:175: warning: trailing space #### troff: <getpwnam.3>:181: warning: trailing space #### troff: <rcmd.3>:52: warning: trailing space troff: <rcmd.3>:57: warning: trailing space troff: <rcmd.3>:60: warning: trailing space troff: <rcmd.3>:63: warning: trailing space troff: <rcmd.3>:69: warning: trailing space troff: <rcmd.3>:73: warning: trailing space #### troff: <rexec.3>:48: warning: trailing space troff: <rexec.3>:51: warning: trailing space #### troff: <sem_open.3>:36: warning: trailing space Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11chroot.2, utimensat.2, vfork.2, getcwd.3, getdtablesize.3, ualarm.3, ↵Michael Kerrisk4-4/+4
usleep.3, rtnetlink.7: srcfix Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11dup.2, fallocate.2, futex.2, ioctl_fat.2, ioctl_ficlonerange.2, ↵Michael Kerrisk6-8/+8
ioctl_fideduperange.2, madvise.2, membarrier.2, mprotect.2, open.2, openat2.2, perf_event_open.2, perfmonctl.2, pipe.2, process_vm_readv.2, s390_pci_mmio_write.2, s390_runtime_instr.2, s390_sthyi.2, set_thread_area.2, sigprocmask.2, subpage_prot.2, unshare.2, cmsg.3, newlocale.3, pthread_setname_np.3, strfmon.3, strfromd.3, tsearch.3, tcp.7, ld.so.8: ffix Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11pthread_setconcurrency.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11if_nameindex.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10printf.3: ffixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09iconv.1, locale.1, memusage.1, memusagestat.1, pldd.1, sprof.1, _syscall.2, ↵Michael Kerrisk149-149/+149
add_key.2, adjtimex.2, bind.2, bpf.2, chown.2, clone.2, close.2, copy_file_range.2, eventfd.2, fanotify_init.2, fanotify_mark.2, fork.2, fsync.2, futex.2, getdents.2, getrlimit.2, getxattr.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, ioctl_fat.2, ioctl_getfsmap.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, kcmp.2, keyctl.2, listen.2, listxattr.2, mbind.2, membarrier.2, memfd_create.2, mkdir.2, move_pages.2, mremap.2, msync.2, nfsservctl.2, open.2, perf_event_open.2, pidfd_send_signal.2, pipe.2, pivot_root.2, pkey_alloc.2, process_vm_readv.2, ptrace.2, readlink.2, readv.2, recv.2, recvmmsg.2, rename.2, request_key.2, s390_runtime_instr.2, sched_setaffinity.2, seccomp.2, send.2, sendmmsg.2, sigaltstack.2, signalfd.2, socket.2, socketpair.2, splice.2, spu_create.2, spu_run.2, statfs.2, syscall.2, sysctl.2, sysfs.2, tee.2, timer_getoverrun.2, timer_settime.2, umount.2, userfaultfd.2, utimensat.2, wait4.2, INFINITY.3, __ppc_get_timebase.3, __setfpucw.3, abort.3, aio_cancel.3, aio_error.3, aio_read.3, aio_return.3, atexit.3, backtrace.3, basename.3, bsearch.3, bswap.3, cacos.3, cacosh.3, catan.3, catanh.3, cexp2.3, clock_getcpuclockid.3, clog2.3, cmsg.3, confstr.3, div.3, dl_iterate_phdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, duplocale.3, encrypt.3, end.3, endian.3, envz_add.3, err.3, expm1.3, fdim.3, flockfile.3, fmtmsg.3, frexp.3, ftw.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo_a.3, getauxval.3, getdate.3, getdtablesize.3, getgrent_r.3, getgrouplist.3, gethostbyname.3, getline.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, getsubopt.3, getutent.3, glob.3, gnu_get_libc_version.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, insque.3, killpg.3, makecontext.3, mallinfo.3, malloc.3, malloc_hook.3, malloc_info.3, mallopt.3, matherr.3, mbsnrtowcs.3, mbstowcs.3, mcheck.3, mempcpy.3, mq_getattr.3, mq_notify.3, mtrace.3, newlocale.3, nextafter.3, ntp_gettime.3, offsetof.3, open_memstream.3, pow.3, printf.3, pthread_attr_init.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setstack.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_create.3, pthread_detach.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_spin_init.3, pthread_testcancel.3, pthread_tryjoin_np.3, ptsname.3, qsort.3, rand.3, random.3, remainder.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, sem_getvalue.3, sem_wait.3, setaliasent.3, setlogmask.3, sigwait.3, sincos.3, sockatmark.3, stdarg.3, stpcpy.3, strcat.3, strfmon.3, strptime.3, strtod.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, tsearch.3, uselocale.3, wcstok.3, wcstombs.3, wordexp.3, y0.3, loop.4, vcs.4, veth.4, charmap.5, core.5, filesystems.5, gai.conf.5, hosts.5, hosts.equiv.5, locale.5, nss.5, repertoiremap.5, securetty.5, shells.5, ttytype.5, ascii.7, complex.7, cpuset.7, credentials.7, fanotify.7, hier.7, inotify.7, ip.7, mount_namespaces.7, mq_overview.7, netlink.7, network_namespaces.7, pid_namespaces.7, pkeys.7, rtld-audit.7, rtnetlink.7, sem_overview.7, signal-safety.7, sock_diag.7, spufs.7, standards.7, symlink.7, tcp.7, time_namespaces.7, unix.7, user_namespaces.7, xattr.7, ldconfig.8: tstamp Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08random.3: wfix: no need to mention INT32_MAXMichael Kerrisk1-2/+0
Reported-by: walter harms <wharms@bfs.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08random.3: Change "RAND_MAX" tp "2^31-1"John Marshall1-2/+4
RAND_MAX is for rand(3). POSIX fixes random()'s range at 2^31-1; RAND_MAX may be smaller on some platforms (even though with glibc or musl on Linux they are the same). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-03err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit statusMichael Kerrisk1-4/+5
By way of good example, use the an EXIT_* symbolic constant, rather than a hard-coded number. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31clock_getres.2, fsync.2, mlock.2, mmap.2, msync.2, INFINITY.3, cexp2.3, ↵Michael Kerrisk4-4/+4
clog2.3, flockfile.3: Remove AVAILABILITY section heading In the few pages where this heading (which is "nonstandard" within man-pages) is used, it always immediately follows CONFORMING TO and generally contains information related to standards. Remove the section heading, thus incorporating AVAILABILITY into CONFORMING TO. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-31Various pages: retitle EXAMPLE section heading to EXAMPLESMichael Kerrisk137-137/+137
EXAMPLES appears to be the wider majority usage across various projects' manual pages, and is also what is used in the POSIX manual pages. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26ctime.3: wfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26pipe.2, socketpair.2, dlopen.3, posix_memalign.3, signal-safety.7: Correct ↵Michael Kerrisk2-6/+6
bogus POSIX.1 standards names POSIX.1-2003 ==> POSIX.1-2001 TC1 POSIX.1-2004 ==> POSIX.1-2001 TC2 POSIX.1-2013 ==> POSIX.1-2008 TC1 POSIX.1-2016 ==> POSIX.1-2008 TC2 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26tzset.3: ffixMichael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26getnameinfo.3: srcfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26dlopen.3: tfixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26y0.3: errno is now correctly set to ERANGE on underflowMichael Kerrisk1-6/+9
The fix was in glibc 2.17. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6808 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26y0.3: srcfix: remove an ancient FIXME that no longer matters muchMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26y0.3: These functions now correctly diagnose a pole errorMichael Kerrisk1-12/+10
The fix was in glibc 2.19. See https://sourceware.org/bugzilla/show_bug.cgi?id=6807 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26y0.3: srcfix: Note on "Range error: result underflow" and FE_UNDERFLOWMichael Kerrisk1-5/+2
The fact that an FE_UNDERFLOW exception is not raised for "Range error: result underflow" is intended behavior. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6806. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26j0.3: srcfix: add notes that failing to raise FE_UNDERFLOW is intended behaviorMichael Kerrisk1-5/+2
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6805 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26scalbln.3: These functions now correctly set errno for the ERANGE caseMichael Kerrisk1-8/+9
Modify DESCRIPTION appropriately and add BUGS section. The fix was in glibc 2.20. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26hypot.3: srcfix: add some notes about the underflow caseMichael Kerrisk1-5/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26sincos.3: The glibc implementation does now give EDOM for a domain errorMichael Kerrisk1-10/+11
The fix was in glibc 2.22 (commit d435569cd626bccb9c27361202a279d0fd7fce88). See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25printf.3: Prevent signed integer overflow in exampleTobias Stoeckmann1-6/+9
The function make_message illustrates how to use vsnprintf to determine the required amount of memory for a specific format and its arguments. If make_message is called with a format which will use exactly INT_MAX characters (excluding '\0'), then the size++ calculation will overflow the signed integer "size", which is an undefined behaviour in C. Since malloc and vsnprintf rightfully take a size_t argument, I decided to use a size_t variable for size calculation. Therefore, this patched code uses variables of the same data types as expected by function arguments. Proof of concept (tested on Linux/glibc amd64): int main() { make_message("%647s%2147483000s", "", ""); } If the code is compiled with address sanitizer (gcc -fsanitize=address) you can see the following line, assuming that a signed integer overflow simply leads to INT_MIN: ==3094==WARNING: AddressSanitizer failed to allocate 0xffffffff80000000 bytes Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25scanf.3: Clarify that 'x' specifier allows a 0x/0X prefix in input stringMichael Kerrisk1-1/+6
Reported-by: Jürgen Sauermann <mail@juergen-sauermann.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25pow.3: Minor tweak to BUGSMichael Kerrisk1-1/+1
Remove the text ("rare)" after a note from Vincent Lefèvre: Subject: [Bug math/13932] dbl-64 pow unexpectedly slow for some inputs Date: Sat, 23 May 2020 21:31:52 +0000 From: vincent-srcware at vinc17 dot net <sourceware-bugzilla@sourceware.org> To: mtk.manpages@gmail.com https://sourceware.org/bugzilla/show_bug.cgi?id=13932 --- Comment #26 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> --- (In reply to Michael Kerrisk from comment #25) > Fix documented for man-pages-5.07. [...] > -On 64-bits, > +Before glibc 2.28, > .\" > .\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932 > +on some architectures (e.g., x86-64) > .BR pow () > may be more than 10,000 times slower for some (rare) inputs > than for other nearby inputs. [...] The problematic values are uncommon, but not so rare, in the sense that they are close to simple values, i.e. are likely to occur in practice. An example given above: pow(0.999999999999999889, 1.5) 1 and 1.5 are very simple values, which are more likely to occur in practice than some fixed random value. Then it suffices to have a small rounding error on 1... For instance, this is very different from hard-to-round cases of exp, which are also very slow IMHO, but unless one writes a specific program for them, no-one should notice the slowness because such a case would typically occur only once among billions (I don't remember the accuracy before the slowest path in this library). Reported-by: Vincent Lefèvre <vincent-srcware@vinc17.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25pow.3: srcfix: remove an ancient FIXME that is pretty irrelevant these daysMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25pow.3: Add a subheading to mark off historical bugs that are now fixedMichael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25pow.3: Several bugs in glibc's pow() implementation were fixed in glibc 2.16Michael Kerrisk1-20/+6
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=3866. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25pow.3: BUGS: pow() performance problem for some (rare) inputs has been fixedMichael Kerrisk1-2/+5
See https://sourceware.org/bugzilla/show_bug.cgi?id=13932 Fixed in glibc 2.28. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25hypot.3: srcfix: Clear an obsolete FIXMEMichael Kerrisk1-3/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25erf.3, erfc.3: srcfix: Clear an obsolete FIXMEMichael Kerrisk2-4/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25scalb.3: These functions now correctly set errno for the EDOM and ERANGE casesMichael Kerrisk1-15/+16
Modify DESCRIPTION appropriately and add BUGS section. The fix was in glibc 2.20. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803 and https://www.sourceware.org/bugzilla/show_bug.cgi?id=6804 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25nextafter.3: Since glibc 2.23, these functions do set errnoMichael Kerrisk1-11/+11
Modify DESCRIPTION appropriately and add BUGS section. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6799. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25fdim.3: BUGS: these functions did not set errno on some architecturesMichael Kerrisk1-7/+9
The bug was fixed in glibc 2.24. https://www.sourceware.org/bugzilla/show_bug.cgi?id=6796 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25expm1.3: The bogus invalid floating-point exception bug has been fixedMichael Kerrisk1-8/+8
Sometime around 2009 (approximately 2.11) according to https://www.sourceware.org/bugzilla/show_bug.cgi?id=6814. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25expm1.3: The expm1() bogus underflow floating-point exception has been fixedMichael Kerrisk1-5/+6
Fixed in glibc 2.17. See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6778 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21stdarg.3: SEE ALSO: add vprintf(3), vscanf(3), vsyslog(3)Michael Kerrisk1-0/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21cexp2.3: Still not present in glibc 2.31Michael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19dlsym.3: Extend discussion of NULL symbol valuesAlexander Monakov1-8/+14
Avoid implying that use of IFUNC is the only way to produce a symbol with NULL value. Give more scenarios how a symbol may get NULL value, but explain that in those scenarios dlsym() will fail with Glibc's ld.so due to an implementation inconsistency. Signed-off-by: Alexander Monakov <amonakov@ispras.ru> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19pipe.2, sigaltstack.2, abort.3, signal.7: Place SH sections in standard orderMichael Kerrisk1-2/+2
Fix various pages that deviated from the norm described in man-pages(7). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19des_crypt.3: Minor wording fix in VERSIONSMichael Kerrisk1-3/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19malloc.3: Add VERSIONS section noting when reallocarray() was added to glibcMichael Kerrisk1-0/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19malloc.3: Add 'reallocarray' in NAMEMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19adjtimex.2, prctl.2, semget.2, signalfd.2, umount.2, syscall.2, dlopen.3, ↵Michael Kerrisk3-5/+5
getgrent_r.3, killpg.3: Add section number in page cross-reference (adjtime(3)) Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19close.2, poll.2, pthread_spin_init.3: Remove section number in page ↵Michael Kerrisk1-1/+1
self-references Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19gettid.2, open.2, seccomp.2, pthread_mutex_consistent.3, signal.7, xattr.7: ↵Michael Kerrisk1-1/+1
Put SEE ALSO entries in alphabetical order Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-18Various pages: Add missing commas in SEE ALSO part IIKir Kolyshkin5-5/+5
This is a sequel to commit baf17bc4f2a3f3b02d, addressing the issues with missing commas in the middle of SEE ALSO lists that emerged since. The awk script from the original commit was not working and had to be slightly modified (s/["]SEE ALSO["]/"?SEE ALSO/), otherwise it works like a charm. Here's the fixed script and its output just before this commit: for f in man*/*; do awk ' /^.SH "?SEE ALSO/ { sa=1; print "== " FILENAME " =="; print; next } /^\.(PP|SH)/ { sa=0; no=0; next } /^\.BR/ { if (sa==1) { print; if (no == 1) print "Missing comma in " FILENAME " +" FNR-1; no=0 } } /^\.BR .*)$/ { if (sa==1) no=1; next } /\.\\"/ {next} /.*/ { if (sa==1) { print; next } } ' $f; done | grep Missing Missing comma in man1/memusage.1 +272 Missing comma in man2/adjtimex.2 +597 Missing comma in man2/adjtimex.2 +598 Missing comma in man2/mkdir.2 +252 Missing comma in man2/sigaction.2 +1045 Missing comma in man2/sigaction.2 +1047 Missing comma in man3/mbsnrtowcs.3 +198 Missing comma in man3/ntp_gettime.3 +142 Missing comma in man3/strcmp.3 +219 Missing comma in man3/strtol.3 +302 Missing comma in man3/wcstombs.3 +120 Missing comma in man7/user_namespaces.7 +1378 Missing comma in man7/xattr.7 +198 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12dirfd.3: SEE ALSO: add openat(2)Michael Kerrisk1-0/+1
By way of a hint that the file descriptor returned by dirfd() could usefully be fed to the *at() APIs. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-11setenv.3: wfixKir Kolyshkin1-8/+2
Both functions behave the same wrt return value, no need to describe them separately. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>