Commit Graph

6021 Commits

Author SHA1 Message Date
Jakub Wilk 3e9b499229 remainder.3: tfix
Remove stray words.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:57:37 +02:00
Jakub Wilk 85200b3683 pthread_rwlockattr_setkind_np.3: spfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-21 19:57:31 +02:00
Jakub Wilk 3ceb0d188b pthread_setname_np.3: Explain _np suffix
Add text to CONFORMING TO explaining that the "_np"
suffix is because these functions are non-portable.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-21 19:57:00 +02:00
Michael Kerrisk 49d83458f3 alloca.3: Prevent any misunderstanding about when allocated memory is released
Perhaps some people might misunderstand memory allocated by
alloca() to be like other memory allocated on the stack: that when
the allocation (or the pointer to the allocation) goes out of
scope, the memory is freed. Add some text to prevent that
misunderstanding.

Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 14:37:22 +02:00
Michael Kerrisk 38a6fda1e6 atoi.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 12:21:28 +02:00
Michael Kerrisk 24467b3f80 getlogin.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 12:20:58 +02:00
Michael Kerrisk 2ca6d53467 ttyslot.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 12:20:33 +02:00
Jason A. Donenfeld 5fcb9ef9cb xcrypt.3: Warn folks not to use these functions
There is not an acceptable reason to use these functions ever in
new code.  For example, just observe the implementation of the
KDF:

	/*
	 * Turn password into DES key
	 */
	void
	passwd2des_internal (char *pw, char *key)
	{
	  int i;

	  memset (key, 0, 8);
	  for (i = 0; *pw && i < 8; ++i)
	    key[i] ^= *pw++ << 1;

	  des_setparity (key);
	}

This kind of nonsense isn't okay in the year 2017. Therefore, we
enlighten our poor users.

[Note from mtk: I think Jason knows that of which he talks.]

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-29 00:02:44 +02:00
Michael Kerrisk d8d7010037 malloc.3: Since glibc 2.29, realloc() is exposed by defining _DEFAULT_SOURCE
Info gleaned from glilic NEWS file.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-14 09:51:30 +02:00
Elliott Hughes 06e9098ede fnmatch.3: Clarify "shell wildcard pattern"
There's a detailed explanation in glob(7), so reuse the same text
glob(3) uses to redirect the reader, rather than inlining a short
explanation.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-05 08:43:11 +02:00
Michael Kerrisk 99a541856a malloc.3: Add reference to glibc MallocInternals wiki
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-01 08:11:52 +02:00
Michael Kerrisk 30a264ba19 trunc.3: Make the description a little clearer
The double negative is a little confusing, but required. But try
to make the semantics a little clearer in the wording (which is
now closer to the wording in the C standard).

Reported-by: Eric Benton <erbenton@comcast.net>
Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 10:43:45 +02:00
Michael Kerrisk 35646edbad trunc.3: Emphasize that the return value is a floating-point number
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 10:35:13 +02:00
Michael Kerrisk a12b305997 strcpy.3: Use "destination" consistently (instead of "target" sometimes)
Reported-by: Frank Theile <ftheile@grundfos.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 14:45:20 +02:00
Michael Kerrisk cf21daa8f4 strcmp.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 12:41:19 +02:00
Heinrich Schuchardt 7e1a3cfb16 strcmp.3: Clarify that strcmp() is not locale aware
Indicate that strcmp() does not take the locale into account.
Provide a link to strcoll().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 12:40:25 +02:00
Michael Kerrisk 51d8bd5745 string.3, strlen.3, strnlen.3: Use 'bytes' not 'characters'
This is inline with POSIX terminology. See also the earlier
commit a00b7454b8 (in 2012)
which fixed most of these cases.

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 11:30:53 +02:00
Michael Kerrisk 04ad932426 pthread_attr_init.3: Use correct printf() specifier for "size_t" in example program
Reported-by: Göran Häggsjö <goran.haggsjo@icloud.com>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:13:40 +02:00
Antonio Ospite ff2882fda9 uselocale.3: tfix
LC_GLOBAL_HANDLE is not defined anywhere, the doc meant LC_GLOBAL_LOCALE
instead.

Reported-by: Solal Pirelli <solal.pirelli@gmail.com>
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:07:43 +02:00
Michael Kerrisk 937a218ce5 getmntent.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +02:00
Michael Kerrisk 1fa5de13d4 getutent.3: tfix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:38:08 +02:00
Michael Kerrisk 66af361c68 getopt.3: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:35:22 +02:00
Michael Kerrisk d91b7522a2 cmsg.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-25 10:27:41 +02:00
Michael Kerrisk e5604914d7 cmsg.3: Remove unnecessary 'fdptr' intermediate variable in example code
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-17 12:26:29 +02:00
Michael Kerrisk ca596a72e1 dlinfo.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-12 14:44:19 +02:00
Michael Kerrisk f565c3ee3e cmsg.3: Note that CMSG_FIRSTHDR can return NULL
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-10 07:14:50 +02:00
Michael Kerrisk f8d958aa3d cmsg.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-10 07:14:50 +02:00
Michael Kerrisk cc94a55964 cmsg.3: Remove out of place mention of MSG_CTRUNC
This detail is covered in recvmsg(2), and now also in unix(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-10 07:14:50 +02:00
Michael Kerrisk ca16e00db8 cmsg.3: Explain zero-initialization requirement for CMSG_NXTHDR()
When initializing a new buffer (e.g., that will be sent with
sendmsg(2)), that buffer must first be zero-initialized to
ensure the correct operation of CMSG_NXTHDR().

Verified by experiment, and also by inspection of the glibc
source code:

  _EXTERN_INLINE struct cmsghdr *
  __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
  {
    if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
      /* The kernel header does this so there may be a reason.  */
      return (struct cmsghdr *) 0;

[1] __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
                                   + CMSG_ALIGN (__cmsg->cmsg_len));
    if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
                                          + __mhdr->msg_controllen)
[2]     || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)  // <---
            > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
      /* No more entries.  */
      return (struct cmsghdr *) 0;
    return __cmsg;
  }

At point [1], __cmsg has been updated to point to the next
cmsghdr. The subsequent check at [2] relies on 'cmsg_len'
in the next cmsghdr having some "sensible" value (e.g., 0).
See also https://stackoverflow.com/questions/27601849/cmsg-nxthdr-returns-null-even-though-there-are-more-cmsghdr-objects

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-10 07:14:50 +02:00
Michael Kerrisk e78f6e739b cmsg.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-06 15:33:17 +02:00
Michael Kerrisk b7b0f18926 malloc.3: Note that calloc() detects overflow when multiplying its arguments
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-04 10:03:01 +02:00
Michael Kerrisk d4f4d3f63f reallocarray.3: New link to malloc(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-04 09:46:06 +02:00
Michael Kerrisk 737002259f putenv.3: Note a glibc extension: putenv("NAME") removes an environment variable
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-27 09:53:55 +02:00
Michael Kerrisk 590ba7e5d0 open_by_handle_at.2, ctermid.3, getcwd.3, proc.5: Wording fix: prefer "pathname" over "path" 2018-06-26 06:47:26 +02:00
Michael Kerrisk 4b18e69ccb getcwd.3: Add details on the getcwd() syscall and how it used by libc functions
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-26 06:47:26 +02:00
Michael Kerrisk 12e5ca8bea getcwd.3: Rework text on use of getcwd() system call
Make it cleared that all of the library functions
described on this page will use the getcwd() system call
if it is present. (The text previously implied that only
the getcwd() library function made use of the system call,
but looking in the glibc source code shows that all of the
functions make use of a generic implementation (__getcwd())
that uses the system call if it is present.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-26 06:12:38 +02:00
Michael Kerrisk 27681259e9 getcwd.3: Reorder the text describing "(unreachable)" being returned by getcwd()
The existing text on some of the oddities of the Linux getcwd()
implementation was placed somewhat obtrusively in the DESCRIPTION.
Shift the text to NOTES, and at the same time move the related
discussion of glibc nonconformance to POSIX into BUGS.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-26 06:05:55 +02:00
Lucas Werkmeister 28131cd994 usleep.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-21 19:18:12 +02:00
Matthew Kilgore 85bbb2a253 strcpy.3: Fix example code for strncpy, which could pass an incorrect length
The example code currently passes `buflen - 1` to `strncpy`,
however the length parameter to `strncpy` is `size_t`, which is
unsigned.  This means that when `buflen` is zero, the cast of `-1`
to unsigned will result in passing `UINT_MAX` as the length.
Obviously, that would be incorrect and could cause `strncpy` to
write well beyond the buffer passed.

The easy solution is to wrap the whole code in the `buflen > 0`
check, rather then just the part of the code that applies the null
terminator.

Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-10 13:36:46 +02:00
Mike Frysinger 946bdf7207 exit.3: Note wider sysexits.h availability
Since the BSD header has been imported to other C libraries (including
glibc), note that here so people know it isn't BSD-specific.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Michael Kerrisk 65c3312c6d putenv.3: wfix
Reported-by: James Weigle <jtweigle@uchicago.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 10:58:45 +02:00
Michael Kerrisk ff2c46188e termios.3: Minor tweaks to Eugene's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-02 12:46:09 +02:00
Eugene Syromyatnikov 499eb81f26 termios.3: Note an XTABS alpha issue
* man3/termios.3 (.B TABDLY): Reference to the BUGS section.
(.SH BUGS): New section.  Describe an issue on alpha where the XTABS
macro was defined to a value outside TABDLY mask.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-02 12:40:49 +02:00
Michael Kerrisk a706f0e022 Removed trailing white space at end of lines 2018-04-30 17:54:16 +02:00
Michael Kerrisk 09b8afdc04 execve.2, fallocate.2, getrlimit.2, io_submit.2, membarrier.2, mmap.2, msgget.2, open.2, ptrace.2, readv.2, semget.2, shmget.2, shutdown.2, syscall.2, wait.2, wait4.2, crypt.3, encrypt.3, fseek.3, getcwd.3, makedev.3, pthread_create.3, puts.3, tsearch.3, elf.5, filesystems.5, group.5, passwd.5, sysfs.5, mount_namespaces.7, posixoptions.7, time.7, unix.7, vdso.7, xattr.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-30 17:41:31 +02:00
Michael Kerrisk ebd10b39cb keyctl.2, sincos.3: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-27 14:48:33 +02:00
Michael Kerrisk 29c0586f51 bpf.2, sched_setattr.2, crypt.3, elf.5, proc.5, fanotify.7, feature_test_macros.7, sched.7: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-27 14:48:33 +02:00
Michael Kerrisk d2cb1ef1ac fallocate.2, keyctl.2, bzero.3: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-27 14:48:33 +02:00
Michael Kerrisk f019faae04 fseek.3: Improve EPIPE error text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-19 15:00:04 +02:00
Michael Kerrisk f2e2bdc0eb fseek.3: ERRORS: EBADF should be ESPIPE
Reported-by: Andy Owen <andrew.owen@dolby.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-19 14:57:17 +02:00