Commit Graph

344 Commits

Author SHA1 Message Date
Michael Kerrisk 3fde8c2e45 memusage.1, pldd.1, sprof.1, add_key.2, bind.2, bpf.2, clone.2, dup.2, epoll_ctl.2, eventfd.2, fanotify_init.2, fanotify_mark.2, futex.2, getdents.2, getpid.2, getrlimit.2, intro.2, ioctl_fat.2, ioctl_ns.2, kcmp.2, keyctl.2, membarrier.2, memfd_create.2, mprotect.2, msgctl.2, msgop.2, nfsservctl.2, open.2, open_by_handle_at.2, openat2.2, outb.2, perf_event_open.2, pivot_root.2, recv.2, recvmmsg.2, request_key.2, sched_setaffinity.2, sched_setattr.2, seccomp.2, select.2, send.2, signalfd.2, spu_run.2, sysctl.2, timer_create.2, userfaultfd.2, wait.2, CPU_SET.3, abs.3, argz_add.3, backtrace.3, bsearch.3, bswap.3, clock_getcpuclockid.3, cmsg.3, dl_iterate_phdr.3, dlinfo.3, dlopen.3, drand48.3, drand48_r.3, duplocale.3, encrypt.3, endian.3, envz_add.3, errno.3, ffs.3, fopencookie.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getline.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, hsearch.3, insque.3, intro.3, lrint.3, lround.3, lseek64.3, mallinfo.3, malloc_hook.3, malloc_info.3, mbsinit.3, mbstowcs.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, perror.3, posix_fallocate.3, posix_spawn.3, printf.3, psignal.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setname_np.3, pthread_sigmask.3, qsort.3, rand.3, random.3, rpc.3, rtnetlink.3, scalbln.3, shm_open.3, stdarg.3, strcat.3, strerror.3, strfmon.3, strptime.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, tsearch.3, wordexp.3, loop.4, vcs.4, veth.4, core.5, locale.5, slabinfo.5, cgroup_namespaces.7, cpuset.7, credentials.7, fanotify.7, feature_test_macros.7, inotify.7, ip.7, kernel_lockdown.7, man.7, mount_namespaces.7, namespaces.7, pid_namespaces.7, rtld-audit.7, sigevent.7, sock_diag.7, standards.7, unix.7, user_namespaces.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:56:08 +01:00
Michael Kerrisk d39ad78f73 _exit.2, access.2, acct.2, brk.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, fsync.2, futimesat.2, getdomainname.2, getgroups.2, gethostname.2, getpagesize.2, getrlimit.2, getsid.2, gettimeofday.2, kill.2, link.2, madvise.2, mincore.2, mkdir.2, mknod.2, nanosleep.2, nice.2, open.2, posix_fadvise.2, pread.2, process_vm_readv.2, readlink.2, readv.2, rename.2, select.2, semop.2, seteuid.2, setpgid.2, setreuid.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigsuspend.2, sigwaitinfo.2, stat.2, stime.2, symlink.2, sync.2, syscall.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, truncate.2, unlink.2, utimensat.2, vfork.2, vhangup.2, wait.2, wait4.2, a64l.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, atoi.3, bsd_signal.3, cbrt.3, ceil.3, cfree.3, clearenv.3, clock_getcpuclockid.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, daemon.3, dirfd.3, div.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, endian.3, erf.3, erfc.3, exec.3, exp.3, exp2.3, expm1.3, fabs.3, fdim.3, ferror.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fopen.3, fpclassify.3, frexp.3, fseeko.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, getaddrinfo.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent_r.3, getopt.3, getpass.3, getprotoent_r.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent_r.3, getservent_r.3, getspnam.3, getsubopt.3, getusershell.3, getw.3, grantpt.3, group_member.3, gsignal.3, hypot.3, ilogb.3, inet.3, inet_net_pton.3, initgroups.3, insque.3, isalpha.3, isfdtype.3, isgreater.3, iswblank.3, j0.3, killpg.3, ldexp.3, lgamma.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, malloc.3, mbsnrtowcs.3, memchr.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mq_receive.3, mq_send.3, nan.3, newlocale.3, nextafter.3, nl_langinfo.3, on_exit.3, open_memstream.3, opendir.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, pow.3, printf.3, profil.3, psignal.3, pthread_attr_setstack.3, pthread_cleanup_push_defer_np.3, pthread_kill.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_spin_init.3, pthread_spin_lock.3, ptsname.3, putenv.3, putpwent.3, qecvt.3, qsort.3, rand.3, random.3, random_r.3, rcmd.3, readdir_r.3, realpath.3, remainder.3, remquo.3, rint.3, round.3, rpmatch.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_wait.3, setbuf.3, setenv.3, setjmp.3, setnetgrent.3, siginterrupt.3, signbit.3, significand.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sockatmark.3, sqrt.3, stpcpy.3, stpncpy.3, strdup.3, strerror.3, strfromd.3, strnlen.3, strsep.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, syslog.3, tan.3, tanh.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpnam.3, toascii.3, toupper.3, towlower.3, towupper.3, trunc.3, ttyslot.3, tzset.3, ualarm.3, unlocked_stdio.3, unlockpt.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wordexp.3, wprintf.3, y0.3: srcfix: use better macros in SYNOPSIS
Around the text:
"Feature Test Macro Requirements for glibc..."
replace ".in -4n/.in" with ".RS -4/.RE".
The latter form is more idiomatic use of man macros.
The nroff output is unchanged.

Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 15:12:12 +02:00
Michael Kerrisk 89de1a399e open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:02:29 +02:00
Michael Kerrisk 836a5bbf02 open.2: ERRORS: EBUSY
An EBUSY error case is mentioned in DESCRIPTIOn; add it to ERRORS
also.

See also https://bugzilla.kernel.org/show_bug.cgi?id=209109

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

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:11 +02:00
Michael Kerrisk 0629df8b96 open.2, proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-31 22:32:59 +02:00
Michael Kerrisk 901c8ecf7c open.2: Say a bit more about what happens when 'mode' is wrongly omitted
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:26:38 +02:00
Michael Kerrisk 88f463a9be open.2: Minor wording fixes
Add some paragraph breaks to the discussion of 'mode' to make
the details a bit easier to read.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:16:16 +02:00
Michael Kerrisk 7f4e971631 open.2: srcfix: use saner macros to achieve same formatting effect
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:14:41 +02:00
Michael Kerrisk 313fb52719 open.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:42:33 +02:00
Bjarni Ingi Gislason 2c1acf16da man2/*: ffix: change '-' to '\-' for options
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-02 12:20:04 +02:00
Bjarni Ingi Gislason fec6cf90e9 man2/*: srcfix: fix warnings from "mandoc -Tlint"
Remove superfluous paragraph macros.

  Remove ".br" if it is before a line that starts with a space
character, as such lines automatically cause a break.

###

  The output is unchanged, except two empty lines are added at the
bottom (before the footer line) in the output of "nroff" for the files
"alloc_hugepages.2" and "userfaultfd.2".

###

  Examples of warnings from "mandoc -Tlint":

mandoc: access.2:283:2: WARNING: skipping paragraph macro: PP after SH

mandoc: adjtimex.2:185:2: WARNING: skipping paragraph macro: PP empty

mandoc: futex.2:728:2: WARNING: skipping paragraph macro: IP empty

mandoc: getsid.2:48:2: WARNING: skipping paragraph macro: br before text line with leading blank

mandoc: init_module.2:290:2: WARNING: skipping paragraph macro: PP after SS

mandoc: ioctl_fideduperange.2:27:2: WARNING: skipping paragraph macro: br after SH

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-21 09:08:00 +02:00
Michael Kerrisk 9bfc9cb197 dup.2, fallocate.2, futex.2, ioctl_fat.2, ioctl_ficlonerange.2, 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-11 07:45:09 +02:00
Michael Kerrisk da16ac098d open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:53:47 +02:00
Michael Kerrisk bffbb22fda iconv.1, locale.1, memusage.1, memusagestat.1, pldd.1, sprof.1, _syscall.2, 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-09 14:48:40 +02:00
Michael Kerrisk c8fb1c6d4a gettid.2, open.2, seccomp.2, pthread_mutex_consistent.3, signal.7, xattr.7: Put SEE ALSO entries in alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:23:34 +02:00
Michael Kerrisk 4146f81b7d open.2: Some '*at' APIs have functionality that isn't in conventional APIs
Note that another reason to use the *at() APIs is to access
'flags' functionality that is not available in the corresponding
conventional APIs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 09:43:01 +02:00
Michael Kerrisk 96c44b8f50 open.2: Explain ways in which a 'directory file descriptor' can be obtained
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 08:45:06 +02:00
Michael Kerrisk aec13430b1 open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 08:03:52 +02:00
Michael Kerrisk 5c30e7cd9d open.2: Add a few more APIs to list in "Rationale for openat()..."
There have been a few more dirfd APIs added in recent times.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 07:43:41 +02:00
Michael Kerrisk 34aeffa286 open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-21 20:51:58 +02:00
Michael Kerrisk 510adbed8e open.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-21 16:31:23 +02:00
Michael Kerrisk e64c566c57 open.2: Add openat2() to list of APIs that take a 'dirfd' argument
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-21 16:26:51 +02:00
Michael Kerrisk 53dcd8d262 open.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-19 21:59:43 +02:00
Michael Kerrisk d9e7db1b39 open.2: Tweaks to Joseph Sible's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Joseph C. Sible 2ddf885a4f open.2: Document fs.protected_fifos and fs.protected_regular
The sysctls fs.protected_fifos and fs.protected_regular can cause
open(2) to fail with EACCES (see Documentation/sysctl/fs.rst for
details.)

Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk ed09120acd accept.2, epoll_create.2, inotify_add_watch.2, open.2, open_by_handle_at.2, pidfd_open.2, dirfd.3, posix_openpt.3, shm_open.3: Fix clumsy wording around "nonnegative file descriptors"
Reported-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-10 09:41:55 +02:00
Michael Kerrisk ed6fe0056d open.2: Note EINVAL error for invalid character in basename of 'pathname'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-06 11:37:01 +02:00
Michael Kerrisk 7a11fc63b8 open.2: Clarify that O_NOFOLLOW is relevant (only) for basename of 'pathname'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-03-30 12:32:07 +02:00
Michael Kerrisk 4b322a2fc8 open.2: Minor tweaks to Aleksa Sarai's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-03-30 08:45:58 +02:00
Aleksa Sarai a2dbb2e378 open.2: Add references to new openat2(2) page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-03-30 08:37:02 +02:00
Michael Kerrisk 6b621d05b3 _exit.2, capget.2, fcntl.2, futex.2, listen.2, memfd_create.2, modify_ldt.2, move_pages.2, open.2, perf_event_open.2, ptrace.2, set_thread_area.2, stime.2, syscall.2, sysctl.2, userfaultfd.2, cmsg.3, exit.3, ftime.3, getpt.3, malloc.3, console_codes.4, loop.4, inotify.7, netlink.7, packet.7, rtnetlink.7, tcp.7, unix.7, vsock.7, ldconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-09 11:53:28 +01:00
Michael Kerrisk a2587fbb2e open.2: In O_TMPFILE example, describe alternative linkat() call
This was already shown in an earlier version of the page,
but Adam Borowski's patch replaced it with an alternative.
Probably, it is better to show both possibilities.

Reported-by: "Joseph C. Sible" <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:59:34 +01:00
Adam Borowski fc29a199d9 open.2: No need for /proc to make an O_TMPFILE file permanent
In the example snippet, we already have the fd, thus there's no
need to refer to the file by name.  And, /proc/ might be not
mounted or not accessible.

Noticed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-02-07 17:30:45 +01:00
Michael Kerrisk f3fdbe2812 open.2: tfix
Reported-by: Дилян Палаузов <dilyan.palauzov@aegee.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-09-24 12:16:07 +02:00
Michael Kerrisk 352c4c5ca6 open.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:42:35 +13:00
Eugene Syromiatnikov 6deb3733ac open.2: Mention presence of unused O_RSYNC definition
O_RSYNC is defined in <asm/fcntl.h> on HP PA-RISC, but is not
used anyway.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:35:10 +13:00
Michael Kerrisk d40e0bfc27 open.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:34:38 +13:00
Michael Kerrisk 319e9b31ed open.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:32:39 +13:00
Eugene Syromiatnikov 8132c11589 open.2: Document FASYNC usage in Linux UAPI headers
Linux's <asm/fcntl.h> defines FASYNC instead of O_ASYNC; document
this peculiarity.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:30:47 +13:00
Michael Kerrisk 115bbafa8b open.2: Minor fix: split distinct ENOENT cases into separate list entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-28 21:48:59 +02:00
Michael Kerrisk 8b5bbcfabc open.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Lucas Werkmeister 71b12d0a57 open.2: Document ENXIO for sockets
Linux returns ENXIO when attempting to open() a UNIX domain socket.
Kernel-wise, I believe this happens in fs/inode.c [1], where a constant
`no_open` function returning -ENXIO is registered as the default open()
handler for inodes in inode_init_always(), and is not specialized in
nit_special_inode() as it is for other types.

Seen in the systemd v238 source code [2].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/inode.c?h=v4.16
[2]: https://github.com/systemd/systemd/blob/v238/src/core/execute.c#L412

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Michael Kerrisk 3897a3f89f open.2: Clarify a special use case of O_NONBLOCK for devices
The wording is a little confusing, suggesting that this is
the primary use of O_NONBLOCK. Fix that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:56:16 +02:00
Michael Kerrisk f2a110725b open.2: Clarify that O_NONBLOCK has no effect on poll/epoll/select
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:25:53 +02:00
Michael Kerrisk b0972b3b05 open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:14:49 +02:00
Andrew Price abd34f349d open.2: Remove O_DIRECT-related quotation
Remove a section that adds no benefit to the discussion of O_DIRECT.

Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-06 09:29:46 +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
Jakub Wilk 8e13d56651 open.2: Add missing argument for snprintf() in example code
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-04-27 14:02:47 +02:00
Jann Horn 19d371260e open.2: Document more -ETXTBSY conditions
The first one happens in
do_filp_open -> path_openat -> do_last -> handle_truncate -> do_truncate
-> notify_change -> simple_setattr -> setattr_prepare -> inode_newsize_ok.

Demo:

[...]
[...]
[...]
open("/x", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ETXTBSY (Text file busy)
[...]
[...]
open("/x", O_WRONLY|O_CREAT, 0666)      = 3
dup2(3, 1)                              = 1
close(3)                                = 0
read(0, "\0\0\0\0[...]"..., 512) = 512
write(1, "\0\0\0\0[...]"..., 512) = 512
[...]

The second one is in kernel_read_file -> deny_write_access.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-03-27 22:19:49 +02:00