Compare commits

..

No commits in common. "master" and "man-pages-5.11" have entirely different histories.

269 changed files with 2771 additions and 8510 deletions

13
.gitignore vendored
View File

@ -1,13 +0,0 @@
# Ignore everything new by default
/*
# Ignore everything in man?/ that doesn't follow conventions (e.g., tmp files)
!/man?/
/man?/*
!/man?/*.[1-8]
# These files change name in each release
!/man-pages*.Announce
!/man-pages*.lsm
!/scripts/

819
Changes
View File

@ -1,6 +1,6 @@
==================== Changes in man-pages-5.14 ====================
==================== Changes in man-pages-5.11 ====================
Released: ????-??-??, Munich
Released: 2021-03-21, Munich
Contributors
@ -10,6 +10,48 @@ The following people contributed patches/fixes or (noted in brackets
in the changelog below) reports, notes, and ideas that have been
incorporated in changes in this release:
Alejandro Colomar <alx.manpages@gmail.com>
Alessandro Bono <alessandro.bono369@gmail.com>
Alyssa Ross <hi@alyssa.is>
Bastien Roucariès <rouca@debian.org>
Bruno Haible <bruno@clisp.org>
Christian Brauner <christian.brauner@ubuntu.com>
Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
Dmitry V. Levin <ldv@altlinux.org>
Dmitry Vorobev <dvorobev@cloudflare.com>
edef <edef@edef.eu>
Enke Chen <enkechen2020@gmail.com>
Gabriel Krisman Bertazi <krisman@collabora.com>
Ganimedes Colomar <gacoan.linux@gmail.com>
Jakub Wilk <jwilk@jwilk.net>
Jan Kara <jack@suse.cz>
Jens Axboe <axboe@kernel.dk>
Johannes Pfister <johannes.pfister@josttech.ch>
Johannes Wellhöfer <johannes.wellhofer@gmail.com>
John Morris <john@zultron.com>
Jonathan Wakely <jwakely@redhat.com>
Jonny Grant <jg@jguk.org>
Manfred Spraul <manfred@colorfullife.com>
Michael Kerrisk <mtk.manpages@gmail.com>
Michal Hocko <mhocko@suse.com>
Minchan Kim <minchan@kernel.org>
Pádraig Brady <P@draigBrady.com>
Pali Rohár <pali@kernel.org>
Palmer Dabbelt <palmerdabbelt@google.com>
Paran Lee <p4ranlee@gmail.com>
Peter H. Froehlich <peter.hans.froehlich@gmail.com>
Philipp Schuster <phip1611@gmail.com>
Stephen Kitt <steve@sk2.org>
Steve Grubb <sgrubb@redhat.com>
Suren Baghdasaryan <surenb@google.com>
Szunti <szunti@gmail.com>
Valentin Kettner <vakevk@gmail.com>
Vincent Lefevre <vincent@vinc17.net>
Walter Franzini <walter.franzini@gmail.com>
Walter Harms <wharms@bfs.de>
Willem de Bruijn <willemb@google.com>
Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Zack Weinberg <zackw@panix.com>
Apologies if I missed anyone!
@ -17,19 +59,792 @@ Apologies if I missed anyone!
New and rewritten pages
-----------------------
close_range.2
Stephen Kitt, Michael Kerrisk [Christian Brauner]
New page documenting close_range(2)
process_madvise.2
Suren Baghdasaryan, Minchan Kim [Michal Hocko, Alejandro Colomar,
Michael Kerrisk]
Document process_madvise(2)
fileno.3
Michael Kerrisk
Split fileno(3) content out of ferror(3) into new page
fileno(3) differs from the other functions in various ways.
For example, it is governed by different standards,
and can set 'errno'. Conversely, the other functions
are about examining the status of a stream, while
fileno(3) simply obtains the underlying file descriptor.
Furthermore, splitting this function out allows
for some cleaner upcoming changes in ferror(3).
Newly documented interfaces in existing pages
---------------------------------------------
epoll_wait.2
Willem de Bruijn [Dmitry V. Levin]
Add documentation of epoll_pwait2()
Expand the epoll_wait() page with epoll_pwait2(), an epoll_wait()
variant that takes a struct timespec to enable nanosecond
resolution timeout.
fanotify_init.2
fanotify.7
Jan Kara [Steve Grubb]
Document FAN_AUDIT flag and FAN_ENABLE_AUDIT
madvise.2
Michael Kerrisk
Add descriptions of MADV_COLD and MADV_PAGEOUT
Taken from process_madvise(2).
openat2.2
Jens Axboe
Add RESOLVE_CACHED
prctl.2
Gabriel Krisman Bertazi
Document Syscall User Dispatch
mallinfo.3
Michael Kerrisk
Document mallinfo2() and note that mallinfo() is deprecated
Document the mallinfo2() function added in glibc 2.33.
Update example program to use mallinfo2()
system_data_types.7
Alejandro Colomar
Add off64_t to system_data_types(7)
ld.so.8
Michael Kerrisk
Document the --argv0 option added in glibc 2.33
New and changed links
---------------------
epoll_pwait2.2
Dmitry V. Levin
New link to epoll_wait(2)
mallinfo2.3
Michael Kerrisk
New link to mallinfo(3)
off64_t.3
Alejandro Colomar
New link to system_data_types(7)
Global changes
--------------
Various pages
Alejandro Colomar
SYNOPSIS: Use 'restrict' in prototypes
This change has been completed for *all* relevant pages
(around 135 pages in total).
Various pages
Alejandro Colomar [Zack Weinberg]
Remove unused <sys/types.h>
The manual pages are already inconsistent in which headers need
to be included. Right now, not all of the types used by a
function have their required header included in the SYNOPSIS.
If we were to add the headers required by all of the types used by
functions, the SYNOPSIS would grow too much. Not only it would
grow too much, but the information there would be less precise.
Having system_data_types(7) document each type with all the
information about required includes is much more precise, and the
info is centralized so that it's much easier to maintain.
So let's document only the include required for the function
prototype, and also the ones required for the macros needed to
call the function.
<sys/types.h> only defines types, not functions or constants, so
it doesn't belong to man[23] (function) pages at all.
I ignore if some old systems had headers that required you to
include <sys/types.h> *before* them (incomplete headers), but if
so, those implementations would be broken, and those headers
should probably provide some kind of warning. I hope this is not
the case.
[mtk: Already in 2001, POSIX.1 removed the requirement to
include <sys/types.h> for many APIs, so this patch seems
well past due.]
A few pages
Alejandro Colomar
Add notes about missing glibc wrappers
_exit.2
abort.3
err.3
exit.3
pthread_exit.3
setjmp.3
Alejandro Colomar
SYNOPSIS: Use 'noreturn' in prototypes
Use standard C11 'noreturn' in these manual page for
functions that do not return.
Various pages
Ganimedes Colomar [Alejandro Colomar]
Normalize SYNOPSIS notes about nonexistent glibc wrappers
To easily distinguish documentation about glibc wrappers from
documentation about kernel syscalls, let's have a normalized
'Note' in the SYNOPSIS, and a further explanation in the page body
(NOTES in most of them), as already happened in many (but not all)
of the manual pages for syscalls without a wrapper. Furthermore,
let's normalize the messages, following membarrier.2 (because it's
already quite extended), so that it's easy to use grep to find
those pages.
Normalize NOTES about nonexistent glibc wrappers
This commit normalizes texts under sections other than SYNOPSIS
(most of them in NOTES).
Global changes (formatting fixes and minor edits)
-------------------------------------------------
Various pages
Michael Kerrisk
ERRORS: remove redundant statement that 'errno' is set
This is implied in every other manual page. There is no need to
state it explicitly in these pages.
Various pages
Michael Kerrisk
Use periods more consistently inside code comments
In general, complete sentences in free-standing comments
should be terminated by periods.
A few pages
Michael Kerrisk
Better table formatting
In particular, allow for rendering in widths different from
(especially less than) 80 columns.
Various pages
Michael Kerrisk
Consistency fix-up in FTMs
Generally, place '||' at start of a line, rather than the end of
the previous line.
Rationale: this placement clearly indicates that that each piece
is an alternative.
Various pages
Michael Kerrisk [Alejandro Colomar]
Bring more whitespace consistency in SYNOPSIS
The use of vertical white space in the SYNOPSIS sections
is rather inconsistent. Make it more consistent, subject to the
following heuristics:
* Prefer no blank lines between function signatures by default.
* Where many functions are defined in the SYNOPSIS, add blank
lines where needed to improve readability, possibly by using
blank lines to separate logical groups of functions.
Various pages
Alejandro Colomar
Consistently use 'unsigned int'
Most pages use 'unsigned int' (and the kernel too).
Make them all do so.
Various pages
Michael Kerrisk
Various improvements in wording in RETURN VALUE
Various pages
Michael Kerrisk
s/Glibc versions </Glibc </ in Feature Test Macro discussions
Use a more compact notation that will render less wide
on the terminal.
Various pages
Michael Kerrisk
Standardize wording around setting of 'errno' on error
In the RETURN VALUE sections, a number of different wordings
are used in to describe the fact that 'errno' is set on error.
There's no reason for the difference in wordings, since the same
thing is being described in each case. Switch to a standard
wording that is the same as FreeBSD and similar to the wording
used in POSIX.1.
In this change, "to indicate the cause of the error"
is changed to "to indicate the error".
Various pages
Michael Kerrisk
Add missing .nf/.fi in FTM info
Various pages
Michael Kerrisk
Simplify mark-up for Feature Test Macro requirements
Different source styles are used in different pages to achieve the
same formatted output, and in some cases the source mark-up is a
rather convoluted combination of .RS/.RE/.TP/.PD macros. Simplify
this greatly, and unify all of the pages to use more or less the
same source code style. This makes the source code rather easier
to read, and may simplify future scripted global changes.
The feature test macro info is currently bracketed by .nf/.fi
pairs. This is not strictly necessary (i.e., it makes no
difference to the rendered output), but for the moment we keep
these "brackets" in case they may be replaced with something else.
Various pages
Michael Kerrisk
Use real minus signs in pathnames
Various pages
Michael Kerrisk
Standardize wording around setting of 'errno' on error
In the RETURN VALUE sections, a number of different wordings
are used in to describe the fact that 'errno' is set on error.
There's no reason for the difference in wordings, since the same
thing is being described in each case. Switch to a standard
wording that is the same as FreeBSD and similar to the wording
used in POSIX.1.
In this change, reword various cases saying that 'errno' is set
"appropriately" to "is set to indicate the error".
Various pages
Michael Kerrisk
Improve formatting in ATTRIBUTES
Make the formatting more consistent inside the tables in the
ATTRIBUTES sections. Make the source code more uniform; in
particular, eliminate the use of custom tweaks using
'lbwNN'/'lwNN' and .br macros. In addition, ensure that
hyphenation and text justification do not occur inside the tables.
Various pages
Michael Kerrisk
Use .nf/.fi in SYNOPSIS
The majority of pages use .nf/.fi in SYNOPSIS, but there are
still many that don't and use .br to achieve newlines. Fix many
of those. This brings greater consistency to the pages, which
eases editing and may ease future scripted edits to the pages.
Various pages
Michael Kerrisk
Standardize wording around setting of 'errno' on error
In the RETURN VALUE sections, a number of different wordings
are used in to describe the fact that 'errno' is set on error.
There's no reason for the difference in wordings, since the same
thing is being described in each case. Switch to a standard
wording that is the same as FreeBSD and similar to the wording
used in POSIX.1.
In this change, miscellaneous descriptions of the setting
of 'errno' are reworded to the norm of "is set to indicate
the error".
Various pages
Michael Kerrisk
Use "\-" to generate real minus in circumstances where appropriate
Use \- for math formulas, pathnames, manual page cross references,
etc.
Various pages
Michael Kerrisk
Inside code blocks (.EX/.EE) use \- to get real minus signs
A real minus can be cut and pasted...
Various pages
Alejandro Colomar
Remove explicit blank lines, replacing them with .PP when appropriate
Various pages
Michael Kerrisk
Use internally consistent continuation indents in SYNOPSIS
In the SYNOPSIS, a long function prototype may need to be
continued over to the next line. The continuation line is
indented according to the following rules:
1. If there is a single such prototype that needs to be continued,
then align the continuation line so that when the page is
rendered on a fixed-width font device (e.g., on an xterm) the
continuation line starts just below the start of the argument
list in the line above. (Exception: the indentation may be
adjusted if necessary to prevent a very long continuation line
or a further continuation line where the function prototype is
very long.)
Thus:
int tcsetattr(int fd, int optional_actions,
const struct termios *termios_p);
2. But, where multiple functions in the SYNOPSIS require
continuation lines, and the function names have different
lengths, then align all continuation lines to start in the
same column. This provides a nicer rendering in PDF output
(because the SYNOPSIS uses a variable width font where
spaces render narrower than most characters).
Thus:
int getopt(int argc, char * const argv[],
const char *optstring);
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);
Various pages
Michael Kerrisk
Standardize wording around setting of 'errno' on error
In the RETURN VALUE sections, a number of different wordings
are used in to describe the fact that 'errno' is set on error.
There's no reason for the difference in wordings, since the same
thing is being described in each case. Switch to a standard
wording that is the same as FreeBSD and similar to the wording
used in POSIX.1.
In this change, fix some instances stating that 'errno' is set
"appropriately" to instead say "to indicate the error".
Various System V IPC pages
Michael Kerrisk
Improve wording describing RETURN VALUE and setting of 'errno'
Changes to individual pages
---------------------------
alloc_hugepages.2
Michael Kerrisk
CONFORMING TO: reword to reflect that these system calls are long gone
cacheflush.2
Alejandro Colomar
Update SYNOPSIS for glibc wrapper
Glibc uses 'void *' instead of 'char *'.
And the prototype is declared in <sys/cachectl.h>.
clone.2
Valentin Kettner
Fix types in clone_args
A file descriptor is an int so it should be stored through an int
pointer while parent_tid should have the same type as child_tid
which is pid_t pointer.
close.2
Michael Kerrisk
SEE ALSO: add close_range(2)
copy_file_range.2
Alejandro Colomar
Document glibc wrapper instead of kernel syscall
Glibc uses 'off64_t' instead of 'loff_t'.
delete_module.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter types
The Linux kernel uses 'unsigned int' instead of 'int' for the
'flags' parameter. As glibc provides no wrapper, use the same
type the kernel uses.
epoll_create.2
Michael Kerrisk
CONFORMING TO: mention that epoll_create1() is Linux-specific
epoll_wait.2
Michael Kerrisk
CONFORMING TO: mention that epoll_pwait() is Linux-specific
execve.2
Palmer Dabbelt
Correct the versions of Linux that don't have ARG_MAX argv/envp size
execveat.2
Alejandro Colomar
Fix prototype
It's been 6 years since execveat(2) was added to the kernel,
and there's still no glibc wrapper. Let's document the kernel
syscall prototype.
getcpu.2
Michael Kerrisk [Alejandro Colomar]
Rewrite page to describe glibc wrapper function
Since glibc 2.29, there is a wrapper for getcpu(2).
The wrapper has only 2 arguments, omitting the unused
third system call argument. Rework the manual page
to reflect this.
getgid.2
getuid.2
Michael Kerrisk
Note that these interfaces never modify 'errno'
See https://www.austingroupbugs.net/view.php?id=511
and the POSIX.1-2008 specifications of the interfaces.
gethostname.2
Michael Kerrisk
Update FTM requirements for gethostname()
getpagesize.2
getdtablesize.3
Michael Kerrisk
Update/correct FTM requirements
getrusage.2
Michael Kerrisk
Starting in 2.33, glibc no longer provides vtimes()
ioctl_tty.2
Michael Kerrisk
Reformat argument type information
The current mark-up renders poorly. To resolve this, move
the type information into a separate line.
ipc.2
Alejandro Colomar
Fix prototype parameter types
kcmp.2
Michael Kerrisk
Since Linux 5.12, kcmp() availability is unconditional
kcmp() is no longer dependent on CONFIG_CHECKPOINT_RESTORE.
keyctl.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter types
The Linux kernel uses 'unsigned long'.
There's no reason to use the typedef '__kernel_ulong_t'.
lookup_dcookie.2
Alejandro Colomar
Use standard types: u64 -> uint64_t
madvise.2
Michael Kerrisk
SEE ALSO: add process_madvise(2)
mlock.2
Alejandro Colomar
mlock2(): Fix prototype parameter types
The documented prototype for mlock2() was a mix of the
glibc wrapper prototype and the kernel syscall prototype.
Let's document the glibc wrapper prototype, which is shown below.
Michael Kerrisk
CONFORMING TO: note more explicitly which APIs are in the standards
mmap2.2
Alejandro Colomar
Fix prototype parameter types
There are many slightly different prototypes for this syscall,
but none of them is like the documented one.
Of all the different prototypes,
let's document the asm-generic one.
mount.2
Michael Kerrisk
Note that the 'data' argument can be NULL
move_pages.2
Alejandro Colomar
Add notes about missing glibc wrappers
open.2
rename.2
Alyssa Ross
Refer to tmpfs rather than shmem
If I'm understanding correctly, tmpfs is a filesystem built on
shmem, so I think it's more correct (and probably much more
widely understandable) to refer to tmpfs here.
pciconfig_read.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter types
Use the glibc prototypes instead of the kernel ones.
Exception: use 'int' instead of 'enum'.
pidfd_open.2
Michael Kerrisk
Note the process_madvise(2) use case for PID file descriptors
readlink.2
Michael Kerrisk [Jonny Grant]
Emphasize that the returned buffer is not null-terminated
s390_pci_mmio_write.2
Alejandro Colomar
SYNOPSIS: Add 'const' qualifier
s390_pci_mmio_write() uses 'const void *' instead of 'void *'.
sched_setattr.2
Alejandro Colomar
Add note about missing glibc wrappers
semctl.2
Yang Xu [Alejandro Colomar, Manfred Spraul]
Correct SEM_STAT_ANY description
socketcall.2
Alejandro Colomar
Add note about missing glibc wrapper
splice.2
Alejandro Colomar
Use 'off64_t' instead of 'loff_t'
The kernel syscall uses 'loff_t', but the glibc wrapper uses 'off64_t'.
Let's document the wrapper prototype, as in other pages.
spu_create.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter type
The 'flags' parameter of spu_create() uses 'unsigned int'.
spu_run.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter types
The 2nd and 3rd parameters of spu_run() use 'uint32_t *'.
stat.2
Jonathan Wakely [Alejandro Colomar]
Remove <unistd.h> from SYNOPSIS
There seems to be no reason <unistd.h> is shown here, so remove it.
Michael Kerrisk
Move the obsolete _BSD_SOURCE FTM to the end of the FTM info
syscall.2
Peter H. Froehlich
Update superh syscall convention
syscalls.2
Michael Kerrisk
Add epoll_pwait2()
tkill.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter types
All but the last parameters of t[g]kill() use 'pid_t',
both in the kernel and glibc.
vmsplice.2
Alejandro Colomar
SYNOPSIS: Fix prototype parameter type
The 3rd parameter of vmsplice() uses 'size_t' in glibc.
bstring.3
Michael Kerrisk
SEE ALSO: add string(3)
circleq.3
list.3
slist.3
stailq.3
tailq.3
Alejandro Colomar
Improve readability, especially in SYNOPSIS
circleq.3
Alejandro Colomar
Fix CIRCLEQ_LOOP_*() return type
crypt.3
Michael Kerrisk
Reformat FTM info (in preparation for next patch)
Michael Kerrisk
Update crypt() FTM requirements to note glibc 2.28 changes
ecvt.3
gcvt.3
Michael Kerrisk
Update FTM requirements
error.3
Michael Kerrisk [Alejandro Colomar, Walter Harms]
Clarify the meaning of 'status==0' for error(3)
ferror.3
Michael Kerrisk
Remove fileno(3) content that was migrated to new fileno(3) page
Michael Kerrisk
Add a RETURN VALUE section
Michael Kerrisk
POSIX.1-2008: these functions won't change 'errno' if 'stream' is valid
See https://www.austingroupbugs.net/view.php?id=401.
fread.3
Alessandro Bono
EXAMPLES: swap size and nmemb params
It works both ways, but this one feels more right. We are reading
four elements sizeof(*buffer) bytes each.
fseeko.3
Michael Kerrisk
Move info about obsolete FTM from SYNOPSIS to NOTES
This makes the SYNOPSIS more consistent with other pages.
ftime.3
Michael Kerrisk
glibc 2.33 has removed ftime()
ftw.3
Alejandro Colomar
SYNOPSIS: Remove duplicate header
gethostbyname.3
Michael Kerrisk
Move mention of <sys/socket.h> from SYNOPSIS to DESCRIPTION
The functions are all declared in <netdb.h>. <sys/socket.h> is only
needed for the AF_* constants.
gethostid.3
Michael Kerrisk
Update FTM requirements for gethostid()
get_phys_pages.3
Alejandro Colomar [Jakub Wilk]
glibc gets the info from sysinfo(2) since 2.23
grantpt.3
ptsname.3
unlockpt.3
Michael Kerrisk
Remove mention of _XOPEN_SOURCE_EXTENDED FTM
This rather ancient FTM is not mentioned in other pages for
reasons discussed in feature_test_macros(7). Remove this FTM
from the three pages where it does appear.
malloc.3
Alejandro Colomar [Johannes Pfister]
Document that realloc(p, 0) is specific to glibc and nonportable
malloc_hook.3
Alejandro Colomar
SYNOPSIS: Use 'volatile' in prototypes
malloc_trim.3
Dmitry Vorobev
Remove mention of free() call
'malloc_trim' was and is never called from the 'free' function.
pthread_create.3
Michael Kerrisk [Paran Lee]
Fix undeclared variable error in example program
Michael Kerrisk
Fix a signedness error in the example code
puts.3
Michael Kerrisk
Reorder functions more logically (group related functions together)
qecvt.3
Michael Kerrisk
Update feature test macro requirements
setbuf.3
Michael Kerrisk
POSIX doesn't require errno to be unchanged after successful setbuf()
See https://www.austingroupbugs.net/view.php?id=397#c799
setlocale.3
Michael Kerrisk [Alejandro Colomar, Bruno Haible]
Restructure a particularly difficult sentence
simpleq.3
stailq.3
queue.7
SIMPLEQ_*.3
Alejandro Colomar
Document SIMPLEQ_*() as an alias to STAILQ_*() macros
strerror.3
Alejandro Colomar
strerrorname_np() and strerrordesc_np() first appeared on glibc 2.32
string.3
Michael Kerrisk
SEE ALSO: add bstring(3)
system.3
Alejandro Colomar [Ciprian Dorin Craciun]
Document bug and workaround when the command name starts with a hyphen
environ.7
Bastien Roucariès
Reorder the text
Move the the text describing how to set environment variable before
the list(s) of variables in order to improve readability.
Bastien Roucariès
Document convention of string in environ
Document the name=value system and that nul byte is forbidden.
Bastien Roucariès
Document that HOME, LOGNAME, SHELL, USER are set at login time
and point to the su(1) manual page.
Bastien Roucariès
Add see also ld.so(8) for LD_ variables
Michael Kerrisk [Bastien Roucariès]
Improve the description of PATH
Add more details of how PATH is used, and mention the legacy
use of an empty prefix.
Bastien Roucariès [Alejandro Colomar, Bastien Roucaries, Vincent Lefevre]
Document valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
Michael Kerrisk [Bastien Roucariès]
Note the default if PAGER is not defined
Michael Kerrisk
Be a little more precise when discussing 'exec'
Say "execve(2)" instead of "exec(3)", and note that this step
starts a new program (not a new process!).
Michael Kerrisk [Bastien Roucariès]
Relocate and reword the mention of _GNU_SOURCE
man-pages.7
Michael Kerrisk
Document "acknowledgement" as the preferred spelling
Michael Kerrisk
Add some notes on comments in example code
Michael Kerrisk
Add a FORMATTING AND WORDING CONVENTIONS section
In man-pages-5.11, a large number of pages were edited to achieve
greater consistency in the SYNOPIS, RETURN VALUE and ATTRIBUTES
sections. To avoid future inconsistencies, try to capture some of
the preferred conventions in text in man-pages(7).
Michael Kerrisk
Note some rationale for the use of real minus signs
netdevice.7
Pali Rohár [Alejandro Colomar]
Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR
netlink.7
Pali Rohár [Alejandro Colomar]
Fix minimal Linux version for NETLINK_CAP_ACK
NETLINK_CAP_ACK option was introduced in commit 0a6a3a23ea6e which first
appeared in Linux version 4.3 and not 4.2.
Pali Rohár [Alejandro Colomar]
Remove IPv4 from description
rtnetlink is not only used for IPv4
Philipp Schuster
Clarify details of netlink error responses
Make it clear that netlink error responses (i.e., messages with
type NLMSG_ERROR (0x2)), can be longer than sizeof(struct
nlmsgerr). In certain circumstances, the payload can be longer.
shm_overview.7
Michael Kerrisk
SEE ALSO: add memfd_create(2)
sock_diag.7
Pali Rohár [Alejandro Colomar]
Fix recvmsg() usage in the example
tcp.7
Enke Chen
Documentation revision for TCP_USER_TIMEOUT
uri.7
Michael Kerrisk
Note that 'logical' quoting is the norm in Europe

File diff suppressed because it is too large Load Diff

275
Makefile
View File

@ -1,260 +1,35 @@
########################################################################
# Copyright (C) 2021 Alejandro Colomar <alx.manpages@gmail.com>
# SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
########################################################################
# Conventions:
#
# - Follow "Makefile Conventions" from the "GNU Coding Standards" closely.
# However, when something could be improved, don't follow those.
# - Uppercase variables, when referring files, refer to files in this repo.
# - Lowercase variables, when referring files, refer to system files.
# - Variables starting with '_' refer to absolute paths, including $(DESTDIR).
# - Variables ending with '_' refer to a subdir of their parent dir, which
# is in a variable of the same name but without the '_'. The subdir is
# named after this project: <*/man>.
# - Variables ending in '_rm' refer to files that can be removed (exist).
# - Variables ending in '_rmdir' refer to dirs that can be removed (exist).
# - Targets of the form '%-rm' remove their corresponding file '%'.
# - Targets of the form '%/.-rmdir' remove their corresponding dir '%/'.
# - Targets of the form '%/.' create their corresponding directory '%/'.
# - Every file or directory to be created depends on its parent directory.
# This avoids race conditions caused by `mkdir -p`. Only the root
# directories are created with parents.
# - The 'FORCE' target is used to make phony some variables that can't be
# .PHONY to avoid some optimizations.
#
########################################################################
DESTDIR=
prefix?=/usr
MANDIR=$(prefix)/share/man
MAKEFLAGS += --no-print-directory
MAKEFLAGS += --silent
MAKEFLAGS += --warn-undefined-variables
all: remove install
htmlbuilddir := $(CURDIR)/.html
HTOPTS :=
DESTDIR :=
prefix := /usr/local
datarootdir := $(prefix)/share
docdir := $(datarootdir)/doc
MANDIR := $(CURDIR)
mandir := $(datarootdir)/man
MAN1DIR := $(MANDIR)/man1
MAN2DIR := $(MANDIR)/man2
MAN3DIR := $(MANDIR)/man3
MAN4DIR := $(MANDIR)/man4
MAN5DIR := $(MANDIR)/man5
MAN6DIR := $(MANDIR)/man6
MAN7DIR := $(MANDIR)/man7
MAN8DIR := $(MANDIR)/man8
man1dir := $(mandir)/man1
man2dir := $(mandir)/man2
man3dir := $(mandir)/man3
man4dir := $(mandir)/man4
man5dir := $(mandir)/man5
man6dir := $(mandir)/man6
man7dir := $(mandir)/man7
man8dir := $(mandir)/man8
manext := \.[0-9]
man1ext := .1
man2ext := .2
man3ext := .3
man4ext := .4
man5ext := .5
man6ext := .6
man7ext := .7
man8ext := .8
htmldir := $(docdir)
htmldir_ := $(htmldir)/man
htmlext := .html
INSTALL := install
INSTALL_DATA := $(INSTALL) -m 644
INSTALL_DIR := $(INSTALL) -m 755 -d
RM := rm
RMDIR := rmdir --ignore-fail-on-non-empty
MAN_SECTIONS := 1 2 3 4 5 6 7 8
.PHONY: all
all:
$(MAKE) uninstall
$(MAKE) install
%/.:
$(info - INSTALL $(@D))
$(INSTALL_DIR) $(@D)
%-rm:
$(info - RM $*)
$(RM) $*
%-rmdir:
$(info - RMDIR $(@D))
$(RMDIR) $(@D)
.PHONY: install
install: install-man | installdirs
@:
.PHONY: installdirs
installdirs: | installdirs-man
@:
.PHONY: uninstall remove
uninstall remove: uninstall-man
@:
.PHONY: clean
clean:
find man?/ -type f \
|while read f; do \
rm -f "$(htmlbuilddir)/$$f".*; \
done;
########################################################################
# man
MANPAGES := $(sort $(shell find $(MANDIR)/man?/ -type f | grep '$(manext)$$'))
_manpages := $(patsubst $(MANDIR)/%,$(DESTDIR)$(mandir)/%,$(MANPAGES))
_man1pages := $(filter %$(man1ext),$(_manpages))
_man2pages := $(filter %$(man2ext),$(_manpages))
_man3pages := $(filter %$(man3ext),$(_manpages))
_man4pages := $(filter %$(man4ext),$(_manpages))
_man5pages := $(filter %$(man5ext),$(_manpages))
_man6pages := $(filter %$(man6ext),$(_manpages))
_man7pages := $(filter %$(man7ext),$(_manpages))
_man8pages := $(filter %$(man8ext),$(_manpages))
MANDIRS := $(sort $(shell find $(MANDIR)/man? -type d))
_mandirs := $(patsubst $(MANDIR)/%,$(DESTDIR)$(mandir)/%/.,$(MANDIRS))
_man1dir := $(filter %man1/.,$(_mandirs))
_man2dir := $(filter %man2/.,$(_mandirs))
_man3dir := $(filter %man3/.,$(_mandirs))
_man4dir := $(filter %man4/.,$(_mandirs))
_man5dir := $(filter %man5/.,$(_mandirs))
_man6dir := $(filter %man6/.,$(_mandirs))
_man7dir := $(filter %man7/.,$(_mandirs))
_man8dir := $(filter %man8/.,$(_mandirs))
_mandir := $(DESTDIR)$(mandir)/.
_manpages_rm := $(addsuffix -rm,$(wildcard $(_manpages)))
_man1pages_rm := $(filter %$(man1ext)-rm,$(_manpages_rm))
_man2pages_rm := $(filter %$(man2ext)-rm,$(_manpages_rm))
_man3pages_rm := $(filter %$(man3ext)-rm,$(_manpages_rm))
_man4pages_rm := $(filter %$(man4ext)-rm,$(_manpages_rm))
_man5pages_rm := $(filter %$(man5ext)-rm,$(_manpages_rm))
_man6pages_rm := $(filter %$(man6ext)-rm,$(_manpages_rm))
_man7pages_rm := $(filter %$(man7ext)-rm,$(_manpages_rm))
_man8pages_rm := $(filter %$(man8ext)-rm,$(_manpages_rm))
_mandirs_rmdir := $(addsuffix -rmdir,$(wildcard $(_mandirs)))
_man1dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man1dir)))
_man2dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man2dir)))
_man3dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man3dir)))
_man4dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man4dir)))
_man5dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man5dir)))
_man6dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man6dir)))
_man7dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man7dir)))
_man8dir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man8dir)))
_mandir_rmdir := $(addsuffix -rmdir,$(wildcard $(_mandir)))
install_manX := $(foreach x,$(MAN_SECTIONS),install-man$(x))
installdirs_manX := $(foreach x,$(MAN_SECTIONS),installdirs-man$(x))
uninstall_manX := $(foreach x,$(MAN_SECTIONS),uninstall-man$(x))
.SECONDEXPANSION:
$(_manpages): $(DESTDIR)$(mandir)/man%: $(MANDIR)/man% | $$(@D)/.
$(info - INSTALL $@)
$(INSTALL_DATA) -T $< $@
$(_mandirs): %/.: | $$(dir %). $(_mandir)
$(_mandirs_rmdir): $(DESTDIR)$(mandir)/man%/.-rmdir: $$(_man%pages_rm) FORCE
$(_mandir_rmdir): $(uninstall_manX) FORCE
.PHONY: $(install_manX)
$(install_manX): install-man%: $$(_man%pages) | installdirs-man%
@:
.PHONY: install-man
install-man: $(install_manX)
@:
.PHONY: $(installdirs_manX)
$(installdirs_manX): installdirs-man%: $$(_man%dir) $(_mandir)
@:
.PHONY: installdirs-man
installdirs-man: $(installdirs_manX)
@:
.PHONY: $(uninstall_manX)
$(uninstall_manX): uninstall-man%: $$(_man%pages_rm) $$(_man%dir_rmdir)
@:
.PHONY: uninstall-man
uninstall-man: $(_mandir_rmdir) $(uninstall_manX)
@:
########################################################################
# html
uninstall remove:
for i in man?/*; do \
rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".*; \
done
# Use with
# make HTOPTS=whatever html
# make HTDIR=/some/dir HTOPTS=whatever html
# The sed removes the lines "Content-type: text/html\n\n"
.PHONY: html
html: | builddirs-html
find man?/ -type f \
|while read f; do \
man2html $(HTOPTS) "$$f" \
|sed -e '1,2d' \
>"$(htmlbuilddir)/$${f}$(htmlext)" \
|| exit $$?; \
done;
html:
@if [ x$(HTDIR) = x ]; then echo "You must set HTDIR."; else \
for i in man?; do \
[ -d $(HTDIR)/"$$i" ] || mkdir -p $(HTDIR)/"$$i"; \
find "$$i/" -type f | while read f; do \
man2html $(HTOPTS) $$f | \
sed -e '1,2d' > $(HTDIR)/"$$i"/`basename $$f`.html; \
done; \
done; fi
.PHONY: builddirs-html
builddirs-html:
find man?/ -type d \
|while read d; do \
$(INSTALL_DIR) "$(htmlbuilddir)/$$d" || exit $$?; \
done;
.PHONY: install-html
install-html: | installdirs-html
cd $(htmlbuilddir) && \
find man?/ -type f \
|while read f; do \
$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(htmldir_)/$$f" || exit $$?; \
done;
.PHONY: installdirs-html
installdirs-html:
find man?/ -type d \
|while read d; do \
$(INSTALL_DIR) "$(DESTDIR)$(htmldir_)/$$d" || exit $$?; \
done;
.PHONY: uninstall-html
uninstall-html:
find man?/ -type f \
|while read f; do \
rm -f "$(DESTDIR)$(htmldir_)/$$f".* || exit $$?; \
done;
########################################################################
# tests
install:
for i in man?; do \
install -d -m 755 $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
done
# Check if groff reports warnings (may be words of sentences not displayed)
# from https://lintian.debian.org/tags/groff-message.html
.PHONY: check-groff-warnings
check-groff-warnings:
GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)" || exit $$?; \
for i in man?/*.[1-9]; \
@ -268,7 +43,3 @@ check-groff-warnings:
# someone might also want to look at /var/catman/cat2 or so ...
# a problem is that the location of cat pages varies a lot
########################################################################
FORCE:

12
README
View File

@ -17,26 +17,18 @@ For further information on contributing, see the CONTRIBUTING file.
Installing and uninstalling
===========================
"make install" will copy these man pages to /usr/local/share/man/man[1-8].
"make install" will copy these man pages to /usr/share/man/man[1-8].
To install to a path different from /usr/local, use
To install to a path different from /usr, use
"make install prefix=/install/path".
"make remove" or "make uninstall" will remove any man page in this
distribution from its destination. Use with caution, and remember to
use "prefix" if desired, as with the "install" target.
To install only a specific man section (mandir) such as man3, use
"make install-man3". Similar syntax can be used to uninstall a
specific man section, such as man7: "make uninstall-man7".
"make" or "make all" will perform "make uninstall" followed by "make
install".
Consider using multiple threads (at least 2) when installing
these man pages, as the Makefile is optimized for multiple threads:
"make -j install".
Copyrights
==========
See the 'man-pages-x.y.Announce' file.

View File

@ -1,7 +1,7 @@
RELEASE
The Linux man page maintainer proudly announces. . .
man-pages-5.14.tar.gz - man pages for Linux
man-pages-5.11.tar.gz - man pages for Linux
Differences from the previous manual pages release are listed in
the file "Changes".

View File

@ -1,13 +1,13 @@
Begin3
Title: Section 2, 3, 4, 5 and 7 man pages for Linux
Version: 5.14
Entered-date: ????-??-??
Version: 5.11
Entered-date: 2021-03-21
Description: Linux manual pages
Keywords: man pages
Author: several
Maintained-by: Michael Kerrisk <mtk.manpages@gmail.com>
Primary-site: http://www.kernel.org/pub/linux/docs/man-pages
????k man-pages-5.14.tar.gz
2778k man-pages-5.11.tar.gz
Copying-policy: several; the pages are all freely distributable as long as
nroff source is provided
End

View File

@ -21,7 +21,7 @@
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.TH ICONV 1 2021-08-27 "GNU" "Linux User Manual"
.TH ICONV 1 2020-06-09 "GNU" "Linux User Manual"
.SH NAME
iconv \- convert text from one character encoding to another
.SH SYNOPSIS
@ -174,10 +174,6 @@ Usual system default gconv module configuration file.
.TP
.I /usr/lib/gconv/gconv\-modules.cache
Usual system gconv module configuration cache.
.PP
Depending on the architecture,
the above files may instead be located at directories with the path prefix
.IR /usr/lib64 .
.SH CONFORMING TO
POSIX.1-2001.
.SH EXAMPLES

View File

@ -11,7 +11,7 @@
.\" May be distributed under the GNU General Public License
.\" %%%LICENSE_END
.\"
.TH LDD 1 2021-08-27 "" "Linux Programmer's Manual"
.TH LDD 1 2021-03-22 "" "Linux Programmer's Manual"
.SH NAME
ldd \- print shared object dependencies
.SH SYNOPSIS
@ -23,11 +23,14 @@ ldd \- print shared object dependencies
prints the shared objects (shared libraries) required by each program or
shared object specified on the command line.
An example of its use and output
(using
.BR sed (1)
to trim leading white space for readability in this page)
is the following:
.PP
.in +4n
.EX
$ \fBldd /bin/ls\fP
$ \fBldd /bin/ls | sed \(aqs/^ */ /\(aq\fP
linux\-vdso.so.1 (0x00007ffcc3563000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)

View File

@ -245,8 +245,7 @@ and
.IR intcurrsym .
.TP
.B \-\-posix
Conform strictly to POSIX.
Implies
Conform strictly to POSIX. Implies
.BR \-\-verbose .
This option currently has no other effect.
POSIX conformance is assumed if the environment variable

View File

@ -112,28 +112,15 @@ canceled upon
.BR _exit (),
is implementation-dependent.
.SS C library/kernel differences
The text above in DESCRIPTION describes the traditional effect of
.BR _exit (),
which is to terminate a process,
and these are the semantics specified by POSIIX.1 and implemented
by the C library wrapper function.
On modern systems, this means termination of all threads in the process.
.PP
By contrast with the C library wrapper function, the raw Linux
.BR _exit ()
system call terminates only the calling thread, and actions such as
reparenting child processes or sending
.B SIGCHLD
to the parent process are performed only if this is
the last thread in the thread group.
.\" _exit() is used by pthread_exit() to terminate the calling thread
.PP
In glibc up to version 2.3, the
.BR _exit ()
wrapper function invoked the kernel system call of the same name.
Since glibc 2.3, the wrapper function invokes
.BR exit_group (2),
in order to terminate all of the threads in a process.
(The raw
.BR _exit ()
system call terminates only the calling thread.)
.SH SEE ALSO
.BR execve (2),
.BR exit_group (2),

View File

@ -38,7 +38,7 @@
.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
.\" 2008-12-04, mtk, Add documentation of accept4()
.\"
.TH ACCEPT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH ACCEPT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
accept, accept4 \- accept a connection on a socket
.SH SYNOPSIS
@ -261,12 +261,16 @@ does not refer to a socket.
The referenced socket is not of type
.BR SOCK_STREAM .
.TP
.B EPERM
Firewall rules forbid connection.
.TP
.B EPROTO
Protocol error.
.PP
In addition, Linux
.BR accept ()
may fail if:
.TP
.B EPERM
Firewall rules forbid connection.
.PP
In addition, network errors for the new socket and as defined
for the protocol may be returned.
Various Linux kernels can

View File

@ -40,7 +40,7 @@
.\" Modified 2004-06-23 by Michael Kerrisk
.\" 2007-06-10, mtk, various parts rewritten, and added BUGS section.
.\"
.TH ACCESS 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH ACCESS 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
access, faccessat, faccessat2 \- check user's permissions for a file
.SH SYNOPSIS
@ -49,20 +49,15 @@ access, faccessat, faccessat2 \- check user's permissions for a file
.PP
.BI "int access(const char *" pathname ", int " mode );
.PP
.BR "#include <fcntl.h>" " /* Definition of " AT_* " constants */"
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
.PP
.BI "int faccessat(int " dirfd ", const char *" pathname ", int " \
mode ", int " flags );
/* But see C library/kernel differences, below */
.PP
.BR "#include <fcntl.h>" " /* Definition of " AT_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_faccessat2,"
.BI " int " dirfd ", const char *" pathname ", int " mode \
", int " flags );
.BI "int faccessat2(int " dirfd ", const char *" pathname ", int " \
mode ", int " flags );
.fi
.PP
.RS -4
@ -218,6 +213,10 @@ and the file does not exist, or some other error occurred),
.I errno
is set to indicate the error.
.SH ERRORS
.BR access ()
and
.BR faccessat ()
shall fail if:
.TP
.B EACCES
The requested access would be denied to the file, or search permission
@ -226,32 +225,6 @@ is denied for one of the directories in the path prefix of
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.RB ( faccessat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
.RB ( faccessat ())
nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EINVAL
.RB ( faccessat ())
Invalid flag specified in
.IR flags .
.TP
.B EIO
An I/O error occurred.
.TP
.B ELOOP
Too many symbolic links were encountered in resolving
.IR pathname .
@ -265,27 +238,53 @@ A component of
.I pathname
does not exist or is a dangling symbolic link.
.TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ENOTDIR
A component used as a directory in
.I pathname
is not, in fact, a directory.
.TP
.B ENOTDIR
.RB ( faccessat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B EROFS
Write permission was requested for a file on a read-only filesystem.
.PP
.BR access ()
and
.BR faccessat ()
may fail if:
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EIO
An I/O error occurred.
.TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ETXTBSY
Write access was requested to an executable which is being
executed.
.PP
The following additional errors can occur for
.BR faccessat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
.IR flags .
.TP
.B ENOTDIR
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR faccessat ()
was added to Linux in kernel 2.6.16;
@ -354,8 +353,8 @@ call will still fail.
These calls
may not work correctly on NFSv2 filesystems with UID mapping enabled,
because UID mapping is done on the server and hidden from the client,
which checks permissions.
(NFS versions 3 and higher perform the check on the server.)
which checks permissions. (NFS versions 3 and higher perform the check on
the server.)
Similar problems can occur to FUSE mounts.
.\"
.\"

View File

@ -9,11 +9,12 @@
.\" 2 of the License, or (at your option) any later version.
.\" %%%LICENSE_END
.\"
.TH ADD_KEY 2 2021-08-27 Linux "Linux Key Management Calls"
.TH ADD_KEY 2 2021-03-22 Linux "Linux Key Management Calls"
.SH NAME
add_key \- add a key to the kernel's key management facility
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.B #include <keyutils.h>
.PP
.BI "key_serial_t add_key(const char *" type ", const char *" description ,
@ -218,10 +219,7 @@ This system call is a nonstandard Linux extension.
Glibc does not provide a wrapper for this system call.
A wrapper is provided in the
.IR libkeyutils
library.
(The accompanying package provides the
.I <keyutils.h>
header file.)
package.
When employing the wrapper in that library, link with
.IR \-lkeyutils .
.SH EXAMPLES

View File

@ -27,19 +27,13 @@
alloc_hugepages, free_hugepages \- allocate or free huge pages
.SH SYNOPSIS
.nf
.BI "void *syscall(SYS_alloc_hugepages, int " key ", void *" addr \
", size_t " len ,
.BI " int " prot ", int " flag );
.BI "void *alloc_hugepages(int " key ", void *" addr ", size_t " len ,
.BI " int " prot ", int " flag );
.\" asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr,
.\" unsigned long len, int prot, int flag);
.BI "int syscall(SYS_free_hugepages, void *" addr );
.BI "int free_hugepages(void *" addr );
.\" asmlinkage int sys_free_hugepages(unsigned long addr);
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION
The system calls
.BR alloc_hugepages ()

View File

@ -22,24 +22,20 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH ARCH_PRCTL 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH ARCH_PRCTL 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
arch_prctl \- set architecture-specific thread state
.SH SYNOPSIS
.nf
.BR "#include <asm/prctl.h>" " /* Definition of " ARCH_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <asm/prctl.h>
.B #include <sys/prctl.h>
.PP
.BI "int syscall(SYS_arch_prctl, int " code ", unsigned long " addr );
.BI "int syscall(SYS_arch_prctl, int " code ", unsigned long *" addr );
.BI "int arch_prctl(int " code ", unsigned long " addr );
.BI "int arch_prctl(int " code ", unsigned long *" addr );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR arch_prctl (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR arch_prctl ()
sets architecture-specific process or thread state.
@ -140,13 +136,13 @@ points to an unmapped address or is outside the process address space.
.I code
is not a valid subcommand.
.TP
.B ENODEV
.B ARCH_SET_CPUID
was requested, but the underlying hardware does not support CPUID faulting.
.TP
.B EPERM
.I addr
is outside the process address space.
.TP
.B ENODEV
.B ARCH_SET_CPUID
was requested, but the underlying hardware does not support CPUID faulting.
.\" .SH AUTHOR
.\" Man page written by Andi Kleen.
.SH CONFORMING TO
@ -181,6 +177,9 @@ and
in the same thread is dangerous, as they may overwrite each other's
TLS entries.
.PP
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
.I FS
may be already used by the threading library.
Programs that use

View File

@ -40,7 +40,7 @@ There is no glibc wrapper for this system call; see VERSIONS.
.SH DESCRIPTION
.IR Note :
Since Linux 2.6,
.\" As noted in changes in the 2.5.12 source
.\" As noted in a changes in the 2.5.12 source
this system call is deprecated and does nothing.
It is likely to disappear altogether in a future kernel release.
Nowadays, the task performed by

View File

@ -23,7 +23,7 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH BPF 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH BPF 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
bpf \- perform a command on an extended BPF map or program
.SH SYNOPSIS
@ -1212,7 +1212,7 @@ riscv (since Linux 5.1).
* 4. print number of received TCP/UDP packets every second
*/
int
main(int argc, char *argv[])
main(int argc, char **argv)
{
int sock, map_fd, prog_fd, key;
long long value = 0, tcp_cnt, udp_cnt;

View File

@ -18,21 +18,14 @@
capget, capset \- set/get capabilities of thread(s)
.SH SYNOPSIS
.nf
.BR "#include <linux/capability.h>" " /* Definition of " CAP_* " and"
.BR " _LINUX_CAPABILITY_*" " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <sys/capability.h>
.PP
.BI "int syscall(SYS_capget, cap_user_header_t " hdrp ,
.BI " cap_user_data_t " datap );
.BI "int syscall(SYS_capset, cap_user_header_t " hdrp ,
.BI " const cap_user_data_t " datap );
.BI "int capget(cap_user_header_t " hdrp ", cap_user_data_t " datap );
.BI "int capset(cap_user_header_t " hdrp ", const cap_user_data_t " datap );
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
These two system calls are the raw kernel interface for getting and
setting thread capabilities.
@ -47,7 +40,7 @@ The portable interfaces are
.BR cap_set_proc (3)
and
.BR cap_get_proc (3);
if possible, you should use those interfaces in applications; see NOTES.
if possible, you should use those interfaces in applications.
.\"
.SS Current details
Now that you have been warned, some current kernel details.
@ -246,6 +239,9 @@ No such thread.
.SH CONFORMING TO
These system calls are Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
The portable interface to the capability querying and setting
functions is provided by the
.I libcap

View File

@ -29,7 +29,7 @@
.\" <michael@cantor.informatik.rwth-aachen.de>: NFS details
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.TH CHMOD 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH CHMOD 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
chmod, fchmod, fchmodat \- change permissions of a file
.SH SYNOPSIS
@ -80,7 +80,7 @@ The
.BR chmod ()
and
.BR fchmod ()
system calls change a file's mode bits.
system calls change a files mode bits.
(The file mode consists of the file permission bits plus the set-user-ID,
set-group-ID, and sticky bits.)
These system calls differ only in how the file is specified:
@ -245,30 +245,10 @@ Search permission is denied on a component of the path prefix.
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.RB ( fchmod ())
The file descriptor
.I fd
is not valid.
.TP
.B EBADF
.RB ( fchmodat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.RB ( fchmodat ())
Invalid flag specified in
.IR flags .
.TP
.B EIO
An I/O error occurred.
.TP
@ -289,20 +269,6 @@ Insufficient kernel memory was available.
.B ENOTDIR
A component of the path prefix is not a directory.
.TP
.B ENOTDIR
.RB ( fchmodat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B ENOTSUP
.RB ( fchmodat ())
.I flags
specified
.BR AT_SYMLINK_NOFOLLOW ,
which is not supported.
.TP
.B EPERM
The effective UID does not match the owner of the file,
and the process is not privileged (Linux: it does not have the
@ -316,6 +282,51 @@ The file is marked immutable or append-only.
.TP
.B EROFS
The named file resides on a read-only filesystem.
.PP
The general errors for
.BR fchmod ()
are listed below:
.TP
.B EBADF
The file descriptor
.I fd
is not valid.
.TP
.B EIO
See above.
.TP
.B EPERM
See above.
.TP
.B EROFS
See above.
.PP
The same errors that occur for
.BR chmod ()
can also occur for
.BR fchmodat ().
The following additional errors can occur for
.BR fchmodat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
.IR flags .
.TP
.B ENOTDIR
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B ENOTSUP
.I flags
specified
.BR AT_SYMLINK_NOFOLLOW ,
which is not supported.
.SH VERSIONS
.BR fchmodat ()
was added to Linux in kernel 2.6.16;

View File

@ -35,7 +35,7 @@
.\" (bsdgroups versus sysvgroups, and the effect of the parent
.\" directory's set-group-ID mode bit).
.\"
.TH CHOWN 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH CHOWN 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
chown, fchown, lchown, fchownat \- change ownership of a file
.SH SYNOPSIS
@ -232,33 +232,10 @@ Search permission is denied on a component of the path prefix.
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.RB ( fchown ())
.I fd
is not a valid open file descriptor.
.TP
.B EBADF
.RB ( fchownat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.RB ( fchownat ())
Invalid flag specified in
.IR flags .
.TP
.B EIO
.RB ( fchown ())
A low-level I/O error occurred while modifying the inode.
.TP
.B ELOOP
Too many symbolic links were encountered in resolving
.IR pathname .
@ -276,13 +253,6 @@ Insufficient kernel memory was available.
.B ENOTDIR
A component of the path prefix is not a directory.
.TP
.B ENOTDIR
.RB ( fchownat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B EPERM
The calling process did not have the required permissions
(see above) to change owner and/or group.
@ -294,6 +264,47 @@ The file is marked immutable or append-only.
.TP
.B EROFS
The named file resides on a read-only filesystem.
.PP
The general errors for
.BR fchown ()
are listed below:
.TP
.B EBADF
.I fd
is not a valid open file descriptor.
.TP
.B EIO
A low-level I/O error occurred while modifying the inode.
.TP
.B ENOENT
See above.
.TP
.B EPERM
See above.
.TP
.B EROFS
See above.
.PP
The same errors that occur for
.BR chown ()
can also occur for
.BR fchownat ().
The following additional errors can occur for
.BR fchownat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
.IR flags .
.TP
.B ENOTDIR
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR fchownat ()
was added to Linux in kernel 2.6.16;

View File

@ -56,19 +56,13 @@ clone, __clone2, clone3 \- create a child process
.PP
/* For the prototype of the raw clone() system call, see NOTES */
.PP
.BR "#include <linux/sched.h>" " /* Definition of " "struct clone_args" " */"
.BR "#include <sched.h>" " /* Definition of " CLONE_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size );
.BI "long clone3(struct clone_args *" cl_args ", size_t " size );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR clone3 (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for
.BR clone3 ();
see NOTES.
.SH DESCRIPTION
These system calls
create a new ("child") process, in a manner similar to
@ -975,7 +969,7 @@ mask must also include
.B CLONE_VM
if
.B CLONE_SIGHAND
is specified.
is specified
.TP
.BR CLONE_STOPPED " (since Linux 2.6.0)"
.\" Precisely: Linux 2.6.0-test2
@ -1424,7 +1418,7 @@ was an invalid.
.TP
.BR EINVAL " (AArch64 only, Linux 4.6 and earlier)"
.I stack
was not aligned to a 128-bit boundary.
was not aligned to a 126-bit boundary.
.TP
.B ENOMEM
Cannot allocate sufficient memory to allocate a task structure for the
@ -1547,6 +1541,11 @@ One use of these systems calls
is to implement threads: multiple flows of control in a program that
run concurrently in a shared address space.
.PP
Glibc does not provide a wrapper for
.BR clone3 ();
call it using
.BR syscall (2).
.PP
Note that the glibc
.BR clone ()
wrapper function makes some changes

View File

@ -23,7 +23,7 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH CLOSE_RANGE 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH CLOSE_RANGE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
close_range \- close all file descriptors in a given range
.SH SYNOPSIS
@ -33,6 +33,9 @@ close_range \- close all file descriptors in a given range
.BI "int close_range(unsigned int " first ", unsigned int " last ,
.BI " unsigned int " flags );
.fi
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR close_range ()
@ -92,11 +95,12 @@ Insufficient kernel memory was available.
.SH VERSIONS
.BR close_range ()
first appeared in Linux 5.9.
Library support was added in glibc in version 2.34.
.SH CONFORMING TO
.BR close_range ()
is a nonstandard function that is also present on FreeBSD.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SS Closing all open file descriptors
.\" 278a5fbaed89dacd04e9d052f4594ffd0e0585de
To avoid blindly closing file descriptors

View File

@ -22,7 +22,7 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH COPY_FILE_RANGE 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH COPY_FILE_RANGE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
copy_file_range \- Copy a range of data from one file to another
.SH SYNOPSIS
@ -236,7 +236,7 @@ or server-side-copy (in the case of NFS).
#include <unistd.h>
int
main(int argc, char *argv[])
main(int argc, char **argv)
{
int fd_in, fd_out;
struct stat stat;

View File

@ -27,18 +27,11 @@
delete_module \- unload a kernel module
.SH SYNOPSIS
.nf
.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.BR "#include <unistd.h>
.PP
.BI "int syscall(SYS_delete_module, const char *" name ", unsigned int " flags );
.BI "int delete_module(const char *" name ", unsigned int " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR delete_module (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR delete_module ()

View File

@ -45,7 +45,7 @@ dup, dup2, dup3 \- duplicate a file descriptor
.BI "int dup2(int " oldfd ", int " newfd );
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
.BR "#include <fcntl.h>" " /* Obtain O_* constant definitions */"
.B #include <unistd.h>
.PP
.BI "int dup3(int " oldfd ", int " newfd ", int " flags );
@ -53,22 +53,18 @@ dup, dup2, dup3 \- duplicate a file descriptor
.SH DESCRIPTION
The
.BR dup ()
system call allocates a new file descriptor that refers to the same
open file description as the descriptor
.IR oldfd .
(For an explanation of open file descriptions, see
.BR open (2).)
The new file descriptor number is guaranteed to be the lowest-numbered
file descriptor that was unused in the calling process.
system call creates a copy of the file descriptor
.IR oldfd ,
using the lowest-numbered unused file descriptor for the new descriptor.
.PP
After a successful return,
the old and new file descriptors may be used interchangeably.
Since the two file descriptors refer to the same open file description,
they share file offset and file status flags;
They refer to the same open file description (see
.BR open (2))
and thus share file offset and file status flags;
for example, if the file offset is modified by using
.BR lseek (2)
on one of the file descriptors,
the offset is also changed for the other file descriptor.
on one of the file descriptors, the offset is also changed for the other.
.PP
The two file descriptors do not share file descriptor flags
(the close-on-exec flag).
@ -86,18 +82,9 @@ system call performs the same task as
but instead of using the lowest-numbered unused file descriptor,
it uses the file descriptor number specified in
.IR newfd .
In other words,
the file descriptor
.I newfd
is adjusted so that it now refers to the same open file description as
.IR oldfd .
.PP
If the file descriptor
.IR newfd
was previously open, it is closed before being reused;
the close is performed silently
(i.e., any errors during the close are not reported by
.BR dup2 ()).
was previously open, it is silently closed before being reused.
.PP
The steps of closing and reusing the file descriptor
.IR newfd

View File

@ -285,6 +285,18 @@ instance whose interest list is currently empty
or removed from the interest in another thread).
The call will block until some file descriptor is later added to the
interest list (in another thread) and that file descriptor becomes ready.
.SH BUGS
In kernels before 2.6.37, a
.I timeout
value larger than approximately
.I LONG_MAX / HZ
milliseconds is treated as \-1 (i.e., infinity).
Thus, for example, on a system where
.I sizeof(long)
is 4 and the kernel
.I HZ
value is 1000,
this means that timeouts greater than 35.79 minutes are treated as infinity.
.SS C library/kernel differences
The raw
.BR epoll_pwait ()
@ -300,18 +312,6 @@ The glibc
wrapper function specifies this argument as a fixed value
(equal to
.IR sizeof(sigset_t) ).
.SH BUGS
In kernels before 2.6.37, a
.I timeout
value larger than approximately
.I LONG_MAX / HZ
milliseconds is treated as \-1 (i.e., infinity).
Thus, for example, on a system where
.I sizeof(long)
is 4 and the kernel
.I HZ
value is 1000,
this means that timeouts greater than 35.79 minutes are treated as infinity.
.SH SEE ALSO
.BR epoll_create (2),
.BR epoll_ctl (2),

View File

@ -34,7 +34,7 @@
.\" 2007-09-14 Ollie Wild <aaw@google.com>, mtk
.\" Add text describing limits on command-line arguments + environment
.\"
.TH EXECVE 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH EXECVE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
execve \- execute program
.SH SYNOPSIS
@ -141,7 +141,7 @@ similarly, the effective group ID is copied to the saved set-group-ID.
This copying takes place after any effective ID changes that occur
because of the set-user-ID and set-group-ID mode bits.
.PP
The process's real UID and real GID, as well as its supplementary group IDs,
The process's real UID and real GID, as well its supplementary group IDs,
are unchanged by a call to
.BR execve ().
.PP
@ -346,7 +346,7 @@ will be invoked with the following arguments:
.PP
where
.I pathname
is the pathname of the file specified as the first argument of
is the absolute pathname of the file specified as the first argument of
.BR execve (),
and
.I arg...
@ -882,7 +882,6 @@ argv[4]: world
.BR ptrace (2),
.BR exec (3),
.BR fexecve (3),
.BR getauxval (3),
.BR getopt (3),
.BR system (3),
.BR capabilities (7),

View File

@ -23,18 +23,21 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH EXECVEAT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH EXECVEAT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
execveat \- execute program relative to a directory file descriptor
.SH SYNOPSIS
.nf
.BR "#include <linux/fcntl.h>" " /* Definition of " AT_* " constants */"
.B #include <unistd.h>
.PP
.BI "int execveat(int " dirfd ", const char *" pathname ,
.BI " const char *const " argv "[], const char *const " envp [],
.BI " int " flags );
.fi
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=27364
.SH DESCRIPTION
.\" commit 51f39a1f0cea1cacf8c787f652f26dfee9611874
The
@ -121,12 +124,9 @@ can also occur for
The following additional errors can occur for
.BR execveat ():
.TP
.I pathname
is relative but
.B EBADF
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
is not a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
@ -164,7 +164,6 @@ is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR execveat ()
was added to Linux in kernel 3.19.
Library support was added to glibc in version 2.34.
.SH CONFORMING TO
The
.BR execveat ()
@ -210,6 +209,9 @@ the natural idiom when using
is to set the close-on-exec flag on
.IR dirfd .
(But see BUGS.)
.PP
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SH BUGS
The
.B ENOENT

View File

@ -22,24 +22,19 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH EXIT_GROUP 2 2021-06-20 "Linux" "Linux Programmer's Manual"
.TH EXIT_GROUP 2 2008-11-27 "Linux" "Linux Programmer's Manual"
.SH NAME
exit_group \- exit all threads in a process
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/unistd.h>
.PP
.BI "noreturn void syscall(SYS_exit_group, int " status );
.BI "void exit_group(int " status );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR exit_group (),
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION
This system call terminates all threads
This system call is equivalent to
.BR _exit (2)
except that it terminates not only the calling thread, but all threads
in the calling process's thread group.
.SH RETURN VALUE
This system call does not return.
@ -52,4 +47,4 @@ Since glibc 2.3, this is the system call invoked when the
.BR _exit (2)
wrapper function is called.
.SH SEE ALSO
.BR _exit (2)
.BR exit (2)

View File

@ -81,7 +81,7 @@ Preallocating zeroed blocks beyond the end of the file in this manner
is useful for optimizing append workloads.
.PP
If the
.B FALLOC_FL_UNSHARE_RANGE
.B FALLOC_FL_UNSHARE
flag is specified in
.IR mode ,
shared file data extents will be made private to the file to guarantee

View File

@ -26,7 +26,7 @@
fanotify_init \- create and initialize fanotify group
.SH SYNOPSIS
.nf
.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
.B #include <fcntl.h>
.B #include <sys/fanotify.h>
.PP
.BI "int fanotify_init(unsigned int " flags ", unsigned int " event_f_flags );

View File

@ -21,7 +21,7 @@
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.TH FANOTIFY_MARK 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH FANOTIFY_MARK 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
fanotify_mark \- add, remove, or modify an fanotify mark on a filesystem
object
@ -83,7 +83,7 @@ contains
.BR FAN_MARK_FILESYSTEM ,
all marks for filesystems are removed from the group.
Otherwise, all marks for directories and files are removed.
No flag other than, and at most one of, the flags
No flag other than and at most one of the flags
.B FAN_MARK_MOUNT
or
.B FAN_MARK_FILESYSTEM
@ -117,14 +117,14 @@ If the filesystem object to be marked is not a directory, the error
shall be raised.
.TP
.B FAN_MARK_MOUNT
Mark the mount specified by
Mark the mount point specified by
.IR pathname .
If
.I pathname
is not itself a mount point, the mount containing
is not itself a mount point, the mount point containing
.I pathname
will be marked.
All directories, subdirectories, and the contained files of the mount
All directories, subdirectories, and the contained files of the mount point
will be monitored.
The events which require that filesystem objects are identified by file handles,
such as
@ -357,12 +357,7 @@ has the value
.BR AT_FDCWD ,
then the filesystem object to be marked is determined by interpreting
.I pathname
relative to the current working directory.
(See
.BR openat (2)
for an explanation of why the
.I dirfd
argument is useful.)
relative the current working directory.
.SH RETURN VALUE
On success,
.BR fanotify_mark ()
@ -376,14 +371,6 @@ is set to indicate the error.
An invalid file descriptor was passed in
.IR fanotify_fd .
.TP
.B EBADF
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EINVAL
An invalid value was passed in
.IR flags

View File

@ -69,6 +69,7 @@
fcntl \- manipulate file descriptor
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.B #include <fcntl.h>
.PP
.BI "int fcntl(int " fd ", int " cmd ", ... /* " arg " */ );"

View File

@ -239,31 +239,6 @@ see the discussion of the
.I "local_lock"
option in
.BR nfs (5).
.SS CIFS details
In Linux kernels up to 5.4,
.BR flock ()
is not propagated over SMB.
A file with such locks will not appear locked for remote clients.
.PP
Since Linux 5.5,
.BR flock ()
locks are emulated with SMB byte-range locks on the entire file.
Similarly to NFS, this means that
.BR fcntl (2)
and
.BR flock ()
locks interact with one another.
Another important side-effect is that the locks are not advisory anymore:
any IO on a locked file will always fail with
.BR EACCES
when done from a separate file descriptor.
This difference originates from the design of locks in the SMB protocol,
which provides mandatory locking semantics.
.PP
Remote and mandatory locking semantics may vary with SMB protocol, mount options and server type.
See
.BR mount.cifs (8)
for additional information.
.SH SEE ALSO
.BR flock (1),
.BR close (2),

View File

@ -19,28 +19,24 @@
.\" FIXME Do we need to add some text regarding Torvald Riegel's 2015-01-24 mail
.\" http://thread.gmane.org/gmane.linux.kernel/1703405/focus=1873242
.\"
.TH FUTEX 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH FUTEX 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
futex \- fast user-space locking
.SH SYNOPSIS
.nf
.PP
.BR "#include <linux/futex.h>" " /* Definition of " FUTEX_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/futex.h>
.B #include <stdint.h>
.B #include <sys/time.h>
.PP
.BI "long syscall(SYS_futex, uint32_t *" uaddr ", int " futex_op \
", uint32_t " val ,
.BI " const struct timespec *" timeout , \
.BI "long futex(uint32_t *" uaddr ", int " futex_op ", uint32_t " val ,
.BI " const struct timespec *" timeout , \
" \fR /* or: \fBuint32_t \fIval2\fP */"
.BI " uint32_t *" uaddr2 ", uint32_t " val3 );
.BI " uint32_t *" uaddr2 ", uint32_t " val3 );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR futex (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR futex ()
@ -222,9 +218,9 @@ This allows the kernel to make some additional performance optimizations.
.\" taking reference counts on file backing store, and so on.
.IP
As a convenience,
.I <linux/futex.h>
.IR <linux/futex.h>
defines a set of constants with the suffix
.B _PRIVATE
.BR _PRIVATE
that are equivalents of all of the operations listed below,
.\" except the obsolete FUTEX_FD, for which the "private" flag was
.\" meaningless
@ -241,25 +237,22 @@ and so on.
This option bit can be employed only with the
.BR FUTEX_WAIT_BITSET ,
.BR FUTEX_WAIT_REQUEUE_PI ,
and
(since Linux 4.5)
.\" commit 337f13046ff03717a9e99675284a817527440a49
.BR FUTEX_WAIT ,
and
(since Linux 5.14)
.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
.B FUTEX_LOCK_PI2
.BR FUTEX_WAIT
operations.
.IP
If this option is set, the kernel measures the
.I timeout
against the
.B CLOCK_REALTIME
.BR CLOCK_REALTIME
clock.
.IP
If this option is not set, the kernel measures the
.I timeout
against the
.B CLOCK_MONOTONIC
.BR CLOCK_MONOTONIC
clock.
.PP
The operation specified in
@ -907,9 +900,7 @@ value to 0 if the previous value was the expected TID.
If a futex is already acquired (i.e., has a nonzero value),
waiters must employ the
.B FUTEX_LOCK_PI
or
.B FUTEX_LOCK_PI2
operations to acquire the lock.
operation to acquire the lock.
If other threads are waiting for the lock, then the
.B FUTEX_WAITERS
bit is set in the futex value;
@ -968,8 +959,7 @@ PI futexes are operated on by specifying one of the values listed below in
Note that the PI futex operations must be used as paired operations
and are subject to some additional requirements:
.IP * 3
.BR FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.B FUTEX_LOCK_PI
and
.B FUTEX_TRYLOCK_PI
pair with
@ -1122,34 +1112,12 @@ The
.IR uaddr2 ,
.IR val ,
and
.I val3
.IR val3
arguments are ignored.
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
.TP
.BR FUTEX_LOCK_PI2 " (since Linux 5.14)"
.\" commit bf22a6976897977b0a3f1aeba6823c959fc4fdae
This operation is the same as
.BR FUTEX_LOCK_PI ,
except that the clock against which
.I timeout
is measured is selectable.
By default, the (absolute) timeout specified in
.I timeout
is measured againt the
.B CLOCK_MONOTONIC
clock, but if the
.B FUTEX_CLOCK_REALTIME
flag is specified in
.IR futex_op ,
then the timeout is measured against the
.B CLOCK_REALTIME
clock.
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
.TP
.BR FUTEX_TRYLOCK_PI " (since Linux 2.6.18)"
.\" commit c87e2837be82df479a6bae9f155c43516d2feebc
This operation tries to acquire the lock at
@ -1196,8 +1164,6 @@ arguments are ignored.
.\" commit c87e2837be82df479a6bae9f155c43516d2feebc
This operation wakes the top priority waiter that is waiting in
.B FUTEX_LOCK_PI
or
.B FUTEX_LOCK_PI2
on the futex address provided by the
.I uaddr
argument.
@ -1409,9 +1375,6 @@ Returns the number of waiters that were woken up.
.B FUTEX_LOCK_PI
Returns 0 if the futex was successfully locked.
.TP
.B FUTEX_LOCK_PI2
Returns 0 if the futex was successfully locked.
.TP
.B FUTEX_TRYLOCK_PI
Returns 0 if the futex was successfully locked.
.TP
@ -1466,9 +1429,8 @@ The value pointed to by
is not equal to the expected value
.IR val3 .
.TP
.B EAGAIN
.BR EAGAIN
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI )
The futex owner thread ID of
@ -1480,9 +1442,8 @@ is about to exit,
but has not yet handled the internal state cleanup.
Try again.
.TP
.B EDEADLK
.BR EDEADLK
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI )
The futex word at
@ -1522,18 +1483,18 @@ a spurious wakeup; since Linux 2.6.22, this no longer happens.
.TP
.B EINVAL
The operation in
.I futex_op
.IR futex_op
is one of those that employs a timeout, but the supplied
.I timeout
argument was invalid
.RI ( tv_sec
was less than zero, or
.I tv_nsec
.IR tv_nsec
was not less than 1,000,000,000).
.TP
.B EINVAL
The operation specified in
.I futex_op
.IR futex_op
employs one or both of the pointers
.I uaddr
and
@ -1545,17 +1506,17 @@ the address is not four-byte-aligned.
.RB ( FUTEX_WAIT_BITSET ,
.BR FUTEX_WAKE_BITSET )
The bit mask supplied in
.I val3
.IR val3
is zero.
.TP
.B EINVAL
.RB ( FUTEX_CMP_REQUEUE_PI )
.I uaddr
equals
.I uaddr2
.IR uaddr2
(i.e., an attempt was made to requeue to the same futex).
.TP
.B EINVAL
.BR EINVAL
.RB ( FUTEX_FD )
The signal number supplied in
.I val
@ -1570,15 +1531,12 @@ is invalid.
The kernel detected an inconsistency between the user-space state at
.I uaddr
and the kernel state\(emthat is, it detected a waiter which waits in
.B FUTEX_LOCK_PI
or
.B FUTEX_LOCK_PI2
.BR FUTEX_LOCK_PI
on
.IR uaddr .
.TP
.B EINVAL
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_UNLOCK_PI )
The kernel detected an inconsistency between the user-space state at
@ -1588,7 +1546,7 @@ This indicates either state corruption
or that the kernel found a waiter on
.I uaddr
which is waiting via
.B FUTEX_WAIT
.BR FUTEX_WAIT
or
.BR FUTEX_WAIT_BITSET .
.TP
@ -1601,9 +1559,9 @@ and the kernel state;
.\" The kernel sees: I have non PI state for a futex you tried to
.\" tell me was PI
that is, the kernel detected a waiter which waits via
.B FUTEX_WAIT
.BR FUTEX_WAIT
or
.B FUTEX_WAIT_BITSET
.BR FUTEX_WAIT_BITSET
on
.IR uaddr2 .
.TP
@ -1613,9 +1571,9 @@ The kernel detected an inconsistency between the user-space state at
.I uaddr
and the kernel state;
that is, the kernel detected a waiter which waits via
.B FUTEX_WAIT
.BR FUTEX_WAIT
or
.B FUTEX_WAIT_BITSET
.BR FUTEX_WAIT_BITSET
on
.IR uaddr .
.TP
@ -1627,9 +1585,7 @@ and the kernel state;
that is, the kernel detected a waiter which waits on
.I uaddr
via
.B FUTEX_LOCK_PI
or
.B FUTEX_LOCK_PI2
.BR FUTEX_LOCK_PI
(instead of
.BR FUTEX_WAIT_REQUEUE_PI ).
.TP
@ -1656,9 +1612,8 @@ Invalid argument.
.RB ( FUTEX_FD )
The system-wide limit on the total number of open files has been reached.
.TP
.B ENOMEM
.BR ENOMEM
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI )
The kernel could not allocate memory to hold state information.
@ -1669,19 +1624,17 @@ Invalid operation specified in
.TP
.B ENOSYS
The
.B FUTEX_CLOCK_REALTIME
.BR FUTEX_CLOCK_REALTIME
option was specified in
.IR futex_op ,
but the accompanying operation was neither
.BR FUTEX_WAIT ,
.BR FUTEX_WAIT_BITSET ,
.BR FUTEX_WAIT_REQUEUE_PI ,
nor
.BR FUTEX_LOCK_PI2 .
.BR FUTEX_WAIT_REQUEUE_PI .
.TP
.B ENOSYS
.BR ENOSYS
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_UNLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI ,
@ -1690,9 +1643,8 @@ A run-time check determined that the operation is not available.
The PI-futex operations are not implemented on all architectures and
are not supported on some CPU variants.
.TP
.B EPERM
.BR EPERM
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI )
The caller is not allowed to attach itself to the futex at
@ -1703,20 +1655,19 @@ the futex at
.IR uaddr2 ).
(This may be caused by a state corruption in user space.)
.TP
.B EPERM
.BR EPERM
.RB ( FUTEX_UNLOCK_PI )
The caller does not own the lock represented by the futex word.
.TP
.B ESRCH
.BR ESRCH
.RB ( FUTEX_LOCK_PI ,
.BR FUTEX_LOCK_PI2 ,
.BR FUTEX_TRYLOCK_PI ,
.BR FUTEX_CMP_REQUEUE_PI )
The thread ID in the futex word at
.I uaddr
does not exist.
.TP
.B ESRCH
.BR ESRCH
.RB ( FUTEX_CMP_REQUEUE_PI )
The thread ID in the futex word at
.I uaddr2
@ -1724,7 +1675,7 @@ does not exist.
.TP
.B ETIMEDOUT
The operation in
.I futex_op
.IR futex_op
employed the timeout specified in
.IR timeout ,
and the timeout expired before the operation completed.
@ -1744,6 +1695,9 @@ and a sixth argument was added in Linux 2.6.7.
.SH CONFORMING TO
This system call is Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
Several higher-level programming abstractions are implemented via futexes,
including POSIX semaphores and
various POSIX threads synchronization mechanisms

View File

@ -22,13 +22,13 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH FUTIMESAT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH FUTIMESAT 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
futimesat \- change timestamps of a file relative to a \
directory file descriptor
.SH SYNOPSIS
.nf
.BR "#include <fcntl.h>" " /* Definition of " AT_* " constants */"
.B #include <fcntl.h> /* Definition of AT_* constants */
.B #include <sys/time.h>
.PP
.BI "int futimesat(int " dirfd ", const char *" pathname ,
@ -83,11 +83,6 @@ If
is absolute, then
.I dirfd
is ignored.
(See
.BR openat (2)
for an explanation of why the
.I dirfd
argument is useful.)
.SH RETURN VALUE
On success,
.BR futimesat ()
@ -104,12 +99,8 @@ The following additional errors can occur for
.BR futimesat ():
.TP
.B EBADF
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
is not a valid file descriptor.
.TP
.B ENOTDIR
.I pathname

View File

@ -32,8 +32,8 @@ get_mempolicy \- retrieve NUMA memory policy for a thread
.nf
.PP
.BI "long get_mempolicy(int *" mode ", unsigned long *" nodemask ,
.BI " unsigned long " maxnode ", void *" addr ,
.BI " unsigned long " flags );
.BI " unsigned long " maxnode ", void *" addr ,
.BI " unsigned long " flags );
.PP
Link with \fI\-lnuma\fP.
.fi

View File

@ -32,21 +32,16 @@
get_robust_list, set_robust_list \- get/set list of robust futexes
.SH SYNOPSIS
.nf
.BR "#include <linux/futex.h>" \
" /* Definition of " "struct robust_list_head" " */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/futex.h>
.B #include <syscall.h>
.PP
.BI "long syscall(SYS_get_robust_list, int " pid ,
.BI " struct robust_list_head **" head_ptr ", size_t *" len_ptr );
.BI "long syscall(SYS_set_robust_list,"
.BI " struct robust_list_head *" head ", size_t " len );
.BI "long get_robust_list(int " pid ", struct robust_list_head **" head_ptr ,
.BI " size_t *" len_ptr );
.BI "long set_robust_list(struct robust_list_head *" head ", size_t " len );
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
These system calls deal with per-thread robust futex lists.
These lists are managed in user space:
@ -143,6 +138,9 @@ could be found.
These system calls were added in Linux 2.6.17.
.SH NOTES
These system calls are not needed by normal applications.
No support for them is provided in glibc.
In the unlikely event that you want to call them directly, use
.BR syscall (2).
.PP
A thread can have only one robust futex list;
therefore applications that wish

View File

@ -33,29 +33,19 @@
getdents, getdents64 \- get directory entries
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "long syscall(SYS_getdents, unsigned int " fd \
", struct linux_dirent *" dirp ,
.BI "long getdents(unsigned int " fd ", struct linux_dirent *" dirp ,
.BI " unsigned int " count );
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.BR "#include <dirent.h>"
.PP
.BI "ssize_t getdents64(int " fd ", void *" dirp ", size_t " count );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR getdents (),
necessitating the use of
.BR syscall (2).
.PP
.IR Note :
There is no definition of
.I struct linux_dirent
in glibc; see NOTES.
There is no glibc wrapper for
.BR getdents ();
see NOTES.
.SH DESCRIPTION
These are not the interfaces you are interested in.
Look at

View File

@ -42,11 +42,12 @@
.\" Clarified meaning of 0 value for 'who' argument
.\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.TH GETPRIORITY 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH GETPRIORITY 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
getpriority, setpriority \- get/set program scheduling priority
.SH SYNOPSIS
.nf
.B #include <sys/time.h>
.B #include <sys/resource.h>
.PP
.BI "int getpriority(int " which ", id_t " who );
@ -142,13 +143,6 @@ On failure, it returns \-1 and sets
to indicate the error.
.SH ERRORS
.TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EINVAL
.I which
was not one of
@ -157,6 +151,24 @@ was not one of
or
.BR PRIO_USER .
.TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.PP
In addition to the errors indicated above,
.BR setpriority ()
may fail if:
.TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EPERM
A process was located, but its effective user ID did not match
either the effective or the real user ID of the caller,
@ -164,13 +176,6 @@ and was not privileged (on Linux: did not have the
.B CAP_SYS_NICE
capability).
But see NOTES below.
.TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008,
SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD).
@ -204,6 +209,18 @@ the real or effective user ID of the process \fIwho\fP.
All BSD-like systems (SunOS 4.1.3, Ultrix 4.2,
4.3BSD, FreeBSD 4.3, OpenBSD-2.5, ...) behave in the same
manner as Linux 2.6.12 and later.
.PP
Including
.I <sys/time.h>
is not required these days, but increases portability.
(Indeed,
.I <sys/resource.h>
defines the
.I rusage
structure with fields of type
.I struct timeval
defined in
.IR <sys/time.h> .)
.\"
.SS C library/kernel differences
Within the kernel, nice values are actually represented

View File

@ -66,6 +66,7 @@
getrlimit, setrlimit, prlimit \- get/set resource limits
.SH SYNOPSIS
.nf
.B #include <sys/time.h>
.B #include <sys/resource.h>
.PP
.BI "int getrlimit(int " resource ", struct rlimit *" rlim );

View File

@ -41,6 +41,7 @@
getrusage \- get resource usage
.SH SYNOPSIS
.nf
.B #include <sys/time.h>
.B #include <sys/resource.h>
.PP
.BI "int getrusage(int " who ", struct rusage *" usage );
@ -229,6 +230,14 @@ is Linux-specific.
Resource usage metrics are preserved across an
.BR execve (2).
.PP
Including
.I <sys/time.h>
is not required these days, but increases portability.
(Indeed,
.I struct timeval
is defined in
.IR <sys/time.h> .)
.PP
In Linux kernel versions before 2.6.9, if the disposition of
.B SIGCHLD
is set to

View File

@ -29,20 +29,16 @@
getunwind \- copy the unwind data to caller's buffer
.SH SYNOPSIS
.nf
.B #include <syscall.h>
.B #include <linux/unwind.h>
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size );
.BI "long getunwind(void " *buf ", size_t " buf_size );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR getunwind (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.I Note: this system call is obsolete.
.I Note: this function is obsolete.
.PP
The
IA-64-specific
@ -106,5 +102,9 @@ and is available only on the IA-64 architecture.
This system call has been deprecated.
The modern way to obtain the kernel's unwind data is via the
.BR vdso (7).
.PP
Glibc does not provide a wrapper for this system call;
in the unlikely event that you want to call it, use
.BR syscall (2).
.SH SEE ALSO
.BR getauxval (3)

View File

@ -29,20 +29,14 @@
init_module, finit_module \- load a kernel module
.SH SYNOPSIS
.nf
.BR "#include <linux/module.h>" " /* Definition of " MODULE_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_init_module, void *" module_image ", unsigned long " len ,
.BI " const char *" param_values );
.BI "int syscall(SYS_finit_module, int " fd ", const char *" param_values ,
.BI " int " flags );
.BI "int init_module(void *" module_image ", unsigned long " len ,
.BI " const char *" param_values );
.BI "int finit_module(int " fd ", const char *" param_values ,
.BI " int " flags );
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
.BR init_module ()
loads an ELF image into kernel space,
@ -274,6 +268,11 @@ manually declare the interface in your code;
alternatively, you can invoke the system call using
.BR syscall (2).
.PP
Glibc does not provide a wrapper for
.BR finit_module ();
call it using
.BR syscall (2).
.PP
Information about currently loaded modules can be found in
.IR /proc/modules
and in the file trees under the per-module subdirectories under

View File

@ -26,7 +26,7 @@
.\" new _syscall(2) page, and substantially enhanced and rewrote
.\" the remaining material on this page.
.\"
.TH INTRO 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH INTRO 2 2020-11-01 "Linux" "Linux Programmer's Manual"
.SH NAME
intro \- introduction to system calls
.SH DESCRIPTION
@ -129,7 +129,7 @@ Note that these can be different from page to page!
.BR signal (7),
.BR socket (7),
.BR standards (7),
.BR symlink (7),
.BR system_data_types (7),
.BR symlink (7),
.BR sysvipc (7),
.BR time (7)

View File

@ -9,13 +9,14 @@
io_cancel \- cancel an outstanding asynchronous I/O operation
.SH SYNOPSIS
.nf
.BR "#include <linux/aio_abi.h>" " /* Definition of needed types */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
.PP
.BI "int syscall(SYS_io_cancel, aio_context_t " ctx_id ", struct iocb *" iocb ,
.BI " struct io_event *" result );
.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb ,
.BI " struct io_event *" result );
.fi
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.IR Note :
this page describes the raw Linux system call interface.
@ -67,7 +68,10 @@ The asynchronous I/O system calls first appeared in Linux 2.5.
is Linux-specific and should not be used
in programs that are intended to be portable.
.SH NOTES
You probably want to use the
Glibc does not provide a wrapper for this system call.
You could invoke it using
.BR syscall (2).
But instead, you probably want to use the
.BR io_cancel ()
wrapper function provided by
.\" http://git.fedorahosted.org/git/?p=libaio.git

View File

@ -9,18 +9,13 @@
io_destroy \- destroy an asynchronous I/O context
.SH SYNOPSIS
.nf
.BR "#include <linux/aio_abi.h>" " /* Definition of " aio_context_t " */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
.PP
.BI "int syscall(SYS_io_destroy, aio_context_t " ctx_id );
.BI "int io_destroy(aio_context_t " ctx_id );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR io_destroy (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.IR Note :
this page describes the raw Linux system call interface.
@ -62,7 +57,10 @@ The asynchronous I/O system calls first appeared in Linux 2.5.
is Linux-specific and should not be used in programs
that are intended to be portable.
.SH NOTES
You probably want to use the
Glibc does not provide a wrapper for this system call.
You could invoke it using
.BR syscall (2).
But instead, you probably want to use the
.BR io_destroy ()
wrapper function provided by
.\" http://git.fedorahosted.org/git/?p=libaio.git

View File

@ -9,20 +9,16 @@
io_getevents \- read asynchronous I/O events from the completion queue
.SH SYNOPSIS
.nf
.BR "#include <linux/aio_abi.h>" " /* Definition of " *io_* " types */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
.BR "#include <linux/time.h>" " /* Defines 'struct timespec' */"
.PP
.BI "int syscall(SYS_io_getevents, aio_context_t " ctx_id ,
.BI " long " min_nr ", long " nr ", struct io_event *" events ,
.BI " struct timespec *" timeout );
.BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
.BI " struct io_event *" events \
", struct timespec *" timeout );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR io_getevents (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.IR Note :
this page describes the raw Linux system call interface.
@ -98,7 +94,10 @@ The asynchronous I/O system calls first appeared in Linux 2.5.
is Linux-specific and should not be used in
programs that are intended to be portable.
.SH NOTES
You probably want to use the
Glibc does not provide a wrapper for this system call.
You could invoke it using
.BR syscall (2).
But instead, you probably want to use the
.BR io_getevents ()
wrapper function provided by
.\" http://git.fedorahosted.org/git/?p=libaio.git

View File

@ -685,8 +685,7 @@ These are legal only for the superuser or the owner of the current terminal.
.TP
.B "TIOCLINUX, subcode=0"
Dump the screen.
Disappeared in Linux 1.1.92.
(With kernel 1.1.92 or later, read from
Disappeared in Linux 1.1.92. (With kernel 1.1.92 or later, read from
.I /dev/vcsN
or
.I /dev/vcsaN

View File

@ -26,17 +26,16 @@
ioctl_fat \- manipulating the FAT filesystem
.SH SYNOPSIS
.nf
.BR "#include <linux/msdos_fs.h>" " /* Definition of [" V ] FAT_* " and"
.BR " ATTR_* " constants */"
.B #include <linux/msdos_fs.h>
.B #include <sys/ioctl.h>
.PP
.BI "int ioctl(int " fd ", FAT_IOCTL_GET_ATTRIBUTES, uint32_t *" attr );
.BI "int ioctl(int " fd ", FAT_IOCTL_SET_ATTRIBUTES, uint32_t *" attr );
.BI "int ioctl(int " fd ", FAT_IOCTL_GET_VOLUME_ID, uint32_t *" id );
.BI "int ioctl(int " fd ", VFAT_IOCTL_READDIR_BOTH,"
.BI " struct __fat_dirent " entry [2]);
.BI " struct __fat_dirent[2] " entry );
.BI "int ioctl(int " fd ", VFAT_IOCTL_READDIR_SHORT,"
.BI " struct __fat_dirent " entry [2]);
.BI " struct __fat_dirent[2] " entry );
.fi
.SH DESCRIPTION
The

View File

@ -25,8 +25,8 @@
ioctl_ficlonerange, ioctl_ficlone \- share some the data of one file with another file
.SH SYNOPSIS
.nf
.BR "#include <linux/fs.h>" " /* Definition of " FICLONE* " constants */"
.B #include <sys/ioctl.h>
.B #include <linux/fs.h>
.PP
.BI "int ioctl(int " dest_fd ", FICLONERANGE, struct file_clone_range *" arg );
.BI "int ioctl(int " dest_fd ", FICLONE, int " src_fd );

View File

@ -25,9 +25,8 @@
ioctl_fideduperange \- share some the data of one file with another file
.SH SYNOPSIS
.nf
.BR "#include <linux/fs.h>" " /* Definition of " FIDEDUPERANGE " and
.BR " FILE_DEDUPE_* " constants */
.B #include <sys/ioctl.h>
.B #include <linux/fs.h>
.PP
.BI "int ioctl(int " src_fd ", FIDEDUPERANGE, struct file_dedupe_range *" arg );
.fi

View File

@ -25,8 +25,8 @@
ioctl_fslabel \- get or set a filesystem label
.SH SYNOPSIS
.nf
.BR "#include <linux/fs.h>" " /* Definition of " *FSLABEL* " constants */"
.B #include <sys/ioctl.h>
.B #include <linux/fs.h>
.PP
.BI "int ioctl(int " fd ", FS_IOC_GETFSLABEL, char " label [FSLABEL_MAX]);
.BI "int ioctl(int " fd ", FS_IOC_SETFSLABEL, char " label [FSLABEL_MAX]);
@ -36,15 +36,14 @@ If a filesystem supports online label manipulation, these
.BR ioctl (2)
operations can be used to get or set the filesystem label for the filesystem
on which
.I fd
.B fd
resides.
The
.B FS_IOC_SETFSLABEL
operation requires privilege
.RB ( CAP_SYS_ADMIN ).
.SH RETURN VALUE
On success zero is returned.
On error, \-1 is returned, and
On success zero is returned. On error, \-1 is returned, and
.I errno
is set to indicate the error.
.SH ERRORS
@ -78,8 +77,7 @@ The maximum string length for this interface is
.BR FSLABEL_MAX ,
including the terminating null byte (\(aq\\0\(aq).
Filesystems have differing maximum label lengths, which may or
may not include the terminating null.
The string provided to
may not include the terminating null. The string provided to
.B FS_IOC_SETFSLABEL
must always be null-terminated, and the string returned by
.B FS_IOC_GETFSLABEL

View File

@ -25,9 +25,9 @@
ioctl_getfsmap \- retrieve the physical layout of the filesystem
.SH SYNOPSIS
.nf
.BR "#include <linux/fsmap.h> " "/* Definition of " FS_IOC_GETFSMAP ,
.BR " FM?_OF_*" ", and " *FMR_OWN_* " constants */"
.B #include <sys/ioctl.h>
.B #include <linux/fs.h>
.B #include <linux/fsmap.h>
.PP
.BI "int ioctl(int " fd ", FS_IOC_GETFSMAP, struct fsmap_head * " arg );
.fi

View File

@ -5,14 +5,12 @@
.\" Distributed under GPL
.\" %%%LICENSE_END
.\"
.TH IOCTL_TTY 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH IOCTL_TTY 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
ioctl_tty \- ioctls for terminals and serial lines
.SH SYNOPSIS
.nf
.B #include <sys/ioctl.h>
.BR "#include <termios.h>" " /* Definition of " CLOCAL ", and"
.BR " TC*" { FLUSH , ON , OFF "} constants */"
.B "#include <termios.h>"
.PP
.BI "int ioctl(int " fd ", int " cmd ", ...);"
.fi
@ -26,7 +24,7 @@ or
.IR arg .
.PP
Use of
.BR ioctl ()
.I ioctl
makes for nonportable programs.
Use the POSIX interface described in
.BR termios (3)
@ -71,38 +69,6 @@ Equivalent to
Allow the output buffer to drain, discard pending input, and
set the current serial port settings.
.PP
The following four ioctls, added in Linux 2.6.20,
.\" commit 64bb6c5e1ddcd47c951740485026ef08975ee2e6
.\" commit 592ee3a5e5e2a981ef2829a0380093006d045661
are just like
.BR TCGETS ,
.BR TCSETS ,
.BR TCSETSW ,
.BR TCSETSF ,
except that they take a
.I "struct termios2\ *"
instead of a
.IR "struct termios\ *" .
If the structure member
.B c_cflag
contains the flag
.BR BOTHER ,
then the baud rate is stored in the structure members
.B c_ispeed
and
.B c_ospeed
as integer values.
These ioctls are not supported on all architectures.
.RS
.TS
lb l.
TCGETS2 \fBstruct termios2 *\fPargp
TCSETS2 \fBconst struct termios2 *\fPargp
TCSETSW2 \fBconst struct termios2 *\fPargp
TCSETSF2 \fBconst struct termios2 *\fPargp
.TE
.RE
.PP
The following four ioctls are just like
.BR TCGETS ,
.BR TCSETS ,
@ -112,15 +78,14 @@ except that they take a
.I "struct termio\ *"
instead of a
.IR "struct termios\ *" .
.RS
.TS
lb l.
TCGETA \fBstruct termio *\fPargp
TCSETA \fBconst struct termio *\fPargp
TCSETAW \fBconst struct termio *\fPargp
TCSETAF \fBconst struct termio *\fPargp
.TE
.RE
.IP
.BI "TCGETA struct termio *" argp
.IP
.BI "TCSETA const struct termio *" argp
.IP
.BI "TCSETAW const struct termio *" argp
.IP
.BI "TCSETAF const struct termio *" argp
.SS Locking the termios structure
The
.I termios
@ -153,6 +118,9 @@ Window sizes are kept in the kernel, but not used by the kernel
(except in the case of virtual consoles, where the kernel will
update the window size when the size of the virtual console changes,
for example, by loading a new font).
.PP
The following constants and structure are defined in
.IR <sys/ioctl.h> .
.TP
.B TIOCGWINSZ
Argument:
@ -203,7 +171,7 @@ When
.I arg
is nonzero, nobody knows what will happen.
.IP
(SVr4, UnixWare, Solaris, and Linux treat
(SVr4, UnixWare, Solaris, Linux treat
.I "tcsendbreak(fd,arg)"
with nonzero
.I arg
@ -386,9 +354,6 @@ Set the foreground process group ID of this terminal.
Argument:
.BI "pid_t *" argp
.IP
When successful, equivalent to
.IR "*argp = tcgetsid(fd)" .
.IP
Get the session ID of the given terminal.
This fails with the error
.B ENOTTY
@ -565,7 +530,6 @@ The BSD ioctls
.BR TIOCSTOP ,
.BR TIOCSTART ,
.BR TIOCUCNTL ,
and
.B TIOCREMOTE
have not been implemented under Linux.
.SS Modem control
@ -736,8 +700,7 @@ Insufficient permission.
Check the condition of DTR on the serial port.
.PP
.EX
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <sys/ioctl.h>

View File

@ -31,7 +31,6 @@ ioctl_userfaultfd \- create a file descriptor for handling page faults in user
space
.SH SYNOPSIS
.nf
.BR "#include <linux/userfaultfd.h>" " /* Definition of " UFFD* " constants */"
.B #include <sys/ioctl.h>
.PP
.BI "int ioctl(int " fd ", int " cmd ", ...);"
@ -209,11 +208,6 @@ signal will be sent to the faulting process.
Applications using this
feature will not require the use of a userfaultfd monitor for processing
memory accesses to the regions registered with userfaultfd.
.TP
.BR UFFD_FEATURE_THREAD_ID " (since Linux 4.14)"
If this feature bit is set,
.I uffd_msg.pagefault.feat.ptid
will be set to the faulted thread ID for each page-fault message.
.PP
The returned
.I ioctls
@ -235,11 +229,6 @@ operation is supported.
The
.B UFFDIO_UNREGISTER
operation is supported.
.TP
.B 1 << _UFFDIO_WRITEPROTECT
The
.B UFFDIO_WRITEPROTECT
operation is supported.
.PP
This
.BR ioctl (2)
@ -328,6 +317,9 @@ Track page faults on missing pages.
.B UFFDIO_REGISTER_MODE_WP
Track page faults on write-protected pages.
.PP
Currently, the only supported mode is
.BR UFFDIO_REGISTER_MODE_MISSING .
.PP
If the operation is successful, the kernel modifies the
.I ioctls
bit-mask field to indicate which
@ -446,16 +438,6 @@ operation:
.TP
.B UFFDIO_COPY_MODE_DONTWAKE
Do not wake up the thread that waits for page-fault resolution
.TP
.B UFFDIO_COPY_MODE_WP
Copy the page with read-only permission.
This allows the user to trap the next write to the page,
which will block and generate another write-protect userfault message.
This is used only when both
.B UFFDIO_REGISTER_MODE_MISSING
and
.B UFFDIO_REGISTER_MODE_WP
modes are enabled for the registered range.
.PP
The
.I copy
@ -667,74 +649,6 @@ field of the
structure was not a multiple of the system page size; or
.I len
was zero; or the specified range was otherwise invalid.
.SS UFFDIO_WRITEPROTECT (Since Linux 5.7)
Write-protect or write-unprotect a userfaultfd-registered memory range
registered with mode
.BR UFFDIO_REGISTER_MODE_WP .
.PP
The
.I argp
argument is a pointer to a
.I uffdio_range
structure as shown below:
.PP
.in +4n
.EX
struct uffdio_writeprotect {
struct uffdio_range range; /* Range to change write permission*/
__u64 mode; /* Mode to change write permission */
};
.EE
.in
.PP
There are two mode bits that are supported in this structure:
.TP
.B UFFDIO_WRITEPROTECT_MODE_WP
When this mode bit is set,
the ioctl will be a write-protect operation upon the memory range specified by
.IR range .
Otherwise it will be a write-unprotect operation upon the specified range,
which can be used to resolve a userfaultfd write-protect page fault.
.TP
.B UFFDIO_WRITEPROTECT_MODE_DONTWAKE
When this mode bit is set,
do not wake up any thread that waits for
page-fault resolution after the operation.
This can be specified only if
.B UFFDIO_WRITEPROTECT_MODE_WP
is not specified.
.PP
This
.BR ioctl (2)
operation returns 0 on success.
On error, \-1 is returned and
.I errno
is set to indicate the error.
Possible errors include:
.TP
.B EINVAL
The
.I start
or the
.I len
field of the
.I ufdio_range
structure was not a multiple of the system page size; or
.I len
was zero; or the specified range was otherwise invalid.
.TP
.B EAGAIN
The process was interrupted; retry this call.
.TP
.B ENOENT
The range specified in
.I range
is not valid.
For example, the virtual address does not exist,
or not registered with userfaultfd write-protect mode.
.TP
.B EFAULT
Encountered a generic fault during processing.
.SH RETURN VALUE
See descriptions of the individual operations, above.
.SH ERRORS

View File

@ -36,7 +36,7 @@
ioperm \- set port input/output permissions
.SH SYNOPSIS
.nf
.B #include <sys/io.h>
.BR "#include <sys/io.h>" " /* for glibc */"
.PP
.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on );
.fi

View File

@ -21,23 +21,17 @@
.\" with various additions by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\"
.TH IOPRIO_SET 2 2021-06-20 "Linux" "Linux Programmer's Manual"
.TH IOPRIO_SET 2 2019-03-06 "Linux" "Linux Programmer's Manual"
.SH NAME
ioprio_get, ioprio_set \- get/set I/O scheduling class and priority
.SH SYNOPSIS
.nf
.BR "#include <linux/ioprio.h> " "/* Definition of " IOPRIO_* " constants */"
.BR "#include <sys/syscall.h> " "/* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_ioprio_get, int " which ", int " who );
.BI "int syscall(SYS_ioprio_set, int " which ", int " who ", int " ioprio );
.BI "int ioprio_get(int " which ", int " who );
.BI "int ioprio_set(int " which ", int " who ", int " ioprio );
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
The
.BR ioprio_get ()
@ -205,6 +199,9 @@ kernel 2.6.13.
.SH CONFORMING TO
These system calls are Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for these system calls; call them using
.BR syscall (2).
.PP
Two or more processes or threads can share an I/O context.
This will be the case when
.BR clone (2)

View File

@ -27,21 +27,12 @@
ipc \- System V IPC system calls
.SH SYNOPSIS
.nf
.BR "#include <linux/ipc.h>" " /* Definition of needed constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_ipc, unsigned int " call ", int " first ,
.BI " unsigned long " second ", unsigned long " third \
", void *" ptr ,
.BI " long " fifth );
.BI "int ipc(unsigned int " call ", int " first ", unsigned long " second ,
.BI " unsigned long " third ", void *" ptr ", long " fifth );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR ipc (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR ipc ()
is a common kernel entry point for the System\ V IPC calls
@ -65,6 +56,10 @@ system call; instead,
.BR semctl (2),
.BR shmctl (2),
and so on really are implemented as separate system calls.
.PP
Glibc does not provide a wrapper for this system call;
in the unlikely event that you want to call it directly, you can do so using
.BR syscall (2).
.SH SEE ALSO
.BR msgctl (2),
.BR msgget (2),

View File

@ -30,19 +30,14 @@
kcmp \- compare two processes to determine if they share a kernel resource
.SH SYNOPSIS
.nf
.BR "#include <linux/kcmp.h>" " /* Definition of " KCMP_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/kcmp.h>
.PP
.BI "int syscall(SYS_kcmp, pid_t " pid1 ", pid_t " pid2 ", int " type ,
.BI " unsigned long " idx1 ", unsigned long " idx2 );
.BI "int kcmp(pid_t " pid1 ", pid_t " pid2 ", int " type ,
.BI " unsigned long " idx1 ", unsigned long " idx2 );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR kcmp (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR kcmp ()
@ -308,10 +303,13 @@ system call first appeared in Linux 3.5.
.BR kcmp ()
is Linux-specific and should not be used in programs intended to be portable.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
Before Linux 5.12,
this system call is available only if the kernel is configured with
.BR CONFIG_CHECKPOINT_RESTORE ,
since the original purpose of the system call was for the
since the original pupose the system call was for the
checkpoint/restore in user space (CRIU) feature.
(The alternative to this system call would have been to expose suitable
process information via the

View File

@ -29,23 +29,18 @@
kexec_load, kexec_file_load \- load a new kernel for later execution
.SH SYNOPSIS
.nf
.BR "#include <linux/kexec.h>" " /* Definition of " KEXEC_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/kexec.h>
.PP
.BI "long syscall(SYS_kexec_load, unsigned long " entry ,
.BI " unsigned long " nr_segments \
", struct kexec_segment *" segments ,
.BI " unsigned long " flags );
.BI "long syscall(SYS_kexec_file_load, int " kernel_fd ", int " initrd_fd ,
.BI " unsigned long " cmdline_len ", const char *" cmdline ,
.BI " unsigned long " flags );
.BI "long kexec_load(unsigned long " entry ", unsigned long " nr_segments ,
.BI " struct kexec_segment *" segments ,
.BI " unsigned long " flags );
.BI "long kexec_file_load(int " kernel_fd ", int " initrd_fd ,
.BI " unsigned long " cmdline_len ", const char *" cmdline ,
.BI " unsigned long " flags );
.fi
.PP
.IR Note :
glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
The
.BR kexec_load ()
@ -337,6 +332,9 @@ The
system call first appeared in Linux 3.17.
.SH CONFORMING TO
These system calls are Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for these system calls; call them using
.BR syscall (2).
.SH SEE ALSO
.BR reboot (2),
.BR syscall (2),

View File

@ -25,25 +25,27 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH KEYCTL 2 2021-08-27 Linux "Linux Key Management Calls"
.TH KEYCTL 2 2021-03-22 Linux "Linux Key Management Calls"
.SH NAME
keyctl \- manipulate the kernel's key management facility
.SH SYNOPSIS
.nf
.BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <keyutils.h>
.PP
.BI "long keyctl(int " operation ", ...);"
.PP
.B "/* For direct call via syscall(2): */"
.B #include <asm/unistd.h>
.B #include <linux/keyctl.h>
.B #include <unistd.h>
.PP
.BI "long syscall(SYS_keyctl, int " operation ", unsigned long " arg2 ,
.BI "long syscall(__NR_keyctl, int " operation ", unsigned long " arg2 ,
.BI " unsigned long " arg3 ", unsigned long " arg4 ,
.BI " unsigned long " arg5 );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR keyctl (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR keyctl ()
allows user-space programs to perform key manipulation.
@ -1952,12 +1954,10 @@ This system call first appeared in Linux 2.6.10.
.SH CONFORMING TO
This system call is a nonstandard Linux extension.
.SH NOTES
Glibc does not provide a wrapper for this system call.
A wrapper is provided in the
.IR libkeyutils
library.
(The accompanying package provides the
.I <keyutils.h>
header file.)
When employing the wrapper in that library, link with
.IR \-lkeyutils .
However, rather than using this system call directly,

View File

@ -29,7 +29,7 @@
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2
.\"
.TH LINK 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH LINK 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
link, linkat \- make a new name for a file
.SH SYNOPSIS
@ -38,7 +38,7 @@ link, linkat \- make a new name for a file
.PP
.BI "int link(const char *" oldpath ", const char *" newpath );
.PP
.BR "#include <fcntl.h> " "/* Definition of " AT_* " constants */"
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
.PP
.BI "int linkat(int " olddirfd ", const char *" oldpath ,
@ -275,21 +275,17 @@ The file is on a read-only filesystem.
are not on the same mounted filesystem.
(Linux permits a filesystem to be mounted at multiple points, but
.BR link ()
does not work across different mounts,
does not work across different mount points,
even if the same filesystem is mounted on both.)
.PP
The following additional errors can occur for
.BR linkat ():
.TP
.B EBADF
.I oldpath
.RI ( newpath )
is relative but
.I olddirfd
.RI ( newdirfd )
is neither
.B AT_FDCWD
nor a valid file descriptor.
or
.I newdirfd
is not a valid file descriptor.
.TP
.B EINVAL
An invalid flag value was specified in

View File

@ -159,7 +159,7 @@ If the
.I backlog
argument is greater than the value in
.IR /proc/sys/net/core/somaxconn ,
then it is silently capped to that value.
then it is silently truncated to that value.
Since Linux 5.4, the default in this file is 4096;
in earlier kernels, the default value is 128.
In kernels before 2.4.25, this limit was a hard coded value,

View File

@ -31,19 +31,15 @@
_llseek \- reposition read/write file offset
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS__llseek, unsigned int " fd ", unsigned long " offset_high ,
.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,
.BI " unsigned long " offset_low ", loff_t *" result ,
.BI " unsigned int " whence );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR _llseek (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
Note: for information about the
.BR llseek (3)
@ -101,7 +97,10 @@ is invalid.
This function is Linux-specific, and should not be used in programs
intended to be portable.
.SH NOTES
You probably want to use the
Glibc does not provide a wrapper for this system call.
To invoke it directly, use
.BR syscall (2).
However, you probably want to use the
.BR lseek (2)
wrapper function instead.
.SH SEE ALSO

View File

@ -29,18 +29,11 @@
lookup_dcookie \- return a directory entry's path
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_lookup_dcookie, uint64_t " cookie ", char *" buffer ,
.BI " size_t " len );
.BI "int lookup_dcookie(uint64_t " cookie ", char *" buffer ", size_t " len );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR lookup_dcookie (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
Look up the full path of the directory entry specified by the value
.IR cookie .
@ -99,5 +92,8 @@ It relies on a kernel driver to register cookies for directory entries.
.PP
The path returned may be suffixed by the string " (deleted)" if the directory
entry has been removed.
.PP
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SH SEE ALSO
.BR oprofile (1)

View File

@ -22,26 +22,19 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH MEMBARRIER 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH MEMBARRIER 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
membarrier \- issue memory barriers on a set of threads
.SH SYNOPSIS
.nf
.PP
.BR "#include <linux/membarrier.h>" \
" /* Definition of " MEMBARRIER_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/membarrier.h>
.PP
.BI "int syscall(SYS_membarrier, int " cmd ", unsigned int " flags \
", int " cpu_id );
.BI "int membarrier(int " cmd ", unsigned int " flags ", int " cpu_id );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR membarrier (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR membarrier ()
@ -329,6 +322,9 @@ Examples where
.BR membarrier ()
can be useful include implementations
of Read-Copy-Update libraries and garbage collectors.
.PP
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SH EXAMPLES
Assuming a multithreaded application where "fast_path()" is executed
very frequently, and where "slow_path()" is executed infrequently, the
@ -358,7 +354,7 @@ slow_path(int *read_a)
}
int
main(int argc, char *argv[])
main(int argc, char **argv)
{
int read_a, read_b;
@ -444,7 +440,7 @@ slow_path(int *read_a)
}
int
main(int argc, char *argv[])
main(int argc, char **argv)
{
int read_a, read_b;

View File

@ -201,19 +201,6 @@ The
.BR memfd_create ()
system call first appeared in Linux 3.17;
glibc support was added in version 2.27.
.TP
.B EPERM
The
.B MFD_HUGETLB
flag was specified, but the caller was not privileged (did not have the
.B CAP_IPC_LOCK
capability)
and is not a member of the
.I sysctl_hugetlb_shm_group
group; see the description of
.I /proc/sys/vm/sysctl_hugetlb_shm_group
in
.BR proc (5).
.SH CONFORMING TO
The
.BR memfd_create ()
@ -559,7 +546,6 @@ main(int argc, char *argv[])
.SH SEE ALSO
.BR fcntl (2),
.BR ftruncate (2),
.BR memfd_secret (2),
.BR mmap (2),
.BR shmget (2),
.BR shm_open (3)

View File

@ -1,156 +0,0 @@
.\" Copyright (c) 2021, IBM Corporation.
.\" Written by Mike Rapoport <rppt@linux.ibm.com>
.\"
.\" Based on memfd_create(2) man page
.\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
.\" and Copyright (C) 2014 David Herrmann <dh.herrmann@gmail.com>
.\"
.\" %%%LICENSE_START(GPLv2+)
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.TH MEMFD_SECRET 2 2020-08-02 Linux "Linux Programmer's Manual"
.SH NAME
memfd_secret \- create an anonymous RAM-based file
to access secret memory regions
.SH SYNOPSIS
.nf
.PP
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_memfd_secret, unsigned int " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR memfd_secret (),
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION
.BR memfd_secret ()
creates an anonymous RAM-based file and returns a file descriptor
that refers to it.
The file provides a way to create and access memory regions
with stronger protection than usual RAM-based files and
anonymous memory mappings.
Once all open references to the file are closed,
it is automatically released.
The initial size of the file is set to 0.
Following the call, the file size should be set using
.BR ftruncate (2).
.PP
The memory areas backing the file created with
.BR memfd_secret (2)
are visible only to the processes that have access to the file descriptor.
The memory region is removed from the kernel page tables
and only the page tables of the processes holding the file descriptor
map the corresponding physical memory.
(Thus, the pages in the region can't be accessed by the kernel itself,
so that, for example, pointers to the region can't be passed to
system calls.)
.PP
The following values may be bitwise ORed in
.I flags
to control the behavior of
.BR memfd_secret ():
.TP
.B FD_CLOEXEC
Set the close-on-exec flag on the new file descriptor,
which causes the region to be removed from the process on
.BR execve (2).
See the description of the
.B O_CLOEXEC
flag in
.BR open (2)
.PP
As its return value,
.BR memfd_secret ()
returns a new file descriptor that refers to an anonymous file.
This file descriptor is opened for both reading and writing
.RB ( O_RDWR )
and
.B O_LARGEFILE
is set for the file descriptor.
.PP
With respect to
.BR fork (2)
and
.BR execve (2),
the usual semantics apply for the file descriptor created by
.BR memfd_secret ().
A copy of the file descriptor is inherited by the child produced by
.BR fork (2)
and refers to the same file.
The file descriptor is preserved across
.BR execve (2),
unless the close-on-exec flag has been set.
.PP
The memory region is locked into memory in the same way as with
.BR mlock (2),
so that it will never be written into swap.
However the implementation of
.BR memfd_secret ()
will not try to populate the whole range during the
.BR mmap (2)
call that attaches the region into the process's address space;
instead, the pages are only actually allocated
as they are faulted in.
The amount of memory allowed for memory mappings
of the file descriptor obeys the same rules as
.BR mlock (2)
and cannot exceed
.BR RLIMIT_MEMLOCK .
.SH RETURN VALUE
On success,
.BR memfd_secret ()
returns a new file descriptor.
On error, \-1 is returned and
.I errno
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL
.I flags
included unknown bits.
.TP
.B EMFILE
The per-process limit on the number of open file descriptors has been reached.
.TP
.B EMFILE
The system-wide limit on the total number of open files has been reached.
.TP
.B ENOMEM
There was insufficient memory to create a new anonymous file.
.TP
.B ENOSYS
.BR memfd_secret ()
is not implemented on this architecture.
.SH VERSIONS
The
.BR memfd_secret ()
system call first appeared in Linux 5.14.
.SH CONFORMING TO
The
.BR memfd_secret ()
system call is Linux-specific.
.SH SEE ALSO
.BR fcntl (2),
.BR ftruncate (2),
.BR mlock (2),
.BR memfd_create (2),
.BR mmap (2),
.BR setrlimit (2)

View File

@ -36,6 +36,7 @@
mincore \- determine whether pages are resident in memory
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.B #include <sys/mman.h>
.PP
.BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec );

View File

@ -8,7 +8,7 @@
.\" Public License. It comes with NO WARRANTY.
.\" %%%LICENSE_END
.\"
.TH MKDIR 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH MKDIR 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
mkdir, mkdirat \- create a directory
.SH SYNOPSIS
@ -126,15 +126,6 @@ did not allow search permission.
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.RB ( mkdirat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EDQUOT
The user's quota of disk blocks or inodes on the filesystem has been
exhausted.
@ -188,13 +179,6 @@ A component used as a directory in
.I pathname
is not, in fact, a directory.
.TP
.B ENOTDIR
.RB ( mkdirat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B EPERM
The filesystem containing
.I pathname
@ -203,6 +187,19 @@ does not support the creation of directories.
.B EROFS
.I pathname
refers to a file on a read-only filesystem.
.PP
The following additional errors can occur for
.BR mkdirat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR mkdirat ()
was added to Linux in kernel 2.6.16;

View File

@ -12,12 +12,14 @@
.\" Modified 2003-04-23 by Michael Kerrisk
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.TH MKNOD 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH MKNOD 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
mknod, mknodat \- create a special or ordinary file
.SH SYNOPSIS
.nf
.B #include <sys/stat.h>
.B #include <fcntl.h>
.B #include <unistd.h>
.PP
.BI "int mknod(const char *" pathname ", mode_t " mode ", dev_t " dev );
.PP
@ -163,15 +165,6 @@ did not allow search permission.
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.BR ( mknodat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EDQUOT
The user's quota of disk blocks or inodes on the filesystem has been
exhausted.
@ -216,13 +209,6 @@ A component used as a directory in
.I pathname
is not, in fact, a directory.
.TP
.B ENOTDIR
.BR ( mknodat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B EPERM
.I mode
requested creation of something other than a regular file,
@ -240,6 +226,19 @@ does not support the type of node requested.
.B EROFS
.I pathname
refers to a file on a read-only filesystem.
.PP
The following additional errors can occur for
.BR mknodat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR mknodat ()
was added to Linux in kernel 2.6.16;

View File

@ -23,7 +23,7 @@
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.TH MLOCK 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH MLOCK 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
mlock, mlock2, munlock, mlockall, munlockall \- lock and unlock memory
.SH SYNOPSIS
@ -182,64 +182,6 @@ is set to indicate the error,
and no changes are made to any locks in the
address space of the process.
.SH ERRORS
.\"SVr4 documents an additional EAGAIN error code.
.TP
.B EAGAIN
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
.RB ( mlock2 ())
Unknown \fIflags\fP were specified.
.TP
.B EINVAL
.RB ( mlockall ())
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.TP
.B ENOMEM
(Linux 2.6.9 and later) the caller had a nonzero
@ -265,9 +207,63 @@ half of RAM.
The caller is not privileged, but needs privilege
.RB ( CAP_IPC_LOCK )
to perform the requested operation.
.\"SVr4 documents an additional EAGAIN error code.
.PP
For
.BR mlock (),
.BR mlock2 (),
and
.BR munlock ():
.TP
.B EAGAIN
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.PP
For
.BR mlock2 ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified.
.PP
For
.BR mlockall ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.PP
For
.BR munlockall ():
.TP
.B EPERM
.RB ( munlockall ())
(Linux 2.6.8 and earlier) The caller was not privileged
.RB ( CAP_IPC_LOCK ).
.SH VERSIONS

View File

@ -254,7 +254,7 @@ restrictions.
If the memory region specified by
.I addr
and
.I length
.I len
overlaps pages of any existing mapping(s), then the overlapped
part of the existing mapping(s) will be discarded.
If the specified address cannot be used,
@ -400,11 +400,6 @@ private writable mappings.
Populate (prefault) page tables for a mapping.
For a file mapping, this causes read-ahead on the file.
This will help to reduce blocking on page faults later.
The
.BR mmap ()
call doesn't fail if the mapping cannot be populated (for example, due
to limitations on the number of mapped huge pages when using
.BR MAP_HUGETLB ).
.BR MAP_POPULATE
is supported for private mappings only since Linux 2.6.23.
.TP
@ -628,18 +623,6 @@ was mounted no-exec.
The operation was prevented by a file seal; see
.BR fcntl (2).
.TP
.B EPERM
The
.B MAP_HUGETLB
flag was specified, but the caller was not privileged (did not have the
.B CAP_IPC_LOCK
capability)
and is not a member of the
.I sysctl_hugetlb_shm_group
group; see the description of
.I /proc/sys/vm/sysctl_hugetlb_shm_group
in
.TP
.B ETXTBSY
.B MAP_DENYWRITE
was set but the object specified by

View File

@ -31,13 +31,11 @@
mmap2 \- map files or devices into memory
.SH SYNOPSIS
.nf
.BR "#include <sys/mman.h>" " /* Definition of " MAP_* " and " PROT_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.BR "#include <unistd.h>
.B #include <sys/mman.h>
.PP
.BI "void *syscall(SYS_mmap2, unsigned long " addr ", unsigned long " length ,
.BI " unsigned long " prot ", unsigned long " flags ,
.BI " unsigned long " fd ", unsigned long " pgoffset );
.BI "void *mmap2(unsigned long " addr ", unsigned long " length ,
.BI " unsigned long " prot ", unsigned long " flags ,
.BI " unsigned long " fd ", unsigned long " pgoffset );
.fi
.SH DESCRIPTION
This is probably not the system call that you are interested in; instead, see

View File

@ -27,19 +27,11 @@
modify_ldt \- get or set a per-process LDT entry
.SH SYNOPSIS
.nf
.BR "#include <asm/ldt.h>" " /* Definition of " "struct user_desc" " */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_modify_ldt, int " func ", void *" ptr ,
.BI " unsigned long " bytecount );
.BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR modify_ldt (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR modify_ldt ()
reads or writes the local descriptor table (LDT) for a process.
@ -176,6 +168,9 @@ is neither 0, 1, 2, nor 0x11.
This call is Linux-specific and should not be used in programs intended
to be portable.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
.BR modify_ldt ()
should not be used for thread-local storage, as it slows down context
switches and only supports a limited number of threads.

View File

@ -37,7 +37,7 @@
.\" 2008-10-06, mtk: move umount*() material into separate umount.2 page.
.\" 2008-10-06, mtk: Add discussion of namespaces.
.\"
.TH MOUNT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH MOUNT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
mount \- mount filesystem
.SH SYNOPSIS
@ -151,7 +151,7 @@ Reduce on-disk updates of inode timestamps (atime, mtime, ctime)
by maintaining these changes only in memory.
The on-disk timestamps are updated only when:
.RS
.IP (a) 4
.IP (a) 5
the inode needs to be updated for some change unrelated to file timestamps;
.IP (b)
the application employs
@ -221,12 +221,6 @@ Do not allow programs to be executed from this filesystem.
.B MS_NOSUID
Do not honor set-user-ID and set-group-ID bits or file capabilities
when executing programs from this filesystem.
In addition, SELinux domain
transitions require the permission
.IR nosuid_transition ,
which in turn needs
also the policy capability
.IR nnp_nosuid_transition .
.\" (This is a security feature to prevent users executing set-user-ID and
.\" set-group-ID programs from removable disk devices.)
.TP
@ -333,7 +327,7 @@ mount of the filesystem, and will be shared by all subsequent mounts
of the same filesystem.
Subsequently, the settings of the flags can be changed
via a remount operation (see below).
Such changes will be visible via all mounts associated
Such changes will be visible via all mount points associated
with the filesystem.
.PP
Since Linux 2.6.16,
@ -411,8 +405,8 @@ and
.BR MS_SILENT
flags during a remount are silently ignored.
Note that changes to per-superblock flags are visible via
all mounts of the associated filesystem
(because the per-superblock flags are shared by all mounts).
all mount points of the associated filesystem
(because the per-superblock flags are shared by all mount points).
.PP
Since Linux 3.17,
.\" commit ffbc6f0ead47fa5a1dc9642b0331cb75c20a640e
@ -435,7 +429,7 @@ flag can be used with
to modify only the per-mount-point flags.
.\" See https://lwn.net/Articles/281157/
This is particularly useful for setting or clearing the "read-only"
flag on a mount without changing the underlying filesystem.
flag on a mount point without changing the underlying filesystem.
Specifying
.IR mountflags
as:
@ -447,7 +441,7 @@ MS_REMOUNT | MS_BIND | MS_RDONLY
.in
.PP
will make access through this mountpoint read-only, without affecting
other mounts.
other mount points.
.\"
.SS Creating a bind mount
If
@ -475,7 +469,7 @@ described below) in the
.I mountflags
argument are also ignored.
(The bind mount has the same mount options as
the underlying mount.)
the underlying mount point.)
However, see the discussion of remounting above,
for a method of making an existing bind mount read-only.
.PP
@ -523,31 +517,31 @@ arguments are ignored.
The meanings of the propagation type flags are as follows:
.TP
.BR MS_SHARED
Make this mount shared.
Mount and unmount events immediately under this mount will propagate
to the other mounts that are members of this mount's peer group.
Make this mount point shared.
Mount and unmount events immediately under this mount point will propagate
to the other mount points that are members of this mount's peer group.
Propagation here means that the same mount or unmount will automatically
occur under all of the other mounts in the peer group.
occur under all of the other mount points in the peer group.
Conversely, mount and unmount events that take place under
peer mounts will propagate to this mount.
peer mount points will propagate to this mount point.
.TP
.BR MS_PRIVATE
Make this mount private.
Mount and unmount events do not propagate into or out of this mount.
Make this mount point private.
Mount and unmount events do not propagate into or out of this mount point.
.TP
.BR MS_SLAVE
If this is a shared mount that is a member of a peer group
If this is a shared mount point that is a member of a peer group
that contains other members, convert it to a slave mount.
If this is a shared mount that is a member of a peer group
If this is a shared mount point that is a member of a peer group
that contains no other members, convert it to a private mount.
Otherwise, the propagation type of the mount is left unchanged.
Otherwise, the propagation type of the mount point is left unchanged.
.IP
When a mount is a slave,
mount and unmount events propagate into this mount from
When a mount point is a slave,
mount and unmount events propagate into this mount point from
the (master) shared peer group of which it was formerly a member.
Mount and unmount events under this mount do not propagate to any peer.
Mount and unmount events under this mount point do not propagate to any peer.
.IP
A mount can be the slave of another peer group
A mount point can be the slave of another peer group
while at the same time sharing mount and unmount events
with a peer group of which it is a member.
.TP
@ -568,12 +562,12 @@ when replicating that subtree to produce the target subtree.
.PP
By default, changing the propagation type affects only the
.I target
mount.
mount point.
If the
.B MS_REC
flag is also specified in
.IR mountflags ,
then the propagation type of all mounts under
then the propagation type of all mount points under
.IR target
is also changed.
.PP
@ -589,9 +583,9 @@ contains the flag
(available since Linux 2.4.18),
then move a subtree:
.I source
specifies an existing mount and
specifies an existing mount point and
.I target
specifies the new location to which that mount is to be relocated.
specifies the new location to which that mount point is to be relocated.
The move is atomic: at no point is the subtree unmounted.
.PP
The remaining bits in the
@ -602,7 +596,7 @@ and
.IR data
arguments.
.\"
.SS Creating a new mount
.SS Creating a new mount point
If none of
.BR MS_REMOUNT ,
.BR MS_BIND ,
@ -616,9 +610,9 @@ is specified in
.IR mountflags ,
then
.BR mount ()
performs its default action: creating a new mount.
performs its default action: creating a new mount point.
.IR source
specifies the source for the new mount, and
specifies the source for the new mount point, and
.IR target
specifies the directory at which to create the mount point.
.PP
@ -709,7 +703,7 @@ was attempted, but the mount tree under
.I source
includes unbindable mounts and
.I target
is a mount that has propagation type
is a mount point that has propagation type
.BR MS_SHARED .
.TP
.B EINVAL
@ -725,7 +719,7 @@ A move operation
.RB ( MS_MOVE )
was attempted, but
.I source
was not a mount, or was \(aq/\(aq.
was not a mount point, or was \(aq/\(aq.
.TP
.B EINVAL
A bind operation
@ -824,21 +818,6 @@ is out of range.
.B EPERM
The caller does not have the required privileges.
.TP
.B EPERM
An attempt was made to modify
.RB ( MS_REMOUNT )
the
.BR MS_RDONLY ,
.BR MS_NOSUID ,
or
.BR MS_NOEXEC
flag, or one of the "atime" flags
.RB ( MS_NOATIME ,
.BR MS_NODIRATIME ,
.BR MS_RELATIME )
of an existing mount, but the mount is locked; see
.BR mount_namespaces (7).
.TP
.B EROFS
Mounting a read-only filesystem was attempted without giving the
.B MS_RDONLY
@ -939,33 +918,33 @@ subsequently creates) and vice versa.
For further details on mount namespaces, see
.BR mount_namespaces (7).
.\"
.SS Parental relationship between mounts
Each mount has a parent mount.
The overall parental relationship of all mounts defines
.SS Parental relationship between mount points
Each mount point has a parent mount point.
The overall parental relationship of all mount points defines
the single directory hierarchy seen by the processes within a mount namespace.
.PP
The parent of a new mount is defined when the mount is created.
The parent of a new mount point is defined when the mount point is created.
In the usual case,
the parent of a new mount is the mount of the filesystem
the parent of a new mount is the mount point of the filesystem
containing the directory or file at which the new mount is attached.
In the case where a new mount is stacked on top of an existing mount,
the parent of the new mount is the previous mount that was stacked
at that location.
.PP
The parental relationship between mounts can be discovered via the
The parental relationship between mount points can be discovered via the
.I /proc/[pid]/mountinfo
file (see below).
.\"
.SS /proc/[pid]/mounts and /proc/[pid]/mountinfo
The Linux-specific
.I /proc/[pid]/mounts
file exposes the list of mounts in the mount
file exposes the list of mount points in the mount
namespace of the process with the specified ID.
The
.I /proc/[pid]/mountinfo
file exposes even more information about mounts,
file exposes even more information about mount points,
including the propagation type and mount ID information that makes it
possible to discover the parental relationship between mounts.
possible to discover the parental relationship between mount points.
See
.BR proc (5)
and
@ -975,7 +954,6 @@ for details of this file.
.BR mountpoint (1),
.BR chroot (2),
.BR ioctl_iflags (2),
.BR mount_settatr (2),
.BR pivot_root (2),
.BR umount (2),
.BR mount_namespaces (7),

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ move_pages \- move individual pages of a process to another node
.nf
.B #include <numaif.h>
.PP
.BI "long move_pages(int " pid ", unsigned long " count ", void **" pages ,
.BI "long move_pages(int " pid ", unsigned long count, void **" pages ,
.BI " const int *" nodes ", int *" status ", int " flags );
.fi
.PP
@ -180,7 +180,6 @@ The number of nonmigrated pages if they were the result of nonfatal
reasons (since
.\" commit a49bd4d7163707de377aee062f17befef6da891b
Linux 4.17).
.TP
.B E2BIG
Too many pages to move.
Since Linux 2.6.29,

View File

@ -27,13 +27,14 @@
mq_getsetattr \- get/set message queue attributes
.SH SYNOPSIS
.nf
.BR "#include <mqueue.h>" " /* Definition of " "struct mq_attr" " */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <mqueue.h>
.PP
.BI "int syscall(SYS_mq_getsetattr, mqd_t " mqdes ,
.BI " const struct mq_attr *" newattr ", struct mq_attr *" oldattr );
.BI "int mq_getsetattr(mqd_t " mqdes ", const struct mq_attr *" newattr ,
.BI " struct mq_attr *" oldattr );
.fi
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
Do not use this system call.
.PP
@ -47,7 +48,9 @@ see the description of
.SH CONFORMING TO
This interface is nonstandard; avoid its use.
.SH NOTES
Never call it unless you are writing a C library!
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
(Actually, never call it unless you are writing a C library!)
.SH SEE ALSO
.BR mq_getattr (3),
.BR mq_overview (7)

View File

@ -40,6 +40,7 @@
msgctl \- System V message control operations
.SH SYNOPSIS
.nf
.B #include <sys/ipc.h>
.B #include <sys/msg.h>
.PP
.BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf );
@ -404,6 +405,17 @@ capability).
POSIX.1-2001, POSIX.1-2008, SVr4.
.\" SVID does not document the EIDRM error condition.
.SH NOTES
The inclusion of
.I <sys/ipc.h>
isn't required on Linux or by any version of POSIX.
However,
some old implementations required the inclusion of this header file,
and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need
to include this header file.
.\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of this header file.
.PP
The
.BR IPC_INFO ,
.BR MSG_STAT ,

View File

@ -37,6 +37,7 @@
msgget \- get a System V message queue identifier
.SH SYNOPSIS
.nf
.B #include <sys/ipc.h>
.B #include <sys/msg.h>
.PP
.BI "int msgget(key_t " key ", int " msgflg );
@ -187,6 +188,17 @@ would be exceeded.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008, SVr4.
.SH NOTES
The inclusion of
.I <sys/ipc.h>
isn't required on Linux or by any version of POSIX.
However,
some old implementations required the inclusion of this header file,
and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need
to include this header file.
.\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of this header file.
.PP
.B IPC_PRIVATE
isn't a flag field but a
.I key_t

View File

@ -42,6 +42,7 @@
msgrcv, msgsnd \- System V message queue operations
.SH SYNOPSIS
.nf
.B #include <sys/ipc.h>
.B #include <sys/msg.h>
.PP
.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
@ -479,6 +480,17 @@ their definitions can be obtained by defining the
.\" MSG_COPY since glibc 2.18
feature test macro.
.SH NOTES
The inclusion of
.I <sys/ipc.h>
isn't required on Linux or by any version of POSIX.
However,
some old implementations required the inclusion of this header file,
and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need
to include this header file.
.\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of this header file.
.PP
The
.I msgp
argument is declared as \fIstruct msgbuf\ *\fP in

View File

@ -48,11 +48,12 @@
.\" FIXME . Apr 08: The next POSIX revision has O_EXEC, O_SEARCH, and
.\" O_TTYINIT. Eventually these may need to be documented. --mtk
.\"
.TH OPEN 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH OPEN 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
open, openat, creat \- open and possibly create a file
.SH SYNOPSIS
.nf
.B #include <sys/stat.h>
.B #include <fcntl.h>
.PP
.BI "int open(const char *" pathname ", int " flags );
@ -96,9 +97,7 @@ be created by
.PP
The return value of
.BR open ()
is a file descriptor, a small, nonnegative integer that is an index
to an entry in the process's table of open file descriptors.
The file descriptor is used
is a file descriptor, a small, nonnegative integer that is used
in subsequent system calls
.RB ( read "(2), " write "(2), " lseek "(2), " fcntl (2),
etc.) to refer to the open file.
@ -823,7 +822,7 @@ fd = open("/path/to/dir", O_TMPFILE | O_RDWR,
/* File I/O on \(aqfd\(aq... */
linkat(fd, "", AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
linkat(fd, NULL, AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
/* If the caller doesn\(aqt have the CAP_DAC_READ_SEARCH
capability (needed to use AT_EMPTY_PATH with linkat(2)),
@ -926,19 +925,17 @@ system call operates in exactly the same way as
.BR open (),
except for the differences described here.
.PP
The
.I dirfd
argument is used in conjunction with the
.I pathname
argument as follows:
.IP * 3
If the pathname given in
.I pathname
is absolute, then
is relative, then it is interpreted relative to the directory
referred to by the file descriptor
.I dirfd
is ignored.
.IP *
If the pathname given in
(rather than relative to the current working directory of
the calling process, as is done by
.BR open ()
for a relative pathname).
.PP
If
.I pathname
is relative and
.I dirfd
@ -949,36 +946,12 @@ then
is interpreted relative to the current working
directory of the calling process (like
.BR open ()).
.IP *
If the pathname given in
.I pathname
is relative, then it is interpreted relative to the directory
referred to by the file descriptor
.I dirfd
(rather than relative to the current working directory of
the calling process, as is done by
.BR open ()
for a relative pathname).
In this case,
.I dirfd
must be a directory that was opened for reading
.RB ( O_RDONLY )
or using the
.B O_PATH
flag.
.PP
If the pathname given in
If
.I pathname
is relative, and
is absolute, then
.I dirfd
is not a valid file descriptor, an error
.RB ( EBADF )
results.
(Specifying an invalid file descriptor number in
.I dirfd
can be used as a means to ensure that
.I pathname
is absolute.)
is ignored.
.\"
.SS openat2(2)
The
@ -1034,15 +1007,6 @@ and
in
.BR proc (5).
.TP
.B EBADF
.RB ( openat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EBUSY
.B O_EXCL
was specified in
@ -1219,13 +1183,6 @@ is not, in fact, a directory, or \fBO_DIRECTORY\fP was specified and
.I pathname
was not a directory.
.TP
.B ENOTDIR
.RB ( openat ())
.I pathname
is a relative pathname and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B ENXIO
.BR O_NONBLOCK " | " O_WRONLY
is set, the named file is a FIFO, and
@ -1301,6 +1258,19 @@ The
flag was specified, and an incompatible lease was held on the file
(see
.BR fcntl (2)).
.PP
The following additional errors can occur for
.BR openat ():
.TP
.B EBADF
.I dirfd
is not a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
is a relative pathname and
.I dirfd
is a file descriptor referring to a file other than a directory.
.SH VERSIONS
.BR openat ()
was added to Linux in kernel 2.6.16;
@ -1640,15 +1610,13 @@ a directory file descriptor argument
.BR futimesat (2),
.BR linkat (2),
.BR mkdirat (2),
.BR mknodat (2),
.BR mount_setattr (2),
.BR move_mount (2),
.BR mknodat (2),
.BR name_to_handle_at (2),
.BR open_tree (2),
.BR openat2 (2),
.BR readlinkat (2),
.BR renameat (2),
.BR renameat2 (2),
.BR statx (2),
.BR symlinkat (2),
.BR unlinkat (2),

View File

@ -22,13 +22,14 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH OPEN_BY_HANDLE_AT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH OPEN_BY_HANDLE_AT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
name_to_handle_at, open_by_handle_at \- obtain handle
for a pathname and open file via a handle
.SH SYNOPSIS
.nf
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/stat.h>
.B #include <fcntl.h>
.PP
.BI "int name_to_handle_at(int " dirfd ", const char *" pathname ,
@ -347,14 +348,6 @@ can fail with the following errors:
.IR mount_fd
is not an open file descriptor.
.TP
.B EBADF
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EFAULT
.IR handle
points outside your accessible address space.

View File

@ -26,21 +26,16 @@
openat2 \- open and possibly create a file (extended)
.SH SYNOPSIS
.nf
.BR "#include <fcntl.h>" \
" /* Definition of " O_* " and " S_* " constants */"
.BR "#include <linux/openat2.h>" " /* Definition of " RESOLVE_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <sys/stat.h>
.B #include <fcntl.h>
.B #include <linux/openat2.h>
.PP
.BI "long syscall(SYS_openat2, int " dirfd ", const char *" pathname ,
.BI " struct open_how *" how ", size_t " size );
.BI "long openat2(int " dirfd ", const char *" pathname ,
.BI " struct open_how *" how ", size_t " size );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR openat2 (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR openat2 ()
@ -439,8 +434,7 @@ call.
.B EAGAIN
.BR RESOLVE_CACHED
was set, and the open operation cannot be performed using only cached
information.
The caller should retry without
information. The caller should retry without
.B RESOLVE_CACHED
set in
.I how.resolve .
@ -500,6 +494,9 @@ The semantics of
were modeled after FreeBSD's
.BR O_BENEATH .
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.\"
.SS Extensibility
In order to allow for future extensibility,
.BR openat2 ()

View File

@ -24,26 +24,21 @@
.\" This document is based on the perf_event.h header file, the
.\" tools/perf/design.txt file, and a lot of bitter experience.
.\"
.TH PERF_EVENT_OPEN 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH PERF_EVENT_OPEN 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
perf_event_open \- set up performance monitoring
.SH SYNOPSIS
.nf
.BR "#include <linux/perf_event.h>" " /* Definition of " PERF_* " constants */"
.BR "#include <linux/hw_breakpoint.h>" " /* Definition of " HW_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B #include <linux/perf_event.h>
.B #include <linux/hw_breakpoint.h>
.PP
.BI "int syscall(SYS_perf_event_open, struct perf_event_attr *" attr ,
.BI " pid_t " pid ", int " cpu ", int " group_fd \
", unsigned long " flags );
.BI "int perf_event_open(struct perf_event_attr *" attr ,
.BI " pid_t " pid ", int " cpu ", int " group_fd ,
.BI " unsigned long " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR perf_event_open (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
Given a list of parameters,
.BR perf_event_open ()
@ -1270,7 +1265,7 @@ records when a new cgroup is created (and activated).
.\" commit e17d43b93e544f5016c0251d2074c15568d5d963
This enables the generation of
.B PERF_RECORD_TEXT_POKE
records when there's a change to the kernel text
records when there's a changes to the kernel text
(i.e., self-modifying code).
.TP
.IR wakeup_events ", " wakeup_watermark
@ -3534,10 +3529,6 @@ Returned if the
.I attr
pointer points at an invalid memory address.
.TP
.B EINTR
Returned when trying to mix perf and ftrace handling
for a uprobe.
.TP
.B EINVAL
Returned if the specified event is invalid.
There are many possible reasons for this.
@ -3564,6 +3555,10 @@ values are out of range or set reserved bits;
the generic event selected is not supported; or
there is not enough room to add the selected event.
.TP
.B EINTR
Returned when trying to mix perf and ftrace handling
for a uprobe.
.TP
.B EMFILE
Each opened event uses one file descriptor.
If a large number of events are opened,
@ -3646,6 +3641,10 @@ This
system call Linux-specific
and should not be used in programs intended to be portable.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
See the example below.
.PP
The official way of knowing if
.BR perf_event_open ()
support is enabled is checking
@ -3762,7 +3761,7 @@ perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
}
int
main(int argc, char *argv[])
main(int argc, char **argv)
{
struct perf_event_attr pe;
long long count;

View File

@ -196,18 +196,12 @@ On error, \-1 is returned and
is set to indicate the error.
.SH VERSIONS
.BR perfmonctl ()
was added in Linux 2.4;
.\" commit ecf5b72d5f66af843f189dfe9ce31598c3e48ad7
it was removed in Linux 5.10.
is available since Linux 2.4.
.SH CONFORMING TO
.BR perfmonctl ()
is Linux-specific and is available only on the IA-64 architecture.
.SH NOTES
This system call was broken for many years,
and ultimately removed in Linux 5.10.
.PP
Glibc does not provide a wrapper for this system call;
on kernels where it exists, call it using
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SH SEE ALSO
.BR gprof (1)

View File

@ -27,18 +27,11 @@
pidfd_getfd \- obtain a duplicate of another process's file descriptor
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_pidfd_getfd, int " pidfd ", int " targetfd ,
.BI " unsigned int " flags );
.BI "int pidfd_getfd(int " pidfd ", int " targetfd ", unsigned int " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR pidfd_getfd (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR pidfd_getfd ()
@ -128,6 +121,9 @@ first appeared in Linux 5.6.
.BR pidfd_getfd ()
is Linux specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
For a description of PID file descriptors, see
.BR pidfd_open (2).
.PP

View File

@ -22,22 +22,16 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
.TH PIDFD_OPEN 2 2021-08-27 "Linux" "Linux Programmer's Manual"
.TH PIDFD_OPEN 2 2021-03-22 "Linux" "Linux Programmer's Manual"
.SH NAME
pidfd_open \- obtain a file descriptor that refers to a process
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_pidfd_open, pid_t " pid ", unsigned int " flags );
.BI "int pidfd_open(pid_t " pid ", unsigned int " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR pidfd_open (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR pidfd_open ()
@ -49,17 +43,8 @@ the close-on-exec flag is set on the file descriptor.
.PP
The
.I flags
argument either has the value 0, or contains the following flag:
.TP
.BR PIDFD_NONBLOCK " (since Linux 5.10)"
.\" commit 4da9af0014b51c8b015ed8c622440ef28912efe6
Return a nonblocking file descriptor.
If the process referred to by the file descriptor has not yet terminated,
then an attempt to wait on the file descriptor using
.BR waitid (2)
will immediately return the error
.BR EAGAIN
rather than blocking.
argument is reserved for future use;
currently, this argument must be specified as 0.
.SH RETURN VALUE
On success,
.BR pidfd_open ()
@ -71,7 +56,7 @@ is set to indicate the error.
.TP
.B EINVAL
.I flags
is not valid.
is not 0.
.TP
.B EINVAL
.I pid
@ -104,6 +89,9 @@ first appeared in Linux 5.3.
.BR pidfd_open ()
is Linux specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
The following code sequence can be used to obtain a file descriptor
for the child of
.BR fork (2):

View File

@ -27,21 +27,14 @@
pidfd_send_signal \- send a signal to a process specified by a file descriptor
.SH SYNOPSIS
.nf
.BR "#include <linux/signal.h>" " /* Definition of " SIG* " constants */"
.BR "#include <signal.h>" " /* Definition of " SI_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.B "#include <signal.h>"
.PP
.BI "int syscall(SYS_pidfd_send_signal, int " pidfd ", int " sig \
", siginfo_t *" info ,
.BI "int pidfd_send_signal(int " pidfd ", int " sig ", siginfo_t *" info ,
.BI " unsigned int " flags );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR pidfd_send_signal (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
The
.BR pidfd_send_signal ()
@ -143,6 +136,9 @@ first appeared in Linux 5.1.
.BR pidfd_send_signal ()
is Linux specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.\"
.SS PID file descriptors
The
.I pidfd

View File

@ -40,23 +40,20 @@ pipe, pipe2 \- create pipe
.nf
.B #include <unistd.h>
.PP
.BI "int pipe(int " pipefd [2]);
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
.B #include <unistd.h>
.PP
.BI "int pipe2(int " pipefd "[2], int " flags );
.PP
/* On Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64, pipe() has the
following prototype; see NOTES */
.PP
.B #include <unistd.h>
.PP
/* On Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64; see NOTES */
.B struct fd_pair {
.B " long fd[2];"
.B "};"
.B struct fd_pair pipe(void);
.B struct fd_pair pipe();
.PP
/* On all other architectures */
.BI "int pipe(int " pipefd "[2]);"
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.BR "#include <fcntl.h>" " /* Obtain O_* constant definitions */"
.B #include <unistd.h>
.PP
.BI "int pipe2(int " pipefd "[2], int " flags );
.fi
.SH DESCRIPTION
.BR pipe ()

View File

@ -29,18 +29,11 @@
pivot_root \- change the root mount
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_pivot_root, const char *" new_root \
", const char *" put_old );
.BI "int pivot_root(const char *" new_root ", const char *" put_old );
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR pivot_root (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR pivot_root ()
changes the root mount in the mount namespace of the calling process.
@ -175,6 +168,9 @@ was introduced in Linux 2.3.41.
.BR pivot_root ()
is Linux-specific and hence is not portable.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.PP
A command-line interface for this system call is provided by
.BR pivot_root (8).
.PP

View File

@ -37,10 +37,11 @@ poll, ppoll \- wait for some event on a file descriptor
.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout );
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <signal.h>
.B #include <poll.h>
.PP
.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ,
.BI " const struct timespec *" tmo_p ", const sigset_t *" sigmask );
.BI " const struct timespec *" tmo_p ", const sigset_t *" sigmask );
.fi
.SH DESCRIPTION
.BR poll ()

View File

@ -1135,48 +1135,72 @@ the available system calls.
The more recent
.BR seccomp (2)
system call provides a superset of the functionality of
.BR PR_SET_SECCOMP ,
and is the preferred interface for new applications.
.BR PR_SET_SECCOMP .
.IP
The seccomp mode is selected via
.IR arg2 .
(The seccomp constants are defined in
.IR <linux/seccomp.h> .)
The following values can be specified:
.RS
.TP
.BR SECCOMP_MODE_STRICT " (since Linux 2.6.23)"
See the description of
.B SECCOMP_SET_MODE_STRICT
in
.BR seccomp (2).
.IP
With
.IR arg2
set to
.BR SECCOMP_MODE_STRICT ,
the only system calls that the thread is permitted to make are
.BR read (2),
.BR write (2),
.BR _exit (2)
(but not
.BR exit_group (2)),
and
.BR sigreturn (2).
Other system calls result in the delivery of a
.BR SIGKILL
signal.
Strict secure computing mode is useful for number-crunching applications
that may need to execute untrusted byte code,
perhaps obtained by reading from a pipe or socket.
This operation is available only
if the kernel is configured with
.B CONFIG_SECCOMP
enabled.
.TP
.BR SECCOMP_MODE_FILTER " (since Linux 3.5)"
The allowed system calls are defined by a pointer
.IP
With
.IR arg2
set to
.BR SECCOMP_MODE_FILTER " (since Linux 3.5),"
the system calls allowed are defined by a pointer
to a Berkeley Packet Filter passed in
.IR arg3 .
This argument is a pointer to
.IR "struct sock_fprog" ;
it can be designed to filter
arbitrary system calls and system call arguments.
See the description of
.B SECCOMP_SET_MODE_FILTER
in
.BR seccomp (2).
.IP
This operation is available only
if the kernel is configured with
This mode is available only if the kernel is configured with
.B CONFIG_SECCOMP_FILTER
enabled.
.RE
.IP
For further details on seccomp filtering, see
.BR seccomp (2).
If
.BR SECCOMP_MODE_FILTER
filters permit
.BR fork (2),
then the seccomp mode is inherited by children created by
.BR fork (2);
if
.BR execve (2)
is permitted, then the seccomp mode is preserved across
.BR execve (2).
If the filters permit
.BR prctl ()
calls, then additional filters can be added;
they are run in order until the first non-allow result is seen.
.IP
For further information, see the kernel source file
.IR Documentation/userspace\-api/seccomp_filter.rst
.\" commit c061f33f35be0ccc80f4b8e0aea5dfd2ed7e01a3
(or
.IR Documentation/prctl/seccomp_filter.txt
before Linux 4.13).
.\" prctl PR_GET_SECCOMP
.TP
.BR PR_GET_SECCOMP " (since Linux 2.6.23)"
@ -1192,7 +1216,6 @@ If the caller is in filter mode, and this system call is allowed by the
seccomp filters, it returns 2; otherwise, the process is killed with a
.BR SIGKILL
signal.
.IP
This operation is available only
if the kernel is configured with
.B CONFIG_SECCOMP
@ -1448,7 +1471,7 @@ was included in
.IR arg2 ,
then the configuration described by the return value
will take effect at the next
.BR execve (2).
.BR execve ().
Otherwise, the configuration is already in effect when the
.B PR_SVE_SET_VL
call returns.

View File

@ -25,27 +25,20 @@
.\"
.\" Commit ecb8ac8b1f146915aa6b96449b66dd48984caacc
.\"
.TH PROCESS_MADVISE 2 2021-06-20 "Linux" "Linux Programmer's Manual"
.TH PROCESS_MADVISE 2 2021-01-12 "Linux" "Linux Programmer's Manual"
.SH NAME
process_madvise \- give advice about use of memory to a process
.SH SYNOPSIS
.nf
.BR "#include <sys/mman.h>" " /* Definition of " MADV_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.BR "#include <sys/uio.h>" " /* Definition of " "struct iovec" " type */"
.B #include <unistd.h>
.B #include <sys/uio.h>
.PP
.BI "ssize_t syscall(SYS_process_madvise, int " pidfd ,
.BI " const struct iovec *" iovec ", size_t " vlen \
", int " advice ,
.BI " unsigned int " flags ");"
.BI "ssize_t process_madvise(int " pidfd ", const struct iovec *" iovec ,
.BI " size_t " vlen ", int " advice ,
.BI " unsigned int " flags ");"
.fi
.PP
.IR Note :
glibc provides no wrapper for
.BR process_madvise (),
necessitating the use of
.BR syscall (2).
There is no glibc wrapper for this system call; see NOTES.
.\" FIXME: See <https://sourceware.org/bugzilla/show_bug.cgi?id=27380>
.SH DESCRIPTION
The
@ -212,6 +205,9 @@ configuration option.
The
.BR process_madvise ()
system call is Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.SH SEE ALSO
.BR madvise (2),
.BR pidfd_open (2),

View File

@ -2327,11 +2327,8 @@ On success, the
requests return the requested data (but see NOTES),
the
.B PTRACE_SECCOMP_GET_FILTER
request returns the number of instructions in the BPF program,
the
.B PTRACE_GET_SYSCALL_INFO
request returns the number of bytes available to be written by the kernel,
and other requests return zero.
request returns the number of instructions in the BPF program, and
other requests return zero.
.PP
On error, all requests return \-1, and
.I errno

View File

@ -30,9 +30,7 @@ quotactl \- manipulate disk quotas
.SH SYNOPSIS
.nf
.B #include <sys/quota.h>
.BR "#include <xfs/xqm.h>" " /* Definition of " Q_X* " and " XFS_QUOTA_* \
" constants"
.RB " (or " <linux/dqblk_xfs.h> "; see NOTES) */"
.B #include <xfs/xqm.h> /* for XFS quotas */
.PP
.BI "int quotactl(int " cmd ", const char *" special ", int " id \
", caddr_t " addr );

View File

@ -32,17 +32,13 @@
readdir \- read directory entry
.SH SYNOPSIS
.nf
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_readdir, unsigned int " fd ,
.BI " struct old_linux_dirent *" dirp ", unsigned int " count );
.BI "int readdir(unsigned int " fd ", struct old_linux_dirent *" dirp ","
.BI " unsigned int " count );
.fi
.PP
.IR Note :
There is no definition of
.BR "struct old_linux_dirent" ;
see NOTES.
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
This is not the function you are interested in.
Look at
@ -120,6 +116,8 @@ File descriptor does not refer to a directory.
.SH CONFORMING TO
This system call is Linux-specific.
.SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
You will need to define the
.I old_linux_dirent
structure yourself.

Some files were not shown because too many files have changed in this diff Show More