tripathysagar/man_text huggingface dataset:
# sched_rr_get_interval

## NAME



           sched_rr_get_interval - get the SCHED_RR interval for the named
           process
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sched.h>**
    
           **int sched_rr_get_interval(pid_t** _pid_**, struct timespec ***_tp_**);**
    


## DESCRIPTION



           **sched_rr_get_interval**() writes into the **timespec**(3) structure
           pointed to by _tp_ the round-robin time quantum for the process
           identified by _pid_.  The specified process should be running under
           the **SCHED_RR** scheduling policy.
    
           If _pid_ is zero, the time quantum for the calling process is
           written into _*tp_.
    


## RETURN VALUE



           On success, **sched_rr_get_interval**() returns 0.  On error, -1 is
           returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EFAULT** Problem with copying information to user space.
    
           **EINVAL** Invalid pid.
    
           **ENOSYS** The system call is not yet implemented (only on rather old
                  kernels).
    
           **ESRCH** Could not find a process with the ID _pid_.
    


## VERSIONS



       **Linux**
           Linux 3.9 added a new mechanism for adjusting (and viewing) the
           **SCHED_RR** quantum: the _/proc/sys/kernel/sched_rr_timeslice_ms_ file
           exposes the quantum as a millisecond value, whose default is 100.
           Writing 0 to this file resets the quantum to the default value.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           POSIX systems on which **sched_rr_get_interval**() is available define
           **_POSIX_PRIORITY_SCHEDULING** in _< unistd.h>_.
    


* * *
# PR_GET_SECCOMP

## NAME



           PR_GET_SECCOMP - get the secure computing mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **int prctl(PR_GET_SECCOMP);**
    


## DESCRIPTION



           Return the secure computing mode of the calling thread.
    
           If the caller is not in secure computing mode, this operation
           returns 0; if the caller is in strict secure computing mode, then
           the **prctl**() call will cause a **SIGKILL** signal to be sent to the
           process.  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 **SIGKILL** signal.
    
           This operation is available only if the kernel is configured with
           **CONFIG_SECCOMP** enabled.
    


## RETURN VALUE



           On success, this call returns the nonnegative value described
           above.  On error, -1 is returned, and _errno_ is set to indicate the
           error; or the process is killed.
    


## ERRORS



           **EINVAL** The kernel was not configured with **CONFIG_SECCOMP**.
    
           **SIGKILL**
                  The caller is in strict secure computing mode.
    
           **SIGKILL**
                  The caller is in filter mode, and this system call is not
                  allowed by the seccomp filters.
    


## FILES



           _/proc/_ pid _/status_
                  Since Linux 3.8, the _Seccomp_ field of this file provides a
                  method of obtaining the same information, without the risk
                  that the process is killed; see proc_pid_status(5).
    


## STANDARDS



           Linux.
    


* * *
# FUTEX_REQUEUE

## NAME



           FUTEX_REQUEUE - wake some waiters, and requeue others
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/futex.h>  **/* Definition of **FUTEX_*** constants */
           **#include <sys/syscall.h>  **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **long syscall(SYS_futex, uint32_t ***_uaddr_**, FUTEX_REQUEUE,**
                        **uint32_t** _val_**, uint32_t** _val2_**, uint32_t ***_uaddr2_**);**
    


## DESCRIPTION



           This operation performs the same task as
           FUTEX_CMP_REQUEUE(2const), except that the futex word isn't
           compared.
    


## RETURN VALUE



           On error, -1 is returned, and _errno_ is set to indicate the error.
    
           On success, **FUTEX_REQUEUE** returns the number of waiters that were
           woken up.
    


## ERRORS



           See futex(2).
    
           **EFAULT** _uaddr2_ did not point to a valid user-space address.
    
           **EINVAL** _uaddr2_ does not point to a valid object—that is, the
                  address is not four-byte-aligned.
    
           **EINVAL** The kernel detected an inconsistency between the user-space
                  state at _uaddr_ and the kernel state—that is, it detected a
                  waiter which waits in FUTEX_LOCK_PI(2const) or
                  FUTEX_LOCK_PI2(2const) on _uaddr_.
    


## STANDARDS



           Linux.
    


* * *
# KEYCTL_GET_PERSISTENT

## NAME



           KEYCTL_GET_PERSISTENT - get the persistent keyring for a user
    


## 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_GET_PERSISTENT, uid_t** _uid_**,**
                        **key_serial_t** _keyring_**);**
    


## DESCRIPTION



           Get the persistent keyring (persistent-keyring(7)) for a specified
           user and link it to a specified keyring.
    
           The user ID is specified in _uid_.  If the value -1 is specified,
           the caller's real user ID is used.  The ID of the destination
           keyring is specified in _keyring_.
    
           The caller must have the **CAP_SETUID** capability in its user
           namespace in order to fetch the persistent keyring for a user ID
           that does not match either the real or effective user ID of the
           caller.
    
           If the call is successful, a link to the persistent keyring is
           added to the keyring whose ID was specified in _keyring_.
    
           The caller must have _write_ permission on the keyring.
    
           The persistent keyring will be created by the kernel if it does
           not yet exist.
    
           Each time the **KEYCTL_GET_PERSISTENT** operation is performed, the
           persistent keyring will have its expiration timeout reset to the
           value in:
    
               /proc/sys/kernel/keys/persistent_keyring_expiry
    
           Should the timeout be reached, the persistent keyring will be
           removed and everything it pins can then be garbage collected.
    
           Persistent keyrings were added in Linux 3.13.
    


## RETURN VALUE



           On success, the ID of the persistent keyring.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EPERM** _uid_ specified a UID other than the calling thread's real or
                  effective UID, and the caller did not have the **CAP_SETUID**
                  capability.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# KEYCTL_JOIN_SESSION_KEYRING

## NAME



           KEYCTL_JOIN_SESSION_KEYRING - replace the session keyring this
           process subscribes to with a new one
    


## 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_JOIN_SESSION_KEYRING,**
                        **char *_Nullable** _desc_**);**
    


## DESCRIPTION



           Replace the session keyring this process subscribes to with a new
           session keyring.
    
           If _desc_ is NULL, an anonymous keyring with the description "_ses"
           is created and the process is subscribed to that keyring as its
           session keyring, displacing the previous session keyring.
    
           Otherwise, _desc_ is treated as the description (name) of a keyring,
           and the behavior is as follows:
    
           •  If a keyring with a matching description exists, the process
              will attempt to subscribe to that keyring as its session
              keyring if possible; if that is not possible, an error is
              returned.  In order to subscribe to the keyring, the caller
              must have _search_ permission on the keyring.
    
           •  If a keyring with a matching description does not exist, then a
              new keyring with the specified description is created, and the
              process is subscribed to that keyring as its session keyring.
    


## RETURN VALUE



           On success, the ID of the joined session keyring.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_GET_FPEMU

## NAME



           PR_GET_FPEMU - get the floating-point emulation control bits
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Return floating-point emulation control bits, in the location
           pointed to by _fpemu_.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _fpemu_ is an invalid address.
    


## STANDARDS



           Linux.  ia64 only.
    


* * *
# setfsgid

## NAME



           setfsgid - set group identity used for filesystem checks
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/fsuid.h>**
    
           **[[deprecated]] int setfsgid(gid_t** _fsgid_**);**
    


## DESCRIPTION



           On Linux, a process has both a filesystem group ID and an
           effective group ID.  The (Linux-specific) filesystem group ID is
           used for permissions checking when accessing filesystem objects,
           while the effective group ID is used for some other kinds of
           permissions checks (see credentials(7)).
    
           Normally, the value of the process's filesystem group ID is the
           same as the value of its effective group ID.  This is so, because
           whenever a process's effective group ID is changed, the kernel
           also changes the filesystem group ID to be the same as the new
           value of the effective group ID.  A process can cause the value of
           its filesystem group ID to diverge from its effective group ID by
           using **setfsgid**() to change its filesystem group ID to the value
           given in _fsgid_.
    
           **setfsgid**() will succeed only if the caller is the superuser or if
           _fsgid_ matches either the caller's real group ID, effective group
           ID, saved set-group-ID, or current the filesystem user ID.
    


## RETURN VALUE



           On both success and failure, this call returns the previous
           filesystem group ID of the caller.
    


## STANDARDS



           Linux.
    


## NOTES



           The filesystem group ID concept and the **setfsgid**() system call
           were invented for historical reasons that are no longer applicable
           on modern Linux kernels.  See setfsuid(2) for a discussion of why
           the use of both setfsuid(2) and **setfsgid**() is nowadays unneeded.
    
           The original Linux **setfsgid**() system call supported only 16-bit
           group IDs.  Subsequently, Linux 2.4 added **setfsgid32**() supporting
           32-bit IDs.  The glibc **setfsgid**() wrapper function transparently
           deals with the variation across kernel versions.
    


## BUGS



           No error indications of any kind are returned to the caller, and
           the fact that both successful and unsuccessful calls return the
           same value makes it impossible to directly determine whether the
           call succeeded or failed.  Instead, the caller must resort to
           looking at the return value from a further call such as
           _setfsgid(-1)_ (which will always fail), in order to determine if a
           preceding call to **setfsgid**() changed the filesystem group ID.  At
           the very least, **EPERM** should be returned when the call fails
           (because the caller lacks the **CAP_SETGID** capability).
    


* * *
# TIOCSTI

## NAME



           TIOCSTI - faking input
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <asm/termbits.h>  **/* Definition of **TIOCSTI** */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, TIOCSTI, const char ***_argp_**);**
    


## DESCRIPTION



           Insert the given byte in the input queue.
    
           Since Linux 6.2, this operation may require the **CAP_SYS_ADMIN**
           capability (if the _dev.tty.legacy_tiocsti_ sysctl variable is set
           to false).
    


## RETURN VALUE



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


## ERRORS



           **EPERM** Insufficient permission.
    


* * *
# rmdir

## NAME



           rmdir - delete a directory
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int rmdir(const char ***_path_**);**
    


## DESCRIPTION



           **rmdir**() deletes a directory, which must be empty.
    


## RETURN VALUE



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


## ERRORS



           **EACCES** Write access to the directory containing _path_ was not
                  allowed, or one of the directories in the path prefix of
                  _path_ did not allow search permission.  (See also
                  path_resolution(7).)
    
           **EBUSY** _path_ is currently in use by the system or some process that
                  prevents its removal.  On Linux, this means _path_ is
                  currently used as a mount point or is the root directory of
                  the calling process.
    
           **EFAULT** _path_ points outside your accessible address space.
    
           **EINVAL** _path_ has _._  as last component.
    
           **ELOOP** Too many symbolic links were encountered in resolving _path_.
    
           **ENAMETOOLONG**
                  _path_ was too long.
    
           **ENOENT** A directory component in _path_ does not exist or is a
                  dangling symbolic link.
    
           **ENOMEM** Insufficient kernel memory was available.
    
           **ENOTDIR**
                  _path_ , or a component used as a directory in _path_ , is not,
                  in fact, a directory.
    
           **ENOTEMPTY**
                  _path_ contains entries other than _._  and _.._ ; or, _path_ has _.._
                  as its final component.  POSIX.1 also allows **EEXIST** for
                  this condition.
    
           **EPERM** The directory containing _path_ has the sticky bit (**S_ISVTX**)
                  set and the process's effective user ID is neither the user
                  ID of the file to be deleted nor that of the directory
                  containing it, and the process is not privileged (Linux:
                  does not have the **CAP_FOWNER** capability).
    
           **EPERM** The filesystem containing _path_ does not support the removal
                  of directories.
    
           **EROFS** _path_ refers to a directory on a read-only filesystem.
    


## STANDARDS



           POSIX.1-2008.
    


## BUGS



           Infelicities in the protocol underlying NFS can cause the
           unexpected disappearance of directories which are still being
           used.
    


* * *
# PR_SET_IO_FLUSHER

## NAME



           PR_SET_IO_FLUSHER - change the IO_FLUSHER state
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **int prctl(PR_SET_IO_FLUSHER, long** _state_**, 0L, 0L, 0L);**
    


## DESCRIPTION



           If a user process is involved in the block layer or filesystem I/O
           path, and can allocate memory while processing I/O requests it
           must set _state_ to 1.  This will put the process in the IO_FLUSHER
           state, which allows it special treatment to make progress when
           allocating memory.  If _state_ is 0, the process will clear the
           IO_FLUSHER state, and the default behavior will be used.
    
           The calling process must have the **CAP_SYS_RESOURCE** capability.
    
           The IO_FLUSHER state is inherited by a child process created via
           fork(2) and is preserved across execve(2).
    
           Examples of IO_FLUSHER applications are FUSE daemons, SCSI device
           emulation daemons, and daemons that perform error handling like
           multipath path recovery applications.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _state_ is not a valid value.
    


## STANDARDS



           Linux.
    


* * *
# sigpending

## NAME



           sigpending, rt_sigpending - examine pending signals
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <signal.h>**
    
           **int sigpending(sigset_t ***_set_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **sigpending**():
               _POSIX_C_SOURCE
    


## DESCRIPTION



           **sigpending**() returns the set of signals that are pending for
           delivery to the calling thread (i.e., the signals which have been
           raised while blocked).  The mask of pending signals is returned in
           _set_.
    


## RETURN VALUE



           **sigpending**() returns 0 on success.  On failure, -1 is returned and
           _errno_ is set to indicate the error.
    


## ERRORS



           **EFAULT** _set_ points to memory which is not a valid part of the
                  process address space.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           See sigsetops(3) for details on manipulating signal sets.
    
           If a signal is both blocked and has a disposition of "ignored", it
           is _not_ added to the mask of pending signals when generated.
    
           The set of signals that is pending for a thread is the union of
           the set of signals that is pending for that thread and the set of
           signals that is pending for the process as a whole; see signal(7).
    
           A child created via fork(2) initially has an empty pending signal
           set; the pending signal set is preserved across an execve(2).
    


## BUGS



           Up to and including glibc 2.2.1, there is a bug in the wrapper
           function for **sigpending**() which means that information about
           pending real-time signals is not correctly returned.
    


* * *
# F_GETFD

## NAME



           F_GETFD, F_SETFD - get/set file descriptor flags
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <fcntl.h>**
    
           **int fcntl(int** _fd_**, F_GETFD);**
           **int fcntl(int** _fd_**, F_SETFD, int** _arg_**);**
    


## DESCRIPTION



           These operations manipulate the flags associated with a file
           descriptor.  Currently, only one such flag is defined: **FD_CLOEXEC** ,
           the close-on-exec flag.  If the **FD_CLOEXEC** bit is set, the file
           descriptor will automatically be closed during a successful
           execve(2).  (If the execve(2) fails, the file descriptor is left
           open.)  If the **FD_CLOEXEC** bit is not set, the file descriptor will
           remain open across an execve(2).
    
           **F_GETFD**
                  Return (as the function result) the file descriptor flags;
                  _arg_ is ignored.
    
           **F_SETFD**
                  Set the file descriptor flags to the value specified by
                  _arg_.
    


## RETURN VALUE



           **F_GETFD**
                  Value of file descriptor flags.
    
           **F_SETFD**
                  Zero.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           See fcntl(2).
    


## STANDARDS



           POSIX.1-2008.
    


## CAVEATS



           In multithreaded programs, using fcntl(2) **F_SETFD** to set the
           close-on-exec flag at the same time as another thread performs a
           fork(2) plus execve(2) is vulnerable to a race condition that may
           unintentionally leak the file descriptor to the program executed
           in the child process.  See the discussion of the **O_CLOEXEC** flag in
           open(2) for details and a remedy to the problem.
    


* * *
# timer_delete

## NAME



           timer_delete - delete a POSIX per-process timer
    


## LIBRARY



           Real-time library (_librt_ , _-lrt_)
    


## SYNOPSIS



           **#include <time.h>**
    
           **int timer_delete(timer_t** _timerid_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **timer_delete**():
               _POSIX_C_SOURCE >= 199309L
    


## DESCRIPTION



           **timer_delete**() deletes the timer whose ID is given in _timerid_.  If
           the timer was armed at the time of this call, it is disarmed
           before being deleted.  The treatment of any pending signal
           generated by the deleted timer is unspecified.
    


## RETURN VALUE



           On success, **timer_delete**() returns 0.  On failure, -1 is returned,
           and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL** _timerid_ is not a valid timer ID.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# PR_CAP_AMBIENT_LOWER

## NAME



           PR_CAP_AMBIENT_LOWER - lower the ambient capability set of the
           calling thread
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **int prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_LOWER, long** _cap_**, 0L, 0L);**
    


## DESCRIPTION



           The capability specified in _cap_ is removed from the ambient
           capability set.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _cap_ does not specify a valid capability.
    


## VERSIONS



           See PR_CAP_AMBIENT(2const).
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_FPEXC

## NAME



           PR_SET_FPEXC - set the floating-point exception mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set floating-point exception mode to _mode_.  Pass
           **PR_FP_EXC_SW_ENABLE** to use FPEXC for FP exception enables,
           **PR_FP_EXC_DIV** for floating-point divide by zero, **PR_FP_EXC_OVF** for
           floating-point overflow, **PR_FP_EXC_UND** for floating-point
           underflow, **PR_FP_EXC_RES** for floating-point inexact result,
           **PR_FP_EXC_INV** for floating-point invalid operation,
           **PR_FP_EXC_DISABLED** for FP exceptions disabled, **PR_FP_EXC_NONRECOV**
           for async nonrecoverable exception mode, **PR_FP_EXC_ASYNC** for async
           recoverable exception mode, **PR_FP_EXC_PRECISE** for precise
           exception mode.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _mode_ is not a valid value.
    


## STANDARDS



           Linux.  PowerPC only.
    


* * *
# getpeername

## NAME



           getpeername - get name of connected peer socket
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/socket.h>**
    
           **int getpeername(int** _sockfd_**, struct sockaddr *restrict** _addr_**,**
                           **socklen_t *restrict** _addrlen_**);**
    


## DESCRIPTION



           **getpeername**() returns the address of the peer connected to the
           socket _sockfd_ , in the buffer pointed to by _addr_.  The _addrlen_
           argument should be initialized to indicate the amount of space
           pointed to by _addr_.  On return it contains the actual size of the
           name returned (in bytes).  The name is truncated if the buffer
           provided is too small.
    
           The returned address is truncated if the buffer provided is too
           small; in this case, _addrlen_ will return a value greater than was
           supplied to the call.
    


## RETURN VALUE



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


## ERRORS



           **EBADF** The argument _sockfd_ is not a valid file descriptor.
    
           **EFAULT** The _addr_ argument points to memory not in a valid part of
                  the process address space.
    
           **EINVAL** _addrlen_ is invalid (e.g., is negative).
    
           **ENOBUFS**
                  Insufficient resources were available in the system to
                  perform the operation.
    
           **ENOTCONN**
                  The socket is not connected.
    
           **ENOTSOCK**
                  The file descriptor _sockfd_ does not refer to a socket.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           For stream sockets, once a connect(2) has been performed, either
           socket can call **getpeername**() to obtain the address of the peer
           socket.  On the other hand, datagram sockets are connectionless.
           Calling connect(2) on a datagram socket merely sets the peer
           address for outgoing datagrams sent with write(2) or recv(2).  The
           caller of connect(2) can use **getpeername**() to obtain the peer
           address that it earlier set for the socket.  However, the peer
           socket is unaware of this information, and calling **getpeername**()
           on the peer socket will return no useful information (unless a
           connect(2) call was also executed on the peer).  Note also that
           the receiver of a datagram can obtain the address of the sender
           when using recvfrom(2).
    


* * *
# ioctl_nsfs

## NAME



           ioctl_nsfs - ioctl() operations for Linux namespaces
    


## SYNOPSIS



           **#include <linux/nsfs.h>  **/* Definition of **NS_*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, unsigned long** _op_**, ...);**
    


## DESCRIPTION



       **Discovering namespace relationships**
           NS_GET_USERNS(2const)
           NS_GET_PARENT(2const)
    
       **Discovering the namespace type**
           NS_GET_NSTYPE(2const)
    
       **Discovering the owner of a user namespace**
           NS_GET_OWNER_UID(2const)
    


## ERRORS



           **ENOTTY** _fd_ does not refer to a _/proc/_ pid _/ns/_ * file.
    


## STANDARDS



           Linux.
    


* * *
# create_module

## NAME



           create_module - create a loadable module entry
    


## SYNOPSIS



           **#include <linux/module.h>**
    
           **[[deprecated]] caddr_t create_module(const char ***_name_**, size_t** _size_**);**
    


## DESCRIPTION



           _Note_ : This system call is present only before Linux 2.6.
    
           **create_module**() attempts to create a loadable module entry and
           reserve the kernel memory that will be needed to hold the module.
           This system call requires privilege.
    


## RETURN VALUE



           On success, returns the kernel address at which the module will
           reside.  On error, -1 is returned and _errno_ is set to indicate the
           error.
    


## ERRORS



           **EEXIST** A module by that name already exists.
    
           **EFAULT** _name_ is outside the program's accessible address space.
    
           **EINVAL** The requested size is too small even for the module header
                  information.
    
           **ENOMEM** The kernel could not allocate a contiguous block of memory
                  large enough for the module.
    
           **ENOSYS create_module**() is not supported in this version of the
                  kernel (e.g., Linux 2.6 or later).
    
           **EPERM** The caller was not privileged (did not have the
                  **CAP_SYS_MODULE** capability).
    


## STANDARDS



           Linux.
    


* * *
# PR_GET_TID_ADDRESS

## NAME



           PR_GET_TID_ADDRESS - get the clear_child_tid address
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Return the _clear_child_tid_ address set by set_tid_address(2) and
           the clone(2) **CLONE_CHILD_CLEARTID** flag, in the location pointed to
           by _addrp_.
    
           This feature is available only if the kernel is built with the
           **CONFIG_CHECKPOINT_RESTORE** option enabled.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _addrp_ is an invalid address.
    


## STANDARDS



           Linux.
    


## CAVEATS



           Note that since the **prctl**() system call does not have a compat
           implementation for the AMD64 x32 and MIPS n32 ABIs, and the kernel
           writes out a pointer using the kernel's pointer size, this
           operation expects a user-space buffer of 8 (not 4) bytes on these
           ABIs.
    


* * *
# readdir

## NAME



           readdir - read directory entry
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_readdir, unsigned int** _fd_**,**
                       **struct old_linux_dirent ***_dirp_**, unsigned int** _count_**);**
    
           _Note_ : There is no definition of **struct old_linux_dirent** ; see
           VERSIONS.
    


## DESCRIPTION



           This is not the function you are interested in.  Look at
           readdir(3) for the POSIX conforming C library interface.  This
           page documents the bare kernel system call interface, which is
           superseded by getdents(2).
    
           **readdir**() reads one _old_linux_dirent_ structure from the directory
           referred to by the file descriptor _fd_ into the buffer pointed to
           by _dirp_.  The argument _count_ is ignored; at most one
           _old_linux_dirent_ structure is read.
    
           The _old_linux_dirent_ structure is declared (privately in Linux
           kernel file **fs/readdir.c**) as follows:
    
               struct old_linux_dirent {
                   unsigned long d_ino;     /* inode number */
                   unsigned long d_offset;  /* offset to this _old_linux_dirent_ */
                   unsigned short d_namlen; /* length of this _d_name_ */
                   char  d_name[1];         /* filename (null-terminated) */
               }
    
           _d_ino_ is an inode number.  _d_offset_ is the distance from the start
           of the directory to this _old_linux_dirent_.  _d_reclen_ is the size
           of _d_name_ , not counting the terminating null byte ('\0').  _d_name_
           is a null-terminated filename.
    


## RETURN VALUE



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


## ERRORS



           **EBADF** Invalid file descriptor _fd_.
    
           **EFAULT** Argument points outside the calling process's address
                  space.
    
           **EINVAL** Result buffer is too small.
    
           **ENOENT** No such directory.
    
           **ENOTDIR**
                  File descriptor does not refer to a directory.
    


## VERSIONS



           You will need to define the _old_linux_dirent_ structure yourself.
           However, probably you should use readdir(3) instead.
    
           This system call does not exist on x86-64.
    


## STANDARDS



           Linux.
    


* * *
# mq_getsetattr

## NAME



           mq_getsetattr - get/set message queue attributes
    


## SYNOPSIS



           **#include <mqueue.h>           **/* Definition of **struct mq_attr** */
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_mq_getsetattr, mqd_t** _mqdes_**,**
                       **const struct mq_attr ***_newattr_**, struct mq_attr ***_oldattr_**);**
    


## DESCRIPTION



           Do not use this system call.
    
           This is the low-level system call used to implement mq_getattr(3)
           and mq_setattr(3).  For an explanation of how this system call
           operates, see the description of mq_setattr(3).
    


## STANDARDS



           None.
    


## NOTES



           Never call it unless you are writing a C library!
    


* * *
# ipc

## NAME



           ipc - System V IPC system calls
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/ipc.h>        **/* Definition of needed constants */
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_ipc, unsigned int** _call_**, int** _first_**,**
                       **unsigned long** _second_**, unsigned long** _third_**, void ***_ptr_**,**
                       **long** _fifth_**);**
    
           _Note_ : glibc provides no wrapper for **ipc**(), necessitating the use
           of syscall(2).
    


## DESCRIPTION



           **ipc**() is a common kernel entry point for the System V IPC calls
           for messages, semaphores, and shared memory.  _call_ determines
           which IPC function to invoke; the other arguments are passed
           through to the appropriate call.
    
           User-space programs should call the appropriate functions by their
           usual names.  Only standard library implementors and kernel
           hackers need to know about **ipc**().
    


## VERSIONS



           On some architectures—for example x86-64 and ARM—there is no **ipc**()
           system call; instead, msgctl(2), semctl(2), shmctl(2), and so on
           really are implemented as separate system calls.
    


## STANDARDS



           Linux.
    


* * *
# gettid

## NAME



           gettid - get thread identification
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#define _GNU_SOURCE**
           **#include <unistd.h>**
    
           **pid_t gettid(void);**
    


## DESCRIPTION



           **gettid**() returns the caller's thread ID (TID).  In a single-
           threaded process, the thread ID is equal to the process ID (PID,
           as returned by getpid(2)).  In a multithreaded process, all
           threads have the same PID, but each one has a unique TID.  For
           further details, see the discussion of **CLONE_THREAD** in clone(2).
    


## RETURN VALUE



           On success, returns the thread ID of the calling thread.
    


## ERRORS



           This call is always successful.
    


## STANDARDS



           Linux.
    


## NOTES



           The thread ID returned by this call is not the same thing as a
           POSIX thread ID (i.e., the opaque value returned by
           pthread_self(3)).
    
           In a new thread group created by a clone(2) call that does not
           specify the **CLONE_THREAD** flag (or, equivalently, a new process
           created by fork(2)), the new process is a thread group leader, and
           its thread group ID (the value returned by getpid(2)) is the same
           as its thread ID (the value returned by **gettid**()).
    


* * *
# KEYCTL_UNLINK

## NAME



           KEYCTL_UNLINK - unlink a key from 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_UNLINK, key_serial_t** _key_**,**
                        **key_serial_t** _keyring_**);**
    


## DESCRIPTION



           Unlink a key from a keyring.
    
           The ID of the key to be unlinked is specified in _key_ ; the ID of
           the keyring from which it is to be unlinked is specified in
           _keyring_.
    
           If the key is not currently linked into the keyring, an error
           results.
    
           The caller must have _write_ permission on the keyring from which
           the key is being removed.
    
           If the last link to a key is removed, then that key will be
           scheduled for destruction.
    


## RETURN VALUE



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


## ERRORS



           **ENOENT** The key to be unlinked isn't linked to the keyring.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_CAP_AMBIENT

## NAME



           PR_CAP_AMBIENT - read or change the ambient capability set of the
           calling thread
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Reads or changes the ambient capability set of the calling thread,
           according to the value of _op_ , which must be one of the following:
    
           **PR_CAP_AMBIENT_RAISE**
           **PR_CAP_AMBIENT_LOWER**
           **PR_CAP_AMBIENT_IS_SET**
           **PR_CAP_AMBIENT_CLEAR_ALL**
    


## RETURN VALUE



           On success, a nonnegative value is returned.  On error, -1 is
           returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL** _op_ is not a valid value.
    


## VERSIONS



           Higher-level interfaces layered on top of the above operations are
           provided in the libcap(3) library in the form of
           cap_get_ambient(3), cap_set_ambient(3), and cap_reset_ambient(3).
    


## STANDARDS



           Linux.
    


* * *
# alarm

## NAME



           alarm - set an alarm clock for delivery of a signal
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **unsigned int alarm(unsigned int** _seconds_**);**
    


## DESCRIPTION



           **alarm**() arranges for a **SIGALRM** signal to be delivered to the
           calling process in _seconds_ seconds.
    
           If _seconds_ is zero, any pending alarm is canceled.
    
           In any event any previously set **alarm**() is canceled.
    


## RETURN VALUE



           **alarm**() returns the number of seconds remaining until any
           previously scheduled alarm was due to be delivered, or zero if
           there was no previously scheduled alarm.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           **alarm**() and setitimer(2) share the same timer; calls to one will
           interfere with use of the other.
    
           Alarms created by **alarm**() are preserved across execve(2) and are
           not inherited by children created via fork(2).
    
           sleep(3) may be implemented using **SIGALRM** ; mixing calls to **alarm**()
           and sleep(3) is a bad idea.
    
           Scheduling delays can, as ever, cause the execution of the process
           to be delayed by an arbitrary amount of time.
    


* * *
# ioctl_pipe

## NAME



           ioctl_pipe - ioctl() operations for General notification mechanism
    


## SYNOPSIS



           **#include <linux/watch_queue.h>  **/* Definition of **IOC_WATCH_QUEUE_** * */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _pipefd_**, IOC_WATCH_QUEUE_SET_SIZE, int** _size_**);**
           **int ioctl(int** _pipefd_**, IOC_WATCH_QUEUE_SET_FILTER,**
                     **struct watch_notification_filter ***_filter_**);**
    


## DESCRIPTION



           The following ioctl(2) operations are provided to set up general
           notification queue parameters.  The notification queue is built on
           the top of a pipe(2) opened with the **O_NOTIFICATION_PIPE** flag.
    
           **IOC_WATCH_QUEUE_SET_SIZE**(since Linux 5.8)
                  Preallocates the pipe buffer memory so that it can fit _size_
                  notification messages.  Currently, _size_ must be between 1
                  and 512.
    
           **IOC_WATCH_QUEUE_SET_FILTER**(since Linux 5.8)
                  Watch queue filter can limit events that are received.
                  Filters are passed in a _struct watch_notification_filter_
                  and each filter is described by a _struct_
                  _watch_notification_type_filter_ structure.
    
                      struct watch_notification_filter {
                              __u32   nr_filters;
                              __u32   __reserved;
                              struct watch_notification_type_filter filters[];
                      };
    
                      struct watch_notification_type_filter {
                              __u32   type;
                              __u32   info_filter;
                              __u32   info_mask;
                              __u32   subtype_filter[8];
                      };
    


* * *
# getunwind

## NAME



           getunwind - copy the unwind data to caller's buffer
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/unwind.h>**
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **[[deprecated]] long syscall(** size_t buf_size;
                                       **SYS_getunwind, void** _buf_**[**_buf_size_**],**
                                       **size_t** _buf_size_**);**
    


## DESCRIPTION



           _Note: this system call is obsolete._
    
           The IA-64-specific **getunwind**() system call copies the kernel's
           call frame unwind data into the buffer pointed to by _buf_ and
           returns the size of the unwind data; this data describes the gate
           page (kernel code that is mapped into user space).
    
           The size of the buffer _buf_ is specified in _buf_size_.  The data is
           copied only if _buf_size_ is greater than or equal to the size of
           the unwind data and _buf_ is not NULL; otherwise, no data is copied,
           and the call succeeds, returning the size that would be needed to
           store the unwind data.
    
           The first part of the unwind data contains an unwind table.  The
           rest contains the associated unwind information, in no particular
           order.  The unwind table contains entries of the following form:
    
               u64 start;      (64-bit address of start of function)
               u64 end;        (64-bit address of end of function)
               u64 info;       (BUF-relative offset to unwind info)
    
           An entry whose _start_ value is zero indicates the end of the table.
           For more information about the format, see the _IA-64 Software_
           _Conventions and Runtime Architecture_ manual.
    


## RETURN VALUE



           On success, **getunwind**() returns the size of the unwind data.  On
           error, -1 is returned and _errno_ is set to indicate the error.
    


## ERRORS



           **getunwind**() fails with the error **EFAULT** if the unwind info can't
           be stored in the space specified by _buf_.
    


## STANDARDS



           Linux on IA-64.
    


* * *