tripathysagar/man_text huggingface dataset:
# ioctl_userfaultfd

## NAME



           ioctl_userfaultfd - create a file descriptor for handling page
           faults in user space
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, int** _op_**, ...);**
    


## DESCRIPTION



           Various ioctl(2) operations can be performed on a userfaultfd
           object (created by a call to userfaultfd(2)) using calls of the
           form:
    
               ioctl(fd, op, argp);
    
           In the above, _fd_ is a file descriptor referring to a userfaultfd
           object, _op_ is one of the operations listed below, and _argp_ is a
           pointer to a data structure that is specific to _op_.
    
           The various ioctl(2) operations are described below.  The
           **UFFDIO_API** , **UFFDIO_REGISTER** , and **UFFDIO_UNREGISTER** operations are
           used to _configure_ userfaultfd behavior.  These operations allow
           the caller to choose what features will be enabled and what kinds
           of events will be delivered to the application.  The remaining
           operations are _range_ operations.  These operations enable the
           calling application to resolve page-fault events.
    
           UFFDIO_API(2const)
           UFFDIO_REGISTER(2const)
           UFFDIO_UNREGISTER(2const)
           UFFDIO_COPY(2const)
           UFFDIO_MOVE(2const)
           UFFDIO_ZEROPAGE(2const)
           UFFDIO_WAKE(2const)
           UFFDIO_WRITEPROTECT(2const)
           UFFDIO_CONTINUE(2const)
           UFFDIO_POISON(2const)
    


## RETURN VALUE



           On success, 0 is returned.  On error, -1 is returned, and _errno_ is
           set to indicate the error.
    


## ERRORS



           The following general errors can occur for all of the operations
           described above:
    
           **EFAULT** _argp_ does not point to a valid memory address.
    
           **EINVAL**(For all operations except **UFFDIO_API**.)  The userfaultfd
                  object has not yet been enabled (via the **UFFDIO_API**
                  operation).
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *
# times

## NAME



           times - get process times
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/times.h>**
    
           **clock_t times(struct tms ***_buf_**);**
    


## DESCRIPTION



           **times**() stores the current process times in the _struct tms_ that
           _buf_ points to.  The _struct tms_ is as defined in _< sys/times.h>_:
    
               struct tms {
                   clock_t tms_utime;  /* user time */
                   clock_t tms_stime;  /* system time */
                   clock_t tms_cutime; /* user time of children */
                   clock_t tms_cstime; /* system time of children */
               };
    
           The _tms_utime_ field contains the CPU time spent executing
           instructions of the calling process.  The _tms_stime_ field contains
           the CPU time spent executing inside the kernel while performing
           tasks on behalf of the calling process.
    
           The _tms_cutime_ field contains the sum of the _tms_utime_ and
           _tms_cutime_ values for all waited-for terminated children.  The
           _tms_cstime_ field contains the sum of the _tms_stime_ and _tms_cstime_
           values for all waited-for terminated children.
    
           Times for terminated children (and their descendants) are added in
           at the moment wait(2) or waitpid(2) returns their process ID.  In
           particular, times of grandchildren that the children did not wait
           for are never seen.
    
           All times reported are in clock ticks.
    


## RETURN VALUE



           **times**() returns the number of clock ticks that have elapsed since
           an arbitrary point in the past.  The return value may overflow the
           possible range of type _clock_t_.  On error, _(clock_t) -1_ is
           returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EFAULT** _tms_ points outside the process's address space.
    


## VERSIONS



           On Linux, the _buf_ argument can be specified as NULL, with the
           result that **times**() just returns a function result.  However,
           POSIX does not specify this behavior, and most other UNIX
           implementations require a non-NULL value for _buf_.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           The number of clock ticks per second can be obtained using:
    
               sysconf(_SC_CLK_TCK);
    
           Note that clock(3) also returns a value of type _clock_t_ , but this
           value is measured in units of **CLOCKS_PER_SEC** , not the clock ticks
           used by **times**().
    


## BUGS



           A limitation of the Linux system call conventions on some
           architectures (notably i386) means that on Linux 2.6 there is a
           small time window (41 seconds) soon after boot when **times**() can
           return -1, falsely indicating that an error occurred.  The same
           problem can occur when the return value wraps past the maximum
           value that can be stored in **clock_t**.
    


* * *
# mmap2

## NAME



           mmap2 - map files or devices into memory
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/mman.h>    **/* Definition of **MAP_*** and **PROT_*** constants */
           **#include <sys/syscall.h> **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **void *syscall(SYS_mmap2, unsigned long** _addr_**, unsigned long** _length_**,**
                         **unsigned long** _prot_**, unsigned long** _flags_**,**
                         **unsigned long** _fd_**, unsigned long** _pgoffset_**);**
    


## DESCRIPTION



           This is probably not the system call that you are interested in;
           instead, see mmap(2), which describes the glibc wrapper function
           that invokes this system call.
    
           The **mmap2**() system call provides the same interface as mmap(2),
           except that the final argument specifies the offset into the file
           in 4096-byte units (instead of bytes, as is done by mmap(2)).
           This enables applications that use a 32-bit _off_t_ to map large
           files (up to 2^44 bytes).
    


## RETURN VALUE



           On success, **mmap2**() returns a pointer to the mapped area.  On
           error, -1 is returned and _errno_ is set to indicate the error.
    


## ERRORS



           **EFAULT** Problem with getting the data from user space.
    
           **EINVAL**(Various platforms where the page size is not 4096 bytes.)
                  _offset * 4096_ is not a multiple of the system page size.
    
           **mmap2**() can also return any of the errors described in mmap(2).
    


## VERSIONS



           On architectures where this system call is present, the glibc
           **mmap**() wrapper function invokes this system call rather than the
           mmap(2) system call.
    
           This system call does not exist on x86-64.
    
           On ia64, the unit for _offset_ is actually the system page size,
           rather than 4096 bytes.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM

## NAME



           PR_SET_MM - modify kernel memory map descriptor fields
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **int prctl(PR_SET_MM, long** _op_**, ...);**
    


## DESCRIPTION



           Modify certain kernel memory map descriptor fields of the calling
           process.  Usually these fields are set by the kernel and dynamic
           loader (see ld.so(8) for more information) and a regular
           application should not use this feature.  However, there are
           cases, such as self-modifying programs, where a program might find
           it useful to change its own memory map.
    
           The calling process must have the **CAP_SYS_RESOURCE** capability.
           The value in _op_ is one of the options below.
    
           **PR_SET_MM_START_CODE**
           **PR_SET_MM_END_CODE**
           **PR_SET_MM_START_DATA**
           **PR_SET_MM_END_DATA**
           **PR_SET_MM_START_STACK**
           **PR_SET_MM_START_BRK**
           **PR_SET_MM_BRK**
           **PR_SET_MM_ARG_START**
           **PR_SET_MM_ARG_END**
           **PR_SET_MM_ENV_START**
           **PR_SET_MM_ENV_END**
           **PR_SET_MM_AUXV**
           **PR_SET_MM_EXE_FILE**
           **PR_SET_MM_MAP**
           **PR_SET_MM_MAP_SIZE**
    


## RETURN VALUE



           On success, 0 is returned.  On error, -1 is returned, and _errno_ is
           set to indicate the error.
    


## ERRORS



           **EINVAL** _op_ is not a valid value.
    
           **EPERM** The caller does not have the **CAP_SYS_RESOURCE** capability.
    


## STANDARDS



           Linux.
    


* * *
# removexattr

## NAME



           removexattr, lremovexattr, fremovexattr - remove an extended
           attribute
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/xattr.h>**
    
           **int removexattr(const char ***_path_**, const char ***_name_**);**
           **int lremovexattr(const char ***_path_**, const char ***_name_**);**
           **int fremovexattr(int** _fd_**, const char ***_name_**);**
    


## DESCRIPTION



           Extended attributes are _name_ :_value_ pairs associated with inodes
           (files, directories, symbolic links, etc.).  They are extensions
           to the normal attributes which are associated with all inodes in
           the system (i.e., the stat(2) data).  A complete overview of
           extended attributes concepts can be found in xattr(7).
    
           **removexattr**() removes the extended attribute identified by _name_
           and associated with the given _path_ in the filesystem.
    
           **lremovexattr**() is identical to **removexattr**(), except in the case
           of a symbolic link, where the extended attribute is removed from
           the link itself, not the file that it refers to.
    
           **fremovexattr**() is identical to **removexattr**(), only the extended
           attribute is removed from the open file referred to by _fd_ (as
           returned by open(2)) in place of _path_.
    
           An extended attribute name is a null-terminated string.  The _name_
           includes a namespace prefix; there may be several, disjoint
           namespaces associated with an individual inode.
    


## RETURN VALUE



           On success, zero is returned.  On failure, -1 is returned and
           _errno_ is set to indicate the error.
    


## ERRORS



           **ENODATA**
                  The named attribute does not exist.
    
           **ENOTSUP**
                  Extended attributes are not supported by the filesystem, or
                  are disabled.
    
           In addition, the errors documented in stat(2) can also occur.
    


## STANDARDS



           Linux.
    


* * *
# set_tid_address

## NAME



           set_tid_address - set pointer to thread ID
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **pid_t syscall(SYS_set_tid_address, int ***_tidptr_**);**
    
           _Note_ : glibc provides no wrapper for **set_tid_address**(),
           necessitating the use of syscall(2).
    


## DESCRIPTION



           For each thread, the kernel maintains two attributes (addresses)
           called _set_child_tid_ and _clear_child_tid_.  These two attributes
           contain the value NULL by default.
    
           _set_child_tid_
                  If a thread is started using clone(2) with the
                  **CLONE_CHILD_SETTID** flag, _set_child_tid_ is set to the value
                  passed in the _ctid_ argument of that system call.
    
                  When _set_child_tid_ is set, the very first thing the new
                  thread does is to write its thread ID at this address.
    
           _clear_child_tid_
                  If a thread is started using clone(2) with the
                  **CLONE_CHILD_CLEARTID** flag, _clear_child_tid_ is set to the
                  value passed in the _ctid_ argument of that system call.
    
           The system call **set_tid_address**() sets the _clear_child_tid_ value
           for the calling thread to _tidptr_.
    
           When a thread whose _clear_child_tid_ is not NULL terminates, then,
           if the thread is sharing memory with other threads, then 0 is
           written at the address specified in _clear_child_tid_ and the kernel
           performs the following operation:
    
               futex(clear_child_tid, FUTEX_WAKE, 1, NULL, NULL, 0);
    
           The effect of this operation is to wake a single thread that is
           performing a futex wait on the memory location.  Errors from the
           futex wake operation are ignored.
    


## RETURN VALUE



           **set_tid_address**() always returns the caller's thread ID.
    


## ERRORS



           **set_tid_address**() always succeeds.
    


## STANDARDS



           Linux.
    


* * *
# nice

## NAME



           nice - change process priority
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int nice(int** _inc_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **nice**():
               _XOPEN_SOURCE
                   || /* Since glibc 2.19: */ _DEFAULT_SOURCE
                   || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
    


## DESCRIPTION



           **nice**() adds _inc_ to the nice value for the calling thread.  (A
           higher nice value means a lower priority.)
    
           The range of the nice value is +19 (low priority) to -20 (high
           priority).  Attempts to set a nice value outside the range are
           clamped to the range.
    
           Traditionally, only a privileged process could lower the nice
           value (i.e., set a higher priority).  However, since Linux 2.6.12,
           an unprivileged process can decrease the nice value of a target
           process that has a suitable **RLIMIT_NICE** soft limit; see
           getrlimit(2) for details.
    


## RETURN VALUE



           On success, the new nice value is returned (but see VERSIONS
           below).  On error, -1 is returned, and _errno_ is set to indicate
           the error.
    
           A successful call can legitimately return -1.  To detect an error,
           set _errno_ to 0 before the call, and check whether it is nonzero
           after **nice**() returns -1.
    


## ERRORS



           **EPERM** The calling process attempted to increase its priority by
                  supplying a negative _inc_ but has insufficient privileges.
                  Under Linux, the **CAP_SYS_NICE** capability is required.  (But
                  see the discussion of the **RLIMIT_NICE** resource limit in
                  setrlimit(2).)
    


## VERSIONS



       **C library/kernel differences**
           POSIX.1 specifies that **nice**() should return the new nice value.
           However, the raw Linux system call returns 0 on success.
           Likewise, the **nice**() wrapper function provided in glibc 2.2.3 and
           earlier returns 0 on success.
    
           Since glibc 2.2.4, the **nice**() wrapper function provided by glibc
           provides conformance to POSIX.1 by calling getpriority(2) to
           obtain the new nice value, which is then returned to the caller.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           For further details on the nice value, see sched(7).
    
           _Note_ : the addition of the "autogroup" feature in Linux 2.6.38
           means that the nice value no longer has its traditional effect in
           many circumstances.  For details, see sched(7).
    


* * *
# KEYCTL_LINK

## NAME



           KEYCTL_LINK - link a key to a keyring
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/keyctl.h>  **/* Definition of **KEY*** constants */
           **#include <sys/syscall.h>   **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **long syscall(SYS_keyctl, KEYCTL_LINK, key_serial_t** _key_**,**
                        **key_serial_t** _keyring_**);**
    


## DESCRIPTION



           Create a link from a keyring to a key.
    
           The key to be linked is specified in _key_ ; the keyring is specified
           in _keyring_.
    
           If a key with the same type and description is already linked in
           the keyring, then that key is displaced from the keyring.
    
           Before creating the link, the kernel checks the nesting of the
           keyrings and returns appropriate errors if the link would produce
           a cycle or if the nesting of keyrings would be too deep (The limit
           on the nesting of keyrings is determined by the kernel constant
           **KEYRING_SEARCH_MAX_DEPTH** , defined with the value 6, and is
           necessary to prevent overflows on the kernel stack when
           recursively searching keyrings).
    
           The caller must have _link_ permission on the key being added and
           _write_ permission on the keyring.
    


## RETURN VALUE



           On success, 0 is returned.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EDEADLK**
                  The requested link would result in a cycle.
    
           **ELOOP** The requested link would cause the maximum nesting depth
                  for keyrings to be exceeded.
    
           **ENFILE**(before Linux 3.13)
                  The keyring is full.  (Before Linux 3.13, the available
                  space for storing keyring links was limited to a single
                  page of memory; since Linux 3.13, there is no fixed limit.)
    


## VERSIONS



           A wrapper is provided in the _libkeyutils_ library: keyctl_link(3).
    


## STANDARDS



           Linux.
    


* * *
# shutdown

## NAME



           shutdown - shut down part of a full-duplex connection
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/socket.h>**
    
           **int shutdown(int** _sockfd_**, int** _how_**);**
    


## DESCRIPTION



           The **shutdown**() call causes all or part of a full-duplex connection
           on the socket associated with _sockfd_ to be shut down.  If _how_ is
           **SHUT_RD** , further receptions will be disallowed.  If _how_ is
           **SHUT_WR** , further transmissions will be disallowed.  If _how_ is
           **SHUT_RDWR** , further receptions and transmissions will be
           disallowed.
    


## RETURN VALUE



           On success, zero is returned.  On error, -1 is returned, and _errno_
           is set to indicate the error.
    


## ERRORS



           **EBADF** _sockfd_ is not a valid file descriptor.
    
           **EINVAL** An invalid value was specified in _how_ (but see BUGS).
    
           **ENOTCONN**
                  The specified socket is not connected.
    
           **ENOTSOCK**
                  The file descriptor _sockfd_ does not refer to a socket.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           The constants **SHUT_RD** , **SHUT_WR** , **SHUT_RDWR** have the value 0, 1, 2,
           respectively, and are defined in _< sys/socket.h>_ since
           glibc-2.1.91.
    


## BUGS



           Checks for the validity of _how_ are done in domain-specific code,
           and before Linux 3.7 not all domains performed these checks.  Most
           notably, UNIX domain sockets simply ignored invalid values.  This
           problem was fixed for UNIX domain sockets in Linux 3.7.
    


* * *
# open_how

## NAME



           open_how - how to open a pathname
    


## LIBRARY



           Linux kernel headers
    


## SYNOPSIS



           **#include <linux/openat2.h>**
    
           **struct open_how {**
               **u64  flags;** /* **O_** * flags */
               **u64  mode;** /* Mode for **O_**{**CREAT** ,**TMPFILE**} */
               **u64  resolve;** /* **RESOLVE_** * flags */
               /* ... */
           **};**
    


## DESCRIPTION



           Specifies how a pathname should be opened.
    
           The fields are as follows:
    
           _flags_  This field specifies the file creation and file status
                  flags to use when opening the file.
    
           _mode_   This field specifies the mode for the new file.
    
           _resolve_
                  This is a bit mask of flags that modify the way in which
                  _all_ components of a pathname will be resolved (see
                  path_resolution(7) for background information).
    


## VERSIONS



           Extra fields may be appended to the structure, with a zero value
           in a new field resulting in the kernel behaving as though that
           extension field was not present.  Therefore, a user _must_ zero-fill
           this structure on initialization.
    


## STANDARDS



           Linux.
    


* * *
# exit_group

## NAME



           exit_group - exit all threads in a process
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>       **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **[[noreturn]] void syscall(SYS_exit_group, int** _status_**);**
    
           _Note_ : glibc provides no wrapper for **exit_group**(), necessitating
           the use of syscall(2).
    


## DESCRIPTION



           This system call terminates all threads in the calling process's
           thread group.
    


## RETURN VALUE



           This system call does not return.
    


## STANDARDS



           Linux.
    


## NOTES



           Since glibc 2.3, this is the system call invoked when the _exit(2)
           wrapper function is called.
    


* * *
# setup

## NAME



           setup - setup devices and filesystems, mount root filesystem
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **[[deprecated]] int setup(void);**
    


## DESCRIPTION



           **setup**() is called once from within _linux/init/main.c_.  It calls
           initialization functions for devices and filesystems configured
           into the kernel and then mounts the root filesystem.
    
           No user process may call **setup**().  Any user process, even a
           process with superuser permission, will receive **EPERM**.
    


## RETURN VALUE



           **setup**() always returns -1 for a user process.
    


## ERRORS



           **EPERM** Always, for a user process.
    


## STANDARDS



           Linux.
    


## VERSIONS



           Removed in Linux 2.1.121.
    
           The calling sequence varied: at some times **setup**() has had a
           single argument _void *BIOS_ and at other times a single argument
           _int magic_.
    


* * *
# nfsservctl

## NAME



           nfsservctl - syscall interface to kernel nfs daemon
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/nfsd/syscall.h>**
    
           **long nfsservctl(int** _cmd_**, struct nfsctl_arg ***_argp_**,**
                           **union nfsctl_res ***_resp_**);**
    


## DESCRIPTION



           _Note_ : Since Linux 3.1, this system call no longer exists.  It has
           been replaced by a set of files in the _nfsd_ filesystem; see
           nfsd(7).
    
               /*
                * These are the commands understood by nfsctl().
                */
               #define NFSCTL_SVC        0  /* This is a server process. */
               #define NFSCTL_ADDCLIENT  1  /* Add an NFS client. */
               #define NFSCTL_DELCLIENT  2  /* Remove an NFS client. */
               #define NFSCTL_EXPORT     3  /* Export a filesystem. */
               #define NFSCTL_UNEXPORT   4  /* Unexport a filesystem. */
               #define NFSCTL_UGIDUPDATE 5  /* Update a client's UID/GID map
                                               (only in Linux 2.4.x and earlier). */
               #define NFSCTL_GETFH      6  /* Get a file handle (used by mountd(8))
                                               (only in Linux 2.4.x and earlier). */
    
               struct nfsctl_arg {
                   int                       ca_version;     /* safeguard */
                   union {
                       struct nfsctl_svc     u_svc;
                       struct nfsctl_client  u_client;
                       struct nfsctl_export  u_export;
                       struct nfsctl_uidmap  u_umap;
                       struct nfsctl_fhparm  u_getfh;
                       unsigned int          u_debug;
                   } u;
               }
    
               union nfsctl_res {
                       struct knfs_fh          cr_getfh;
                       unsigned int            cr_debug;
               };
    


## RETURN VALUE



           On success, zero is returned.  On error, -1 is returned, and _errno_
           is set to indicate the error.
    


## STANDARDS



           Linux.
    


* * *
# socketpair

## NAME



           socketpair - create a pair of connected sockets
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/socket.h>**
    
           **int socketpair(int** _domain_**, int** _type_**, int** _protocol_**, int** _sv_**[2]);**
    


## DESCRIPTION



           The **socketpair**() call creates an unnamed pair of connected sockets
           in the specified _domain_ , of the specified _type_ , and using the
           optionally specified _protocol_.  For further details of these
           arguments, see socket(2).
    
           The file descriptors used in referencing the new sockets are
           returned in _sv[0]_ and _sv[1]_.  The two sockets are
           indistinguishable.
    


## RETURN VALUE



           On success, zero is returned.  On error, -1 is returned, _errno_ is
           set to indicate the error, and _sv_ is left unchanged
    
           On Linux (and other systems), **socketpair**() does not modify _sv_ on
           failure.  A requirement standardizing this behavior was added in
           POSIX.1-2008 TC2.
    


## ERRORS



           **EAFNOSUPPORT**
                  The specified address family is not supported on this
                  machine.
    
           **EFAULT** The address _sv_ does not specify a valid part of the process
                  address space.
    
           **EMFILE** The per-process limit on the number of open file
                  descriptors has been reached.
    
           **ENFILE** The system-wide limit on the total number of open files has
                  been reached.
    
           **EOPNOTSUPP**
                  The specified protocol does not support creation of socket
                  pairs.
    
           **EPROTONOSUPPORT**
                  The specified protocol is not supported on this machine.
    


## VERSIONS



           On Linux, the only supported domains for this call are **AF_UNIX**(or
           synonymously, **AF_LOCAL**) and **AF_TIPC**(since Linux 4.12).
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# bdflush

## NAME



           bdflush - start, flush, or tune buffer-dirty-flush daemon
    


## SYNOPSIS



           **#include <sys/kdaemon.h>**
    
           **int bdflush(int** _func_**, long** _data_**);**
    


## DESCRIPTION



           This system call used to turn the calling process into the _bdflush_
           daemon, or tune it, or flush the "old buffers".  It then
           progressively lost all of that functionality.
    
           See _fs/buffer.c_ in the kernel version you're interested in to see
           what it actually does there.
    


## ERRORS



           **ENOSYS**(this system call is unimplemented)
    


## STANDARDS



           Linux.
    


* * *
# msync

## NAME



           msync - synchronize a file with a memory map
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/mman.h>**
    
           **int msync(** size_t length;
                     **void** _addr_**[**_length_**], size_t** _length_**, int** _flags_**);**
    


## DESCRIPTION



           **msync**() flushes changes made to the in-core copy of a file that
           was mapped into memory using mmap(2) back to the filesystem.
           Without use of this call, there is no guarantee that changes are
           written back before munmap(2) is called.  To be more precise, the
           part of the file that corresponds to the memory area starting at
           _addr_ and having length _length_ is updated.
    
           The _flags_ argument should specify exactly one of **MS_ASYNC** and
           **MS_SYNC** , and may additionally include the **MS_INVALIDATE** bit.
           These bits have the following meanings:
    
           **MS_ASYNC**
                  Specifies that an update be scheduled, but the call returns
                  immediately.
    
           **MS_SYNC**
                  Requests an update and waits for it to complete.
    
           **MS_INVALIDATE**
                  Asks to invalidate other mappings of the same file (so that
                  they can be updated with the fresh values just written).
    


## RETURN VALUE



           On success, zero is returned.  On error, -1 is returned, and _errno_
           is set to indicate the error.
    


## ERRORS



           **EBUSY  MS_INVALIDATE** was specified in _flags_ , and a memory lock
                  exists for the specified address range.
    
           **EINVAL** _addr_ is not a multiple of PAGESIZE; or any bit other than
                  **MS_ASYNC** | **MS_INVALIDATE** | **MS_SYNC** is set in _flags_ ; or both
                  **MS_SYNC** and **MS_ASYNC** are set in _flags_.
    
           **ENOMEM** The indicated memory (or part of it) was not mapped.
    


## VERSIONS



           According to POSIX, either **MS_SYNC** or **MS_ASYNC** must be specified
           in _flags_ , and indeed failure to include one of these flags will
           cause **msync**() to fail on some systems.  However, Linux permits a
           call to **msync**() that specifies neither of these flags, with
           semantics that are (currently) equivalent to specifying **MS_ASYNC**.
           (Since Linux 2.6.19, **MS_ASYNC** is in fact a no-op, since the kernel
           properly tracks dirty pages and flushes them to storage as
           necessary.)  Notwithstanding the Linux behavior, portable, future-
           proof applications should ensure that they specify either **MS_SYNC**
           or **MS_ASYNC** in _flags_.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# io_setup

## NAME



           io_setup - create an asynchronous I/O context
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    
           Alternatively, Asynchronous I/O library (_libaio_ , _-laio_); see
           VERSIONS.
    


## SYNOPSIS



           **#include <linux/aio_abi.h>          **/* Defines needed types */
    
           **long io_setup(unsigned int** _nr_events_**, aio_context_t ***_ctx_idp_**);**
    
           _Note_ : There is no glibc wrapper for this system call; see
           VERSIONS.
    


## DESCRIPTION



           _Note_ : this page describes the raw Linux system call interface.
           The wrapper function provided by _libaio_ uses a different type for
           the _ctx_idp_ argument.  See VERSIONS.
    
           The **io_setup**() system call creates an asynchronous I/O context
           suitable for concurrently processing _nr_events_ operations.  The
           _ctx_idp_ argument must not point to an AIO context that already
           exists, and must be initialized to 0 prior to the call.  On
           successful creation of the AIO context, _*ctx_idp_ is filled in with
           the resulting handle.
    


## RETURN VALUE



           On success, **io_setup**() returns 0.  For the failure return, see
           VERSIONS.
    


## ERRORS



           **EAGAIN** The specified _nr_events_ exceeds the limit of available
                  events, as defined in _/proc/sys/fs/aio-max-nr_ (see
                  proc(5)).
    
           **EFAULT** An invalid pointer is passed for _ctx_idp_.
    
           **EINVAL** _ctx_idp_ is not initialized, or the specified _nr_events_
                  exceeds internal limits.  _nr_events_ should be greater than
                  0.
    
           **ENOMEM** Insufficient kernel resources are available.
    
           **ENOSYS io_setup**() is not implemented on this architecture.
    


## VERSIONS



           glibc does not provide a wrapper for this system call.  You could
           invoke it using syscall(2).  But instead, you probably want to use
           the **io_setup**() wrapper function provided by _libaio_.
    
           Note that the _libaio_ wrapper function uses a different type
           (_io_context_t *_) for the _ctx_idp_ argument.  Note also that the
           _libaio_ wrapper does not follow the usual C library conventions for
           indicating errors: on error it returns a negated error number (the
           negative of one of the values listed in ERRORS).  If the system
           call is invoked via syscall(2), then the return value follows the
           usual conventions for indicating an error: -1, with _errno_ set to a
           (positive) value that indicates the error.
    


## STANDARDS



           Linux.
    


* * *
# ustat

## NAME



           ustat - get filesystem statistics
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/types.h>**
           **#include <unistd.h>    **/* libc[45] */
           **#include <ustat.h>     **/* glibc2 */
    
           **[[deprecated]] int ustat(dev_t** _dev_**, struct ustat ***_ubuf_**);**
    


## DESCRIPTION



           **ustat**() returns information about a mounted filesystem.  _dev_ is a
           device number identifying a device containing a mounted
           filesystem.  _ubuf_ is a pointer to a _ustat_ structure that contains
           the following members:
    
               daddr_t f_tfree;      /* Total free blocks */
               ino_t   f_tinode;     /* Number of free inodes */
               char    f_fname[6];   /* Filsys name */
               char    f_fpack[6];   /* Filsys pack name */
    
           The last two fields, _f_fname_ and _f_fpack_ , are not implemented and
           will always be filled with null bytes ('\0').
    


## RETURN VALUE



           On success, zero is returned and the _ustat_ structure pointed to by
           _ubuf_ will be filled in.  On error, -1 is returned, and _errno_ is
           set to indicate the error.
    


## ERRORS



           **EFAULT** _ubuf_ points outside of your accessible address space.
    
           **EINVAL** _dev_ does not refer to a device containing a mounted
                  filesystem.
    
           **ENOSYS** The mounted filesystem referenced by _dev_ does not support
                  this operation, or any version of Linux before Linux
                  1.3.16.
    


## STANDARDS



           None.
    


* * *
# listmount

## NAME



           listmount - get a list of mount ID's
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/mount.h>  **/* Definition of struct mnt_id_req constants */
           **#include <unistd.h>**
    
           **int syscall(** size_t n;
                       **SYS_listmount, struct mnt_id_req ***_req_**,**
                       **uint64_t** _mnt_ids_**[**_n_**], size_t** _n_**,**
                       **unsigned long** _flags_**);**
    
           **#include <linux/mount.h>**
    
           **struct mnt_id_req {**
               **__u32  size;** /* sizeof(struct mnt_id_req) */
               **__u64  mnt_id;** /* The parent mnt_id being searched */
               **__u64  param;** /* The next mnt_id we want to find */
           **};**
    
           _Note_ : glibc provides no wrapper for **listmount**(), necessitating the
           use of syscall(2).
    


## DESCRIPTION



           To access the mounts in your namespace, you must have
           CAP_SYS_ADMIN in the user namespace.
    
           This function returns a list of mount IDs under the **req.mnt_id**.
           This is meant to be used in conjuction with statmount(2) in order
           to provide a way to iterate and discover mounted file systems.
    
       **The mnt_id_req structure**
           _req.size_ is used by the kernel to determine which struct
           _mnt_id_req_ is being passed in, it should always be set to
           _sizeof(struct mnt_id_req)_.
    
           _req.mnt_id_ is the parent mnt_id that we will list from, which can
           either be **LSMT_ROOT** which means the root mount of the current
           mount namespace, or a mount ID obtained from either statx(2) using
           **STATX_MNT_ID_UNIQUE** or from listmount(2).
    
           _req.param_ is used to tell the kernel what mount ID to start the
           list from.  This is useful if multiple calls to listmount(2) are
           required.  This can be set to the last mount ID returned in order
           to resume from a previous spot in the list.
    


## RETURN VALUE



           On success, the number of entries filled into _mnt_ids_ is returned;
           0 if there are no more mounts left.  On error, -1 is returned, and
           _errno_ is set to indicate the error.
    


## ERRORS



           **EPERM** Permission is denied for accessing this mount.
    
           **EFAULT** _req_ or _mnt_ids_ points to a location outside the process's
                  accessible address space.
    
           **EINVAL** Invalid flag specified in _flags_.
    
           **EINVAL** _req_ is of insufficient size to be utilized.
    
           **E2BIG** _req_ is too large, the limit is the architectures page size.
    
           **ENOENT** The specified _req.mnt_id_ doesn't exist.
    
           **ENOMEM** Out of memory (i.e., kernel memory).
    


## STANDARDS



           Linux.
    


* * *
# io_cancel

## NAME



           io_cancel - cancel an outstanding asynchronous I/O operation
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    
           Alternatively, Asynchronous I/O library (_libaio_ , _-laio_); see
           VERSIONS.
    


## SYNOPSIS



           **#include <linux/aio_abi.h>    **/* Definition of needed types */
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_io_cancel, aio_context_t** _ctx_id_**, struct iocb ***_iocb_**,**
                       **struct io_event ***_result_**);**
    


## DESCRIPTION



           _Note_ : this page describes the raw Linux system call interface.
           The wrapper function provided by _libaio_ uses a different type for
           the _ctx_id_ argument.  See VERSIONS.
    
           The **io_cancel**() system call attempts to cancel an asynchronous I/O
           operation previously submitted with io_submit(2).  The _iocb_
           argument describes the operation to be canceled and the _ctx_id_
           argument is the AIO context to which the operation was submitted.
           If the operation is successfully canceled, the event will be
           copied into the memory pointed to by _result_ without being placed
           into the completion queue.
    


## RETURN VALUE



           On success, **io_cancel**() returns 0.  For the failure return, see
           VERSIONS.
    


## ERRORS



           **EAGAIN** The _iocb_ specified was not canceled.
    
           **EFAULT** One of the data structures points to invalid data.
    
           **EINVAL** The AIO context specified by _ctx_id_ is invalid.
    
           **ENOSYS io_cancel**() is not implemented on this architecture.
    


## VERSIONS



           You probably want to use the **io_cancel**() wrapper function provided
           by _libaio_.
    
           Note that the _libaio_ wrapper function uses a different type
           (_io_context_t_) for the _ctx_id_ argument.  Note also that the _libaio_
           wrapper does not follow the usual C library conventions for
           indicating errors: on error it returns a negated error number (the
           negative of one of the values listed in ERRORS).  If the system
           call is invoked via syscall(2), then the return value follows the
           usual conventions for indicating an error: -1, with _errno_ set to a
           (positive) value that indicates the error.
    


## STANDARDS



           Linux.
    


* * *
# get_kernel_syms

## NAME



           get_kernel_syms - retrieve exported kernel and module symbols
    


## SYNOPSIS



           **#include <linux/module.h>**
    
           **[[deprecated]] int get_kernel_syms(struct kernel_sym ***_table_**);**
    


## DESCRIPTION



           **Note** : This system call is present only before Linux 2.6.
    
           If _table_ is NULL, **get_kernel_syms**() returns the number of symbols
           available for query.  Otherwise, it fills in a table of
           structures:
    
               struct kernel_sym {
                   unsigned long value;
                   char          name[60];
               };
    
           The symbols are interspersed with magic symbols of the form
           **#**_module-name_ with the kernel having an empty name.  The value
           associated with a symbol of this form is the address at which the
           module is loaded.
    
           The symbols exported from each module follow their magic module
           tag and the modules are returned in the reverse of the order in
           which they were loaded.
    


## RETURN VALUE



           On success, returns the number of symbols copied to _table_.  On
           error, -1 is returned and _errno_ is set to indicate the error.
    


## ERRORS



           There is only one possible error return:
    
           **ENOSYS get_kernel_syms**() is not supported in this version of the
                  kernel.
    


## STANDARDS



           Linux.
    


## BUGS



           There is no way to indicate the size of the buffer allocated for
           _table_.  If symbols have been added to the kernel since the program
           queried for the symbol table size, memory will be corrupted.
    
           The length of exported symbol names is limited to 59 characters.
    
           Because of these limitations, this system call is deprecated in
           favor of query_module(2) (which is itself nowadays deprecated in
           favor of other interfaces described on its manual page).
    


* * *
# modules.dep

## NAME



           modules.dep, modules.dep.bin - Module dependency information
    


## SYNOPSIS



           /lib/modules/modules.dep
    
           /lib/modules/modules.dep.bin
    


## DESCRIPTION



           **modules.dep.bin** is a binary file generated by **depmod** listing the
           dependencies for every module in the directories under
           /lib/modules/_version_. It is used by **kmod** tools such as **modprobe**
           and libkmod.
    
           Its text counterpart is located in the same directory with the
           name **modules.dep**. The text version is maintained only for ease of
           reading by humans and is in no way used by any **kmod** tool.
    
           These files are not intended for editing or use by any additional
           utilities as their format is subject to change in the future. You
           should use the modinfo(8) command to obtain information about
           modules in a future proof and compatible fashion rather than
           touching these files.
    


## BUGS



           Please direct any bug reports to kmod's issue tracker at
           https://github.com/kmod-project/kmod/issues/ alongside with
           version used, steps to reproduce the problem and the expected
           outcome.
    


* * *
# proc_pid_stack

## NAME



           /proc/pid/stack - kernel stack
    


## DESCRIPTION



           _/proc/_ pid _/stack_ (since Linux 2.6.29)
                  This file provides a symbolic trace of the function calls
                  in this process's kernel stack.  This file is provided only
                  if the kernel was built with the **CONFIG_STACKTRACE**
                  configuration option.
    
                  Permission to access this file is governed by a ptrace
                  access mode **PTRACE_MODE_ATTACH_FSCREDS** check; see
                  ptrace(2).
    


* * *
# proc_mtrr

## NAME



           /proc/mtrr - memory type range registers
    


## DESCRIPTION



           _/proc/mtrr_
                  Memory Type Range Registers.  See the Linux kernel source
                  file _Documentation/x86/mtrr.rst_ (or
                  _Documentation/x86/mtrr.txt_ before Linux 5.2, or
                  _Documentation/mtrr.txt_ before Linux 2.6.28) for details.
    


* * *
# proc_pid_exe

## NAME



           /proc/pid/exe - symbolic link to program pathname
    


## DESCRIPTION



           _/proc/_ pid _/exe_
                  Under Linux 2.2 and later, this file is a symbolic link
                  containing the actual pathname of the executed command.
                  This symbolic link can be dereferenced normally; attempting
                  to open it will open the executable.  You can even type
                  _/proc/_ pid _/exe_ to run another copy of the same executable
                  that is being run by process _pid_.  If the pathname has been
                  unlinked, the symbolic link will contain the string
                  ' (deleted)' appended to the original pathname.  In a
                  multithreaded process, the contents of this symbolic link
                  are not available if the main thread has already terminated
                  (typically by calling pthread_exit(3)).
    
                  Permission to dereference or read (readlink(2)) this
                  symbolic link is governed by a ptrace access mode
                  **PTRACE_MODE_READ_FSCREDS** check; see ptrace(2).
    
                  Under Linux 2.0 and earlier, _/proc/_ pid _/exe_ is a pointer to
                  the binary which was executed, and appears as a symbolic
                  link.  A readlink(2) call on this file under Linux 2.0
                  returns a string in the format:
    
                      [device]:inode
    
                  For example, [0301]:1502 would be inode 1502 on device
                  major 03 (IDE, MFM, etc. drives) minor 01 (first partition
                  on the first drive).
    
                  find(1) with the _-inum_ option can be used to locate the
                  file.
    


* * *