tripathysagar/man_text huggingface dataset:
# FUTEX_WAIT_REQUEUE_PI

## NAME



           FUTEX_WAIT_REQUEUE_PI - wait on a non-PI futex, and potentially be
           requeued onto a PI futex
    


## 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_WAIT_REQUEUE_PI,**
                        **uint32_t** _val_**,**
                        **const struct timespec ***_timeout_**,**
                        **uint32_t ***_uaddr2_**);**
    


## DESCRIPTION



           Wait on a non-PI futex at _uaddr_ and potentially be requeued (via a
           FUTEX_CMP_REQUEUE_PI(2const) operation in another task) onto a PI
           futex at _uaddr2_.  The wait operation on _uaddr_ is the same as for
           FUTEX_WAIT(2const).
    
           The waiter can be removed from the wait on _uaddr_ without
           requeueing on _uaddr2_ via a FUTEX_WAKE(2const) operation in another
           task.  In this case, the **FUTEX_WAIT_REQUEUE_PI** operation fails
           with the error **EAGAIN**.
    
           If _timeout_ is not NULL, the structure it points to specifies an
           absolute timeout for the wait operation.  If _timeout_ is NULL, the
           operation can block indefinitely.
    


## RETURN VALUE



           On error, -1 is returned, and _errno_ is set to indicate the error.
    
           On success, **FUTEX_WAIT_REQUEUE_PI** returns 0 if the caller was
           successfully requeued to the futex for the futex word at _uaddr2_.
    


## ERRORS



           See futex(2).
    
           **EAGAIN** The value pointed to by _uaddr_ was not equal to the expected
                  value _val_ at the time of the call.
    
                  **Note** : on Linux, the symbolic names **EAGAIN** and **EWOULDBLOCK**
                  (both of which appear in different parts of the kernel
                  futex code) have the same value.
    
           **EFAULT** _uaddr2_ or _timeout_ did not point to a valid user-space
                  address.
    
           **EINVAL** The supplied _timeout_ argument was invalid (_tv_sec_ was less
                  than zero, or _tv_nsec_ was not less than 1,000,000,000).
    
           **EINVAL** _uaddr2_ does not point to a valid object—that is, the
                  address is not four-byte-aligned.
    
           **ENOSYS** A run-time check determined that the operation is not
                  available.  The PI-futex operations are not implemented on
                  all architectures and are not supported on some CPU
                  variants.
    
           **ETIMEDOUT**
                  The timeout expired before the operation completed.
    


## STANDARDS



           Linux.
    


* * *
# pciconfig_read

## NAME



           pciconfig_read, pciconfig_write, pciconfig_iobase - pci device
           information handling
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <pci.h>**
    
           **int pciconfig_read(unsigned long** _bus_**, unsigned long** _dfn_**,**
                              **unsigned long** _off_**, unsigned long** _size_**,**
                              **unsigned char ***_buf_**);**
           **int pciconfig_write(unsigned long** _bus_**, unsigned long** _dfn_**,**
                              **unsigned long** _off_**, unsigned long** _size_**,**
                              **unsigned char ***_buf_**);**
           **int pciconfig_iobase(int** _which_**, unsigned long** _bus_**,**
                              **unsigned long** _devfn_**);**
    


## DESCRIPTION



           Most of the interaction with PCI devices is already handled by the
           kernel PCI layer, and thus these calls should not normally need to
           be accessed from user space.
    
           **pciconfig_read**()
                  Reads to _buf_ from device _dev_ at offset _off_ value.
    
           **pciconfig_write**()
                  Writes from _buf_ to device _dev_ at offset _off_ value.
    
           **pciconfig_iobase**()
                  You pass it a bus/devfn pair and get a physical address for
                  either the memory offset (for things like prep, this is
                  0xc0000000), the IO base for PIO cycles, or the ISA holes
                  if any.
    


## RETURN VALUE



           **pciconfig_read**()
                  On success, zero is returned.  On error, -1 is returned and
                  _errno_ is set to indicate the error.
    
           **pciconfig_write**()
                  On success, zero is returned.  On error, -1 is returned and
                  _errno_ is set to indicate the error.
    
           **pciconfig_iobase**()
                  Returns information on locations of various I/O regions in
                  physical memory according to the _which_ value.  Values for
                  _which_ are: **IOBASE_BRIDGE_NUMBER** , **IOBASE_MEMORY** , **IOBASE_IO** ,
                  **IOBASE_ISA_IO** , **IOBASE_ISA_MEM**.
    


## ERRORS



           **EINVAL** _size_ value is invalid.  This does not apply to
                  **pciconfig_iobase**().
    
           **EIO** I/O error.
    
           **ENODEV** For **pciconfig_iobase**(), "hose" value is NULL.  For the
                  other calls, could not find a slot.
    
           **ENOSYS** The system has not implemented these calls (**CONFIG_PCI** not
                  defined).
    
           **EOPNOTSUPP**
                  This return value is valid only for **pciconfig_iobase**().  It
                  is returned if the value for _which_ is invalid.
    
           **EPERM** User does not have the **CAP_SYS_ADMIN** capability.  This does
                  not apply to **pciconfig_iobase**().
    


## STANDARDS



           Linux.
    


* * *
# getpagesize

## NAME



           getpagesize - get memory page size
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int getpagesize(void);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **getpagesize**():
               Since glibc 2.20:
                   _DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
               glibc 2.12 to glibc 2.19:
                   _BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
               Before glibc 2.12:
                   _BSD_SOURCE || _XOPEN_SOURCE >= 500
    


## DESCRIPTION



           The function **getpagesize**() returns the number of bytes in a memory
           page, where "page" is a fixed-length block, the unit for memory
           allocation and file mapping performed by mmap(2).
    


## VERSIONS



           A user program should not hard-code a page size, neither as a
           literal nor using the **PAGE_SIZE** macro, because some architectures
           support multiple page sizes.
    
           This manual page is in section 2 because Alpha, SPARC, and SPARC64
           all have a Linux system call **getpagesize**() though other
           architectures do not, and use the ELF auxiliary vector instead.
    


## STANDARDS



           None.
    


* * *
# PR_CAPBSET_READ

## NAME



           PR_CAPBSET_READ - read the calling thread's capability bounding
           set
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Return 1 if the capability specified in _cap_ is in the calling
           thread's capability bounding set, or 0 if it is not.
    
           The capability constants are defined in _< linux/capability.h>_.
    
           The capability bounding set dictates whether the process can
           receive the capability through a file's permitted capability set
           on a subsequent call to execve(2).
    


## RETURN VALUE



           On success, this call returns the boolean value described above.
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



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


## VERSIONS



           A higher-level interface layered on top of this operation is
           provided in the libcap(3) library in the form of cap_get_bound(3).
    


## STANDARDS



           Linux.
    


* * *
# futimesat

## NAME



           futimesat - change timestamps of a file relative to a directory
           file descriptor
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <fcntl.h>            **/* Definition of **AT_*** constants */
           **#include <sys/time.h>**
    
           **[[deprecated]] int futimesat(int** _dirfd_**, const char ***_path_**,**
                                        **const struct timeval** _times_**[2]);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **futimesat**():
               _GNU_SOURCE
    


## DESCRIPTION



           This system call is obsolete.  Use utimensat(2) instead.
    
           The **futimesat**() system call operates in exactly the same way as
           utimes(2), except for the differences described in this manual
           page.
    
           If _path_ is relative, then it is interpreted relative to the
           directory referred to by the file descriptor _dirfd_ (rather than
           relative to the current working directory of the calling process,
           as is done by utimes(2) for a relative pathname).
    
           If _path_ is relative and _dirfd_ is the special value **AT_FDCWD** , then
           _path_ is interpreted relative to the current working directory of
           the calling process (like utimes(2)).
    
           If _path_ is absolute, then _dirfd_ is ignored.  (See openat(2) for an
           explanation of why the _dirfd_ argument is useful.)
    


## RETURN VALUE



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


## ERRORS



           The same errors that occur for utimes(2) can also occur for
           **futimesat**().  The following additional errors can occur for
           **futimesat**():
    
           **EBADF** _path_ is relative but _dirfd_ is neither **AT_FDCWD** nor a valid
                  file descriptor.
    
           **ENOTDIR**
                  _path_ is relative and _dirfd_ is a file descriptor referring
                  to a file other than a directory.
    


## VERSIONS



       **glibc**
           If _path_ is NULL, then the glibc **futimesat**() wrapper function
           updates the times for the file referred to by _dirfd_.
    


## STANDARDS



           None.
    


## NOTES



    


* * *
# PR_SET_KEEPCAPS

## NAME



           PR_SET_KEEPCAPS - set the state of the "keep capabilities" flag
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set the state of the calling thread's "keep capabilities" flag.
           The effect of this flag is described in capabilities(7).  _state_
           must be either **0L**(clear the flag) or **1L**(set the flag).  The
           "keep capabilities" value will be reset to 0 on subsequent calls
           to execve(2).
    


## 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.
    
           **EPERM** The caller's **SECBIT_KEEP_CAPS_LOCKED** flag is set (see
                  capabilities(7)).
    


## STANDARDS



           Linux.
    


* * *
# KEYCTL_GET_SECURITY

## NAME



           KEYCTL_GET_SECURITY - manipulate the kernel's key management
           facility
    


## 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(** size_t n;
                        **SYS_keyctl, KEYCTL_GET_SECURITY, key_serial_t** _key_**,**
                        **char** _buf_**[_Nullable** _n_**], size_t** _n_**);**
    


## DESCRIPTION



           **KEYCTL_GET_SECURITY**(since Linux 2.6.26)
                  Get the LSM (Linux Security Module) security label of the
                  specified key.
    
           The ID of the key whose security label is to be fetched is
           specified in _key_.  The security label (terminated by a null byte)
           will be placed in the buffer pointed to by _buf_ argument; the size
           of the buffer must be provided in _n_.
    
           If _buf_ is specified as NULL or the buffer size specified in _n_ is
           too small, the full size of the security label string (including
           the terminating null byte) is returned as the function result, and
           nothing is copied to the buffer.
    
           The caller must have _view_ permission on the specified key.
    
           The returned security label string will be rendered in a form
           appropriate to the LSM in force.  For example, with SELinux, it
           may look like:
    
               unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    
           If no LSM is currently in force, then an empty string is placed in
           the buffer.
    


## RETURN VALUE



           On success, the size of the LSM security label string (including
           the terminating null byte), irrespective of the provided buffer
           size.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_SET_ENDIAN

## NAME



           PR_SET_ENDIAN - set endianness of the calling process
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set the endian-ness of the calling process to the value given in
           _endianness_ , which should be one of the following: **PR_ENDIAN_BIG** ,
           **PR_ENDIAN_LITTLE** , or **PR_ENDIAN_PPC_LITTLE**(PowerPC pseudo little
           endian).
    


## RETURN VALUE



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


## ERRORS



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


## STANDARDS



           Linux.  PowerPC only.
    


* * *
# FAT_IOCTL_GET_VOLUME_ID

## NAME



           FAT_IOCTL_GET_VOLUME_ID - read the volume ID in a FAT filesystem
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/msdos_fs.h>  **/* Definition of **FAT_*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, FAT_IOCTL_GET_VOLUME_ID, uint32_t ***_id_**);**
    


## DESCRIPTION



           FAT filesystems are identified by a volume ID.  The volume ID can
           be read with **FAT_IOCTL_GET_VOLUME_ID**.
    
           The _fd_ argument can be a file descriptor for any file or directory
           of the filesystem.  It is sufficient to create the file descriptor
           by calling open(2) with the **O_RDONLY** flag.
    
           The _id_ argument is a pointer to the field that will be filled with
           the volume ID.  Typically the volume ID is displayed to the user
           as a group of two 16-bit fields:
    
               printf("Volume ID %04x-%04x\n", id >> 16, id & 0xFFFF);
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


## EXAMPLES



           The following program demonstrates the use of ioctl(2) to display
           the volume ID of a FAT filesystem.
    
           The following output was recorded when applying the program for
           directory _/mnt/user_ :
    
               $ ./display_fat_volume_id /mnt/user
               Volume ID 6443-6241
    
       **Program source (display_fat_volume_id.c)**
    
           #include <fcntl.h>
           #include <linux/msdos_fs.h>
           #include <stdint.h>
           #include <stdio.h>
           #include <stdlib.h>
           #include <sys/ioctl.h>
           #include <unistd.h>
    
           int
           main(int argc, char *argv[])
           {
               int       fd;
               int       ret;
               uint32_t  id;
    
               if (argc != 2) {
                   printf("Usage: %s FILENAME\n", argv[0]);
                   exit(EXIT_FAILURE);
               }
    
               fd = open(argv[1], O_RDONLY);
               if (fd == -1) {
                   perror("open");
                   exit(EXIT_FAILURE);
               }
    
               /*
                * Read volume ID.
                */
               ret = ioctl(fd, FAT_IOCTL_GET_VOLUME_ID, &id);
               if (ret == -1) {
                   perror("ioctl");
                   exit(EXIT_FAILURE);
               }
    
               /*
                * Format the output as two groups of 16 bits each.
                */
               printf("Volume ID %04x-%04x\n", id >> 16, id & 0xFFFF);
    
               close(fd);
    
               exit(EXIT_SUCCESS);
           }
    


* * *
# KEYCTL_DESCRIBE

## NAME



           KEYCTL_DESCRIBE - describe a key
    


## 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(** size_t size;
                        **SYS_keyctl, KEYCTL_DESCRIBE, key_serial_t** _key_**,**
                        **char** _desc_**[_Nullable** _size_**], size_t** _size_**);**
    


## DESCRIPTION



           Obtain a string describing the attributes of a specified key.
    
           The ID of the key to be described is specified in _key_.  The
           descriptive string is returned in the buffer pointed to by _desc_ ;
           _size_ specifies the size of that buffer in bytes.
    
           The key must grant the caller _view_ permission.
    
           The returned string is null-terminated and contains the following
           information about the key:
    
               _type_ ;_uid_ ;_gid_ ;_perm_ ;_description_
    
           In the above, _type_ and _description_ are strings, _uid_ and _gid_ are
           decimal strings, and _perm_ is a hexadecimal permissions mask.  The
           descriptive string is written with the following format:
    
               %s;%d;%d;%08x;%s
    
           **Note: the intention is that the descriptive string should be**
           **extensible in future kernel versions.** In particular, the
           _description_ field will not contain semicolons; it should be parsed
           by working backwards from the end of the string to find the last
           semicolon.  This allows future semicolon-delimited fields to be
           inserted in the descriptive string in the future.
    
           Writing to the buffer is attempted only when _desc_ is non-NULL and
           the specified buffer size is large enough to accept the
           descriptive string (including the terminating null byte).  In
           order to determine whether the buffer size was too small, check to
           see if the return value of the operation is greater than _size_.
    


## RETURN VALUE



           On success, the size of the description (including the terminating
           null byte), irrespective of the provided buffer size.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# UFFDIO_WRITEPROTECT

## NAME



           UFFDIO_WRITEPROTECT - write-protect or write-unprotect a
           userfaultfd-registered memory range
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, UFFDIO_WRITEPROTECT, ...);**
    
           **#include <linux/userfaultfd.h>**
    
           **struct uffdio_writeprotect {**
               **struct uffdio_range  range;** /* Range to change write permission*/
               **__u64                mode;** /* Mode to change write permission */
           **};**
    


## DESCRIPTION



           Write-protect or write-unprotect a userfaultfd-registered memory
           range registered with mode **UFFDIO_REGISTER_MODE_WP**.
    
           There are two mode bits that are supported in this structure:
    
           **UFFDIO_WRITEPROTECT_MODE_WP**
                  When this mode bit is set, the ioctl will be a write-
                  protect operation upon the memory range specified by _range_.
                  Otherwise it will be a write-unprotect operation upon the
                  specified range, which can be used to resolve a userfaultfd
                  write-protect page fault.
    
           **UFFDIO_WRITEPROTECT_MODE_DONTWAKE**
                  When this mode bit is set, do not wake up any thread that
                  waits for page-fault resolution after the operation.  This
                  can be specified only if **UFFDIO_WRITEPROTECT_MODE_WP** is not
                  specified.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** The _start_ or the _len_ field of the _ufdio_range_ structure was
                  not a multiple of the system page size; or _len_ was zero; or
                  the specified range was otherwise invalid.
    
           **EAGAIN** The process was interrupted; retry this call.
    
           **ENOENT** The range specified in _range_ is not valid.  For example,
                  the virtual address does not exist, or not registered with
                  userfaultfd write-protect mode.
    
           **EFAULT** Encountered a generic fault during processing.
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *
# PR_GET_SECUREBITS

## NAME



           PR_GET_SECUREBITS - get the "securebits" flags 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_GET_SECUREBITS);**
    


## DESCRIPTION



           Return the "securebits" flags of the calling thread.  See
           capabilities(7).
    


## RETURN VALUE



           On success, **PR_GET_SECUREBITS** , returns the nonnegative value
           described above.  On error, -1 is returned, and _errno_ is set to
           indicate the error.
    


## STANDARDS



           Linux.
    


* * *
# epoll_create

## NAME



           epoll_create, epoll_create1 - open an epoll file descriptor
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/epoll.h>**
    
           **int epoll_create(int** _size_**);**
           **int epoll_create1(int** _flags_**);**
    


## DESCRIPTION



           **epoll_create**() creates a new epoll(7) instance.  Since Linux
           2.6.8, the _size_ argument is ignored, but must be greater than
           zero; see HISTORY.
    
           **epoll_create**() returns a file descriptor referring to the new
           epoll instance.  This file descriptor is used for all the
           subsequent calls to the **epoll** interface.  When no longer required,
           the file descriptor returned by **epoll_create**() should be closed by
           using close(2).  When all file descriptors referring to an epoll
           instance have been closed, the kernel destroys the instance and
           releases the associated resources for reuse.
    
       **epoll_create1()**
           If _flags_ is 0, then, other than the fact that the obsolete _size_
           argument is dropped, **epoll_create1**() is the same as
           **epoll_create**().  The following value can be included in _flags_ to
           obtain different behavior:
    
           **EPOLL_CLOEXEC**
                  Set the close-on-exec (**FD_CLOEXEC**) flag on the new file
                  descriptor.  See the description of the **O_CLOEXEC** flag in
                  open(2) for reasons why this may be useful.
    


## RETURN VALUE



           On success, these system calls return a file descriptor (a
           nonnegative integer).  On error, -1 is returned, and _errno_ is set
           to indicate the error.
    


## ERRORS



           **EINVAL** _size_ is not positive.
    
           **EINVAL**(**epoll_create1**()) Invalid value specified in _flags_.
    
           **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.
    
           **ENOMEM** There was insufficient memory to create the kernel object.
    


## STANDARDS



           Linux.
    


* * *
# pause

## NAME



           pause - wait for signal
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int pause(void);**
    


## DESCRIPTION



           **pause**() causes the calling process (or thread) to sleep until a
           signal is delivered that either terminates the process or causes
           the invocation of a signal-catching function.
    


## RETURN VALUE



           **pause**() returns only when a signal was caught and the signal-
           catching function returned.  In this case, **pause**() returns -1, and
           _errno_ is set to **EINTR**.
    


## ERRORS



           **EINTR** a signal was caught and the signal-catching function
                  returned.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# getsockname

## NAME



           getsockname - get socket name
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           **getsockname**() returns the current address to which the socket
           _sockfd_ is bound, in the buffer pointed to by _addr_.  The _addrlen_
           argument should be initialized to indicate the amount of space (in
           bytes) pointed to by _addr_.  On return it contains the actual size
           of the socket address.
    
           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.
    
           **ENOTSOCK**
                  The file descriptor _sockfd_ does not refer to a socket.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# FUTEX_LOCK_PI2

## NAME



           FUTEX_LOCK_PI2 - lock a priority‐inheritance futex
    


## 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_LOCK_PI2, 0,**
                        **const struct timespec ***_timeout_**);**
    


## DESCRIPTION



           This operation is the same as FUTEX_LOCK_PI(2const), except that
           the clock against which _timeout_ is measured is selectable.
    
           By default, the (absolute) timeout specified in _timeout_ is
           measured against the **CLOCK_MONOTONIC** clock.
    


## RETURN VALUE



           See FUTEX_LOCK_PI(2const).
    


## ERRORS



           See FUTEX_LOCK_PI(2const).
    


## STANDARDS



           Linux.
    


* * *
# ioperm

## NAME



           ioperm - set port input/output permissions
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/io.h>**
    
           **int ioperm(unsigned long** _from_**, unsigned long** _num_**, int** _turn_on_**);**
    


## DESCRIPTION



           **ioperm**() sets the port access permission bits for the calling
           thread for _num_ bits starting from port address _from_.  If _turn_on_
           is nonzero, then permission for the specified bits is enabled;
           otherwise it is disabled.  If _turn_on_ is nonzero, the calling
           thread must be privileged (**CAP_SYS_RAWIO**).
    
           Before Linux 2.6.8, only the first 0x3ff I/O ports could be
           specified in this manner.  For more ports, the iopl(2) system call
           had to be used (with a _level_ argument of 3).  Since Linux 2.6.8,
           65,536 I/O ports can be specified.
    
           Permissions are inherited by the child created by fork(2) (but see
           HISTORY).  Permissions are preserved across execve(2); this is
           useful for giving port access permissions to unprivileged
           programs.
    
           This call is mostly for the i386 architecture.  On many other
           architectures it does not exist or will always return an error.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** Invalid values for _from_ or _num_.
    
           **EIO**(on PowerPC) This call is not supported.
    
           **ENOMEM** Out of memory.
    
           **EPERM** The calling thread has insufficient privilege.
    


## VERSIONS



           glibc has an **ioperm**() prototype both in _< sys/io.h>_ and in
           _< sys/perm.h>_.  Avoid the latter, it is available on i386 only.
    


## STANDARDS



           Linux.
    


## NOTES



           The _/proc/ioports_ file shows the I/O ports that are currently
           allocated on the system.
    


* * *
# lookup_dcookie

## NAME



           lookup_dcookie - return a directory entry's path
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(** size_t size;
                       **SYS_lookup_dcookie, uint64_t** _cookie_**, char** _buffer_**[**_size_**],**
                       **size_t** _size_**);**
    
           _Note_ : glibc provides no wrapper for **lookup_dcookie**(),
           necessitating the use of syscall(2).
    


## DESCRIPTION



           Look up the full path of the directory entry specified by the
           value _cookie_.  The cookie is an opaque identifier uniquely
           identifying a particular directory entry.  The buffer given is
           filled in with the full path of the directory entry.
    
           For **lookup_dcookie**() to return successfully, the kernel must still
           hold a cookie reference to the directory entry.
    


## RETURN VALUE



           On success, **lookup_dcookie**() returns the length of the path string
           copied into the buffer.  On error, -1 is returned, and _errno_ is
           set to indicate the error.
    


## ERRORS



           **EFAULT** The buffer was not valid.
    
           **EINVAL** The kernel has no registered cookie/directory entry
                  mappings at the time of lookup, or the cookie does not
                  refer to a valid directory entry.
    
           **ENAMETOOLONG**
                  The name could not fit in the buffer.
    
           **ENOMEM** The kernel could not allocate memory for the temporary
                  buffer holding the path.
    
           **EPERM** The process does not have the capability **CAP_SYS_ADMIN**
                  required to look up cookie values.
    
           **ERANGE** The buffer was not large enough to hold the path of the
                  directory entry.
    


## STANDARDS



           Linux.
    


## NOTES



           **lookup_dcookie**() is a special-purpose system call, currently used
           only by the oprofile(1) profiler.  It relies on a kernel driver to
           register cookies for directory entries.
    
           The path returned may be suffixed by the string " (deleted)" if
           the directory entry has been removed.
    


* * *
# setsid

## NAME



           setsid - creates a session and sets the process group ID
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **pid_t setsid(void);**
    


## DESCRIPTION



           **setsid**() creates a new session if the calling process is not a
           process group leader.  The calling process is the leader of the
           new session (i.e., its session ID is made the same as its process
           ID).  The calling process also becomes the process group leader of
           a new process group in the session (i.e., its process group ID is
           made the same as its process ID).
    
           The calling process will be the only process in the new process
           group and in the new session.
    
           Initially, the new session has no controlling terminal.  For
           details of how a session acquires a controlling terminal, see
           credentials(7).
    


## RETURN VALUE



           On success, the (new) session ID of the calling process is
           returned.  On error, _(pid_t) -1_ is returned, and _errno_ is set to
           indicate the error.
    


## ERRORS



           **EPERM** The process group ID of any process equals the PID of the
                  calling process.  Thus, in particular, **setsid**() fails if
                  the calling process is already a process group leader.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           A child created via fork(2) inherits its parent's session ID.  The
           session ID is preserved across an execve(2).
    
           A process group leader is a process whose process group ID equals
           its PID.  Disallowing a process group leader from calling **setsid**()
           prevents the possibility that a process group leader places itself
           in a new session while other processes in the process group remain
           in the original session; such a scenario would break the strict
           two-level hierarchy of sessions and process groups.  In order to
           be sure that **setsid**() will succeed, call fork(2) and have the
           parent _exit(2), while the child (which by definition can't be a
           process group leader) calls **setsid**().
    
           If a session has a controlling terminal, and the **CLOCAL** flag for
           that terminal is not set, and a terminal hangup occurs, then the
           session leader is sent a **SIGHUP** signal.
    
           If a process that is a session leader terminates, then a **SIGHUP**
           signal is sent to each process in the foreground process group of
           the controlling terminal.
    


* * *
# KEYCTL_ASSUME_AUTHORITY

## NAME



           KEYCTL_ASSUME_AUTHORITY - assume the authority to instantiate a
           key
    


## 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_ASSUME_AUTHORITY, key_serial_t** _key_**);**
    


## DESCRIPTION



           Assume (or divest) the authority for the calling thread to
           instantiate a key.
    
           The _key_ argument specifies either a nonzero key ID to assume
           authority, or the value 0 to divest authority.
    
           If _key_ is nonzero, then it specifies the ID of an uninstantiated
           key for which authority is to be assumed.  That key can then be
           instantiated using one of KEYCTL_INSTANTIATE(2const),
           KEYCTL_INSTANTIATE_IOV(2const), KEYCTL_REJECT(2const), or
           KEYCTL_NEGATE(2const).  Once the key has been instantiated, the
           thread is automatically divested of authority to instantiate the
           key.
    
           Authority over a key can be assumed only if the calling thread has
           present in its keyrings the authorization key that is associated
           with the specified key.  (In other words, the
           **KEYCTL_ASSUME_AUTHORITY** operation is available only from a
           request-key(8)-style program; see request_key(2) for an
           explanation of how this operation is used.)  The caller must have
           _search_ permission on the authorization key.
    
           If the specified key has a matching authorization key, then the ID
           of that key is returned.  The authorization key can be read
           (KEYCTL_READ(2const)) to obtain the callout information passed to
           request_key(2).
    
           If the ID given in _key_ is 0, then the currently assumed authority
           is cleared (divested), and the value 0 is returned.
    
           The **KEYCTL_ASSUME_AUTHORITY** mechanism allows a program such as
           request-key(8) to assume the necessary authority to instantiate a
           new uninstantiated key that was created as a consequence of a call
           to request_key(2).  For further information, see request_key(2)
           and the kernel source file
           _Documentation/security/keys-request-key.txt_.
    


## RETURN VALUE



           On success, either 0, if the ID given was 0, or the ID of the
           authorization key matching the specified key, if a nonzero key ID
           was provided.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# KEYCTL_SET_TIMEOUT

## NAME



           KEYCTL_SET_TIMEOUT - set the expiration timer on a key
    


## 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_SET_TIMEOUT, key_serial_t** _key_**, time_t** _t_**);**
    


## DESCRIPTION



           Set a timeout on a key.
    
           The ID of the key is specified in _key_.  The timeout value, in
           seconds from the current time, is specified in _t_.  The timeout is
           measured against the realtime clock.
    
           Specifying the timeout value as 0 clears any existing timeout on
           the key.
    
           The _/proc/keys_ file displays the remaining time until each key
           will expire.  (This is the only method of discovering the timeout
           on a key.)
    
           The caller must either have the _setattr_ permission on the key or
           hold an instantiation authorization token for the key (see
           request_key(2)).
    
           The key and any links to the key will be automatically garbage
           collected after the timeout expires.  Subsequent attempts to
           access the key will then fail with the error **EKEYEXPIRED**.
    
           This operation cannot be used to set timeouts on revoked, expired,
           or negatively instantiated keys.
    


## RETURN VALUE



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


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# io_destroy

## NAME



           io_destroy - destroy an asynchronous I/O context
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/aio_abi.h>    **/* Definition of **aio_context_t** */
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_io_destroy, aio_context_t** _ctx_id_**);**
    
           _Note_ : glibc provides no wrapper for **io_destroy**(), necessitating
           the use of syscall(2).
    


## 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_destroy**() system call will attempt to cancel all
           outstanding asynchronous I/O operations against _ctx_id_ , will block
           on the completion of all operations that could not be canceled,
           and will destroy the _ctx_id_.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** The context pointed to is invalid.
    
           **EINVAL** The AIO context specified by _ctx_id_ is invalid.
    
           **ENOSYS io_destroy**() is not implemented on this architecture.
    


## VERSIONS



           You probably want to use the **io_destroy**() 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.
    


* * *
# PR_SET_MM_EXE_FILE

## NAME



           PR_SET_MM_EXE_FILE - 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, PR_SET_MM_EXE_FILE, long** _fd_**, 0L, 0L);**
    


## DESCRIPTION



           Supersede the _/proc/_ pid _/exe_ symbolic link with a new one pointing
           to a new executable file identified by the file descriptor
           provided in the _fd_ argument.  The file descriptor should be
           obtained with a regular open(2) call.
    
           To change the symbolic link, one needs to unmap all existing
           executable memory areas, including those created by the kernel
           itself (for example the kernel usually creates at least one
           executable memory area for the ELF _.text_ section).
    


## RETURN VALUE



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


## ERRORS



           **EACCES** The file is not executable.
    
           **EBADF** The file descriptor passed in _fd_ is not valid.
    
           **EBUSY** This the second attempt to change the _/proc/_ pid _/exe_
                  symbolic link.
    


## FILES



           _/proc/_ pid _/exe_
    


## STANDARDS



           Linux.
    


* * *
# UFFDIO_WAKE

## NAME



           UFFDIO_WAKE - wake up a thread waiting for page-fault resolution
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, UFFDIO_WAKE, const struct uffdio_range ***_argp_**);**
    


## DESCRIPTION



           Wake up the thread waiting for page-fault resolution on a
           specified memory address range.
    
           The **UFFDIO_WAKE** operation is used in conjunction with **UFFDIO_COPY**
           and **UFFDIO_ZEROPAGE** operations that have the
           **UFFDIO_COPY_MODE_DONTWAKE** or **UFFDIO_ZEROPAGE_MODE_DONTWAKE** bit set
           in the _mode_ field.  The userfault monitor can perform several
           **UFFDIO_COPY** and **UFFDIO_ZEROPAGE** operations in a batch and then
           explicitly wake up the faulting thread using **UFFDIO_WAKE**.
    


## RETURN VALUE



           This ioctl(2) operation returns 0 on success.  On error, -1 is
           returned and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL** The _start_ or the _len_ field of the _ufdio_range_ structure was
                  not a multiple of the system page size; or _len_ was zero; or
                  the specified range was otherwise invalid.
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *