Commit Graph

5981 Commits

Author SHA1 Message Date
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
Michael Kerrisk 924f766741 encrypt.3: Replace text that is duplicated in crypt(3) with a cross reference
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 21:23:28 +02:00
Michael Kerrisk 3f3eeb9ca0 crypt.3: tfix
Reported-by: Nikos Mavrogiannopoulos <nmavrogi@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 21:23:28 +02:00
Michael Kerrisk 8291a17bd6 crypt.3: Tweaks to Carlos O'Donell's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 21:07:22 +02:00
Michael Kerrisk b2ca119e1a encrypt.3: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 17:02:28 +02:00
Michael Kerrisk 419b9d89e6 crypt.3: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 17:02:28 +02:00
Carlos O'Donell 629a86ecb7 crypt.3, encrypt.3: Add notes about _XOPEN_CRYPT
The distribution may choose not to support _XOPEN_CRYPT in the
case that the distribution has transitioned from glibc crypt to
libxcrypt.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-13 17:02:28 +02:00
Michael Kerrisk 40b7acf14d getcwd.3: Minor tweaks to Carlos O'Donell's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-12 13:49:40 +02:00
Michael Kerrisk c26d16c8de getcwd.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-12 13:47:03 +02:00
Carlos O'Donell 294851f3fa getcwd.3: Mention that "(unreachable)" is no longer returned for glibc >= 2.27.
With glibc fix 52a713fdd0a30e1bd79818e2e3c4ab44ddca1a94 for
CVE-2018-1000001 (Sourceware BZ #22679) the implementation in the
just released glibc 2.27 has been changed such that instead of
returning "(unreachable)" the implementation now returns ENOENT
as it would have if the current directory had been unlinked.

I see that in 2015 the quirk was documented in commit
a2ac97c78b, and this is no longer
true with glibc 2.27, but may continue to be true in other C libraries,
so I reference NOTES from the paragraph in the central text.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-12 13:44:51 +02:00
Michael Kerrisk 169d728330 pthread_create.3: Minor fix: reorder table items
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-05 20:12:18 +02:00
Michael Kerrisk 8efada9938 pthread_create.3: Minor tweaks to Frederic Brault's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-05 20:12:18 +02:00
Frederic Brault af6e958b58 pthread_create.3: Note default thread stack size for several architectures
I am trying to fix a FIXME in the pthread_create.3 manpage.
It says info about default thread stack size should be put in
pthread_attr_setstacksize.3.

And pthread_attr_setstacksize.3 says "For details on the default
stack size of new threads, see pthread_create(3)".

So I list the default values for several architectures, starting
from glibc 2.12 (and still valid on current git glibc).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-05 20:12:07 +02:00
Jann Horn f23ba9ce98 tsearch.3: tdelete() can return dangling pointers
POSIX says that deleting the root node must cause tdelete() to
return some unspecified non-NULL pointer. Glibc implements it by
returning a dangling pointer to the (freed) root node:

$ cat bogus_tdelete.c

static void *root = NULL;

static void *xmalloc(unsigned n) {
    void *p;
    p = malloc(n);
    if (!p)
        err(1, "malloc");
    return p;
}

static int compare(const void *pa, const void *pb) {
    if (*(int *) pa < *(int *) pb)
        return -1;
    if (*(int *) pa > *(int *) pb)
        return 1;
    return 0;
}

int main(void) {
    int *ptr;
    void *val, *parent;

    ptr = xmalloc(sizeof(int));
    *ptr = 1234;
    val = tsearch((void*)ptr, &root, compare);
    assert(*(int**)val == ptr);
    printf("root: %p\n", root);

    parent = tdelete((void*)ptr, &root, compare);
    printf("tdelete return value: %p; new root: %p\n", parent, root);

    return 0;
}
$ gcc -o bogus_tdelete bogus_tdelete.c -std=gnu99 -Wall
$ gdb ./bogus_tdelete
GNU gdb (GDB) 7.9-gg19
[...]
(gdb) break free
Function "free" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (free) pending.
(gdb) run
Starting program: /usr/local/google/home/jannh/tmp/bogus_tdelete
[...]
root: 0x555555756030

Breakpoint 1, 0x00007ffff7ab54e0 in free () from [...]
(gdb) print (void*)$rdi
$1 = (void *) 0x555555756030
(gdb) cont
Continuing.
tdelete return value: 0x555555756030; new root: (nil)
[Inferior 1 (process 56564) exited normally]
(gdb) quit

Therefore, explicitly note that tdelete() may return bad pointers
that must not be accessed.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-03-27 22:29:10 +02:00
Jann Horn f119ba87ea tsearch.3: Clarify items vs nodes
The manpage claimed that tsearch() returns a pointer to a data
item. This is incorrect; tsearch() returns a pointer to the
corresponding tree node, which can also be interpreted as a
pointer to a pointer to the data item.

Since this API is quite unintuitive, also add a clarifying
sentence.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-03-27 22:25:29 +02:00
Michael Kerrisk 517b7ac44a makedev.3: Since glibc 2.28, <sys/types.h> no longer defines these macroa
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-02-19 18:39:15 +01:00
Michael Kerrisk 0512f57cea atexit.3: wfix
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-02-09 07:00:17 +01:00
Mike Frysinger 724127aa2d put(3): fix formatting of trailing period
The period after the function call is incorrectly marked with bold.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-02-04 07:32:04 +01:00
Michael Kerrisk 8538a62b4c iconv.1, bpf.2, copy_file_range.2, fcntl.2, memfd_create.2, mlock.2, mount.2, mprotect.2, perf_event_open.2, pkey_alloc.2, prctl.2, read.2, recvmmsg.2, s390_sthyi.2, seccomp.2, sendmmsg.2, syscalls.2, unshare.2, write.2, errno.3, fgetpwent.3, fts.3, pthread_rwlockattr_setkind_np.3, fuse.4, veth.4, capabilities.7, cgroups.7, ip.7, man-pages.7, namespaces.7, network_namespaces.7, sched.7, socket.7, user_namespaces.7, iconvconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-02-02 07:38:54 +01:00
Michael Kerrisk a25748e649 pthread_mutexattr_setrobust.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:20:46 +01:00
Michael Kerrisk 41a64b30fc dl_iterate_phdr.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:16:04 +01:00
Michael Kerrisk 7de982f8af basename.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:15:08 +01:00
Michael Kerrisk 7ebb909a80 getnameinfo.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 23:03:46 +01:00
Michael Kerrisk 0335565faa resolver.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 22:51:26 +01:00
Michael Kerrisk a2d427c1a6 initgroups.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 22:50:06 +01:00
Michael Kerrisk 7457600f6e getutent.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 22:49:28 +01:00
Michael Kerrisk d0b8a8d817 getmntent.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 22:48:20 +01:00
Michael Kerrisk 0578c69df2 fgetpwent.3: Add missing ATTRIBUTES preamble
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-01-06 22:46:28 +01:00
Michael Kerrisk d2cd45885b errno.3: 'errno -s' can be used to search for errors by string in description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-23 08:43:20 +01:00
Michael Kerrisk 10b6adae8a fts.3: fts_pathlen = strlen(fts_path) + strlen(fts_name)
As noted by Pradeep (and I tested also the code on OpenBSD):

The man page for fts library call states both the following:

     short          fts_pathlen;  /* strlen(fts_path) */

     fts_pathlen The length of the string referenced by fts_path

However, for the structures returned from fts_children() function,
fts_pathlen is strlen(fts_path) + strlen(fts_name), which contradicts
the man page statement. So I believe that there is either a bug in the
man page or the fts_children() library call.

The following program can be used for verification:

int main() {
	struct passwd *pwd_entry = getpwuid(getuid());
	char *paths[] = {pwd_entry->pw_dir, NULL};
	FTS* fts = fts_open(paths, FTS_LOGICAL, NULL);
	FTSENT* ftsent = fts_read(fts);
	FTSENT* child = fts_children(fts, 0);
	while (child != NULL) {
		printf("\n %s %s %d %lu", child->fts_path, child->fts_name,
				child->fts_pathlen, strlen(child->fts_path));
		child = child->fts_link;
	}
	return 0;
}

Reported-by: Pradeep Kumar <pradeepsixer@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-19 07:24:41 +01:00
Michael Kerrisk 3ca4400d74 usleep.3: Minor wording fix
Reported-by: Eric Benton <erbenton@comcast.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-18 17:19:07 +01:00
Michael Kerrisk 6386c0c862 errno.3: Add Linux error text corresponding to ENOMEM
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-16 00:09:16 +01:00
G. Branden Robinson 777411ae61 iconv.1, pthread_rwlockattr_setkind_np.3, man-pages.7, socket.7, iconvconfig.8: Standardize on "nonzero"
Also add this term to the style guide in man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-05 22:27:13 +01:00
roblabla 0f24751222 pthread_mutexattr_init.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-12-05 22:27:06 +01:00
Michael Kerrisk 1c6f59c276 getpid.2, pipe.2, abort.3, daemon.3, pthread_yield.3, stdio.3, sysconf.3, tty.4, shells.5, sysfs.5, fifo.7, hier.7, icmp.7, path_resolution.7, pid_namespaces.7, standards.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-26 12:38:46 +01:00
Michael Kerrisk d2414cb5a1 makedev.3: Minor fixes to Adrian Bunk's patch
Note glibc version where deprecation occurred.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-25 14:23:05 +01:00
Adrian Bunk 1e50980d0f makedev.3: glibc has deprecated exposing the definitions via <sys/types.h>
Compile warning with glibc 2.25:

    warning: In the GNU C Library, "makedev" is defined by
    <sys/sysmacros.h>. For historical compatibility, it is
    currently defined by <sys/types.h> as well, but we plan to
    remove this soon.  To use "makedev", include <sys/sysmacros.h>
    directly. If you did not intend to use a system-defined macro
    "makedev", you should undefine it after including
    <sys/types.h>.

Background: glibc commit dbab6577c6684c62bd2521c1c29dc25c3cac966f

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-25 14:18:41 +01:00
Michael Kerrisk 7d4151a5c3 errno.3: Remove an unnecessary sentence
Reported-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-23 21:24:53 +01:00
Michael Kerrisk b01ecc5e1d errno.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-23 21:24:21 +01:00
Michael Kerrisk 5a99c72245 errno.3: Note the use of perror(3) and strerror(3)
Reported-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-23 10:49:32 +01:00
Michael Kerrisk afde18c00a errno.3: Minor wording change
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-11-23 10:39:59 +01:00