tripathysagar/man_text huggingface dataset:
# getdomainname

## NAME



           getdomainname, setdomainname - get/set NIS domain name
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int getdomainname(** size_t size;
                             **char** _name_**[**_size_**], size_t** _size_**);**
           **int setdomainname(** size_t size;
                             **const char** _name_**[**_size_**], size_t** _size_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **getdomainname**(), **setdomainname**():
               Since glibc 2.21:
                   _DEFAULT_SOURCE
               In glibc 2.19 and 2.20:
                   _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
               Up to and including glibc 2.19:
                   _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
    


## DESCRIPTION



           These functions are used to access or to change the NIS domain
           name of the host system.  More precisely, they operate on the NIS
           domain name associated with the calling process's UTS namespace.
    
           **setdomainname**() sets the domain name to the value given in the
           character array _name_.  The _size_ argument specifies the number of
           bytes in _name_.  (Thus, _name_ does not require a terminating null
           byte.)
    
           **getdomainname**() returns the null-terminated domain name in the
           character array _name_ , which has a size of _size_ bytes.  If the
           null-terminated domain name requires more than _len_ bytes,
           **getdomainname**() returns the first _len_ bytes (glibc) or gives an
           error (libc).
    


## RETURN VALUE



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


## ERRORS



           **setdomainname**() can fail with the following errors:
    
           **EFAULT** _name_ pointed outside of user address space.
    
           **EINVAL** _size_ was negative or too large.
    
           **EPERM** The caller did not have the **CAP_SYS_ADMIN** capability in the
                  user namespace associated with its UTS namespace (see
                  namespaces(7)).
    
           **getdomainname**() can fail with the following errors:
    
           **EINVAL** For **getdomainname**() under libc: _name_ is NULL or _name_ is
                  equal or longer than _size_ bytes.
    


## VERSIONS



           On most Linux architectures (including x86), there is no
           **getdomainname**() system call; instead, glibc implements
           **getdomainname**() as a library function that returns a copy of the
           _domainname_ field returned from a call to uname(2).
    


## STANDARDS



           None.
    


* * *
# PR_GET_AUXV

## NAME



           PR_GET_AUXV - get the auxiliary vector
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **int prctl(** size_t size;
                     **PR_GET_AUXV, void** _auxv_**[**_size_**], unsigned long** _size_**, 0L, 0L);**
    


## DESCRIPTION



           Get the auxiliary vector (auxv) into the buffer pointed to by
           _auxv_ , whose size is given by _size_.
    
           If the buffer is not long enough for the full auxiliary vector,
           the copy will be truncated.
    


## RETURN VALUE



           On success, this call returns the full size of the auxiliary
           vector.  On error, -1 is returned, and _errno_ is set to indicate
           the error.
    


## ERRORS



           **EFAULT** _auxv_ is an invalid address.
    


## STANDARDS



           Linux.
    


* * *
# stime

## NAME



           stime - set time
    


## SYNOPSIS



           **#include <time.h>**
    
           **[[deprecated]] int stime(const time_t ***_t_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **stime**():
               Since glibc 2.19:
                   _DEFAULT_SOURCE
               glibc 2.19 and earlier:
                   _SVID_SOURCE
    


## DESCRIPTION



           **NOTE** : This function is deprecated; use clock_settime(2) instead.
    
           **stime**() sets the system's idea of the time and date.  The time,
           pointed to by _t_ , is measured in seconds since the Epoch,
           1970-01-01 00:00:00 +0000 (UTC).  **stime**() may be executed only by
           the superuser.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** Error in getting information from user space.
    
           **EPERM** The calling process has insufficient privilege.  Under
                  Linux, the **CAP_SYS_TIME** privilege is required.
    


## STANDARDS



           None.
    


* * *
# PR_SET_MM_START_DATA

## NAME



           PR_SET_MM_START_DATA, PR_SET_MM_END_DATA - 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_START_DATA, unsigned long** _addr_**, 0L, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_END_DATA, unsigned long** _addr_**, 0L, 0L);**
    


## DESCRIPTION



           **PR_SET_MM_START_DATA**
                  Set the address above which initialized and uninitialized
                  (bss) data are placed.  The corresponding memory area must
                  be readable and writable, but not executable or shareable.
    
           **PR_SET_MM_END_DATA**
                  Set the address below which initialized and uninitialized
                  (bss) data are placed.  The corresponding memory area must
                  be readable and writable, but not executable or shareable.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _addr_ is greater than **TASK_SIZE**(the limit on the size of
                  the user address space for this architecture).
    
           **EINVAL** The permissions of the corresponding memory area are not as
                  required.
    


## STANDARDS



           Linux.
    


* * *
# PR_GET_TIMERSLACK

## NAME



           PR_GET_TIMERSLACK - get the "current" timer slack value for 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_TIMERSLACK);**
    


## DESCRIPTION



           Return the "current" timer slack value of the calling thread.
    


## 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.
    


## FILES



           _/proc/_ pid _/timerslack_ns_
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM_MAP

## NAME



           PR_SET_MM_MAP, PR_SET_MM_MAP_SIZE - 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_MAP,**
                     **struct prctl_mm_map ***_map_**, unsigned long** _size_**, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, unsigned int ***_size_**, 0L, 0L);**
    


## DESCRIPTION



           **PR_SET_MM_MAP**
                  Provides one-shot access to all the addresses modifyable
                  with PR_SET_MM(2const) by passing in a _struct prctl_mm_map_
                  (as defined in _< linux/prctl.h>_).  The _size_ argument should
                  provide the size of the struct.
    
           **PR_SET_MM_MAP_SIZE**
                  Returns (via the _size_ argument) the size of the _struct_
                  _prctl_mm_map_ the kernel expects.  This allows user space to
                  find a compatible struct.
    
           These features are 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



           **EINVAL** The third argument is an invalid address.
    


## STANDARDS



           Linux.
    


* * *
# PR_MCE_KILL

## NAME



           PR_MCE_KILL - set the machine check memory corruption kill policy
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set the machine check memory corruption kill policy for the
           calling thread.
    
           _op_ is one of the following operations:
    
           **PR_MCE_KILL_CLEAR**
           **PR_MCE_KILL_SET**
    
           The policy is inherited by children.
    


## RETURN VALUE



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


## ERRORS



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


## STANDARDS



           Linux.
    


* * *
# PR_SET_UNALIGN

## NAME



           PR_SET_UNALIGN - set unaligned access control bits
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set unaligned access control bits to _arg2_.
    
           Pass **PR_UNALIGN_NOPRINT** to silently fix up unaligned user
           accesses, or **PR_UNALIGN_SIGBUS** to generate **SIGBUS** on unaligned
           user access.
    
           Alpha also supports an additional flag with the value of 4 and no
           corresponding named constant, which instructs kernel to not fix up
           unaligned accesses (it is analogous to providing the **UAC_NOFIX**
           flag in **SSI_NVPAIRS** operation of the **setsysinfo**() system call on
           Tru64).
    


## RETURN VALUE



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


## ERRORS



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


## STANDARDS



           Linux.
    


* * *
# PR_GET_UNALIGN

## NAME



           PR_GET_UNALIGN - get unaligned access 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_UNALIGN, unsigned int ***_bits_**);**
    


## DESCRIPTION



           Return unaligned access control bits, in the location pointed to
           by _bits_.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _bits_ is an invalid address.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_CHILD_SUBREAPER

## NAME



           PR_SET_CHILD_SUBREAPER - set/unset the "child subreaper" attribute
           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_CHILD_SUBREAPER, long** _set_**);**
    


## DESCRIPTION



           If _set_ is nonzero, set the "child subreaper" attribute of the
           calling process; if _set_ is zero, unset the attribute.
    
           A subreaper fulfills the role of init(1) for its descendant
           processes.  When a process becomes orphaned (i.e., its immediate
           parent terminates), then that process will be reparented to the
           nearest still living ancestor subreaper.  Subsequently, calls to
           getppid(2) in the orphaned process will now return the PID of the
           subreaper process, and when the orphan terminates, it is the
           subreaper process that will receive a **SIGCHLD** signal and will be
           able to wait(2) on the process to discover its termination status.
    
           The setting of the "child subreaper" attribute is not inherited by
           children created by fork(2) and clone(2).  The setting is
           preserved across execve(2).
    
           Establishing a subreaper process is useful in session management
           frameworks where a hierarchical group of processes is managed by a
           subreaper process that needs to be informed when one of the
           processes—for example, a double-forked daemon—terminates (perhaps
           so that it can restart that process).  Some init(1) frameworks
           (e.g., systemd(1)) employ a subreaper process for similar reasons.
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# getpid

## NAME



           getpid, getppid - get process identification
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           **getpid**() returns the process ID (PID) of the calling process.
           (This is often used by routines that generate unique temporary
           filenames.)
    
           **getppid**() returns the process ID of the parent of the calling
           process.  This will be either the ID of the process that created
           this process using **fork**(), or, if that process has already
           terminated, the ID of the process to which this process has been
           reparented (either init(1) or a "subreaper" process defined via
           the prctl(2) **PR_SET_CHILD_SUBREAPER** operation).
    


## ERRORS



           These functions are always successful.
    


## VERSIONS



           On Alpha, instead of a pair of **getpid**() and **getppid**() system
           calls, a single **getxpid**() system call is provided, which returns a
           pair of PID and parent PID.  The glibc **getpid**() and **getppid**()
           wrapper functions transparently deal with this.  See syscall(2)
           for details regarding register mapping.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           If the caller's parent is in a different PID namespace (see
           pid_namespaces(7)), **getppid**() returns 0.
    
           From a kernel perspective, the PID (which is shared by all of the
           threads in a multithreaded process) is sometimes also known as the
           thread group ID (TGID).  This contrasts with the kernel thread ID
           (TID), which is unique for each thread.  For further details, see
           gettid(2) and the discussion of the **CLONE_THREAD** flag in clone(2).
    


* * *
# TIOCTTYGSTRUCT

## NAME



           TIOCTTYGSTRUCT - kernel debugging
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, TIOCTTYGSTRUCT, struct tty_struct ***_argp_**);**
    
           **#include <linux/tty.h>**
    
           **struct tty_struct;**
    


## DESCRIPTION



           Get the _tty_struct_ corresponding to _fd_.
    


## RETURN VALUE



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


* * *
# sched_get_priority_max

## NAME



           sched_get_priority_max, sched_get_priority_min  - get static
           priority range
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sched.h>**
    
           **int sched_get_priority_max(int** _policy_**);**
           **int sched_get_priority_min(int** _policy_**);**
    


## DESCRIPTION



           **sched_get_priority_max**() returns the maximum priority value that
           can be used with the scheduling algorithm identified by _policy_.
           **sched_get_priority_min**() returns the minimum priority value that
           can be used with the scheduling algorithm identified by _policy_.
           Supported _policy_ values are **SCHED_FIFO** , **SCHED_RR** , **SCHED_OTHER** ,
           **SCHED_BATCH** , **SCHED_IDLE** , and **SCHED_DEADLINE**.  Further details
           about these policies can be found in sched(7).
    
           Processes with numerically higher priority values are scheduled
           before processes with numerically lower priority values.  Thus,
           the value returned by **sched_get_priority_max**() will be greater
           than the value returned by **sched_get_priority_min**().
    
           Linux allows the static priority range 1 to 99 for the **SCHED_FIFO**
           and **SCHED_RR** policies, and the priority 0 for the remaining
           policies.  Scheduling priority ranges for the various policies are
           not alterable.
    
           The range of scheduling priorities may vary on other POSIX
           systems, thus it is a good idea for portable applications to use a
           virtual priority range and map it to the interval given by
           **sched_get_priority_max**() and **sched_get_priority_min**().  POSIX.1
           requires a spread of at least 32 between the maximum and the
           minimum values for **SCHED_FIFO** and **SCHED_RR**.
    
           POSIX systems on which **sched_get_priority_max**() and
           **sched_get_priority_min**() are available define
           **_POSIX_PRIORITY_SCHEDULING** in _< unistd.h>_.
    


## RETURN VALUE



           On success, **sched_get_priority_max**() and **sched_get_priority_min**()
           return the maximum/minimum priority value for the named scheduling
           policy.  On error, -1 is returned, and _errno_ is set to indicate
           the error.
    


## ERRORS



           **EINVAL** The argument _policy_ does not identify a defined scheduling
                  policy.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# cachestat

## NAME



           cachestat - query the page cache statistics of a file
    


## SYNOPSIS



           **#include <sys/mman.h>**
    
           **int cachestat(unsigned int** _fd_**, struct cachestat_range ***_cstat_range_**,**
                         **struct cachestat ***_cstat_**, unsigned int** _flags_**);**
    
           **struct cachestat_range {**
               **__u64 off;**
               **__u64 len;**
           **};**
    
           **struct cachestat {**
               **__u64 nr_cache;**
               **__u64 nr_dirty;**
               **__u64 nr_writeback;**
               **__u64 nr_evicted;**
               **__u64 nr_recently_evicted;**
           **};**
    


## DESCRIPTION



           **cachestat()** queries the number of cached pages, dirty pages, pages
           marked for writeback, evicted pages, and recently evicted pages in
           the byte range specified by _.off_ and _.len_ in the **cachestat_range**
           structure.
    
           An evicted page is one that was previously in the page cache but
           has since been evicted.  A page is considered recently evicted if
           its reentry into the cache would indicate active usage under
           memory pressure.
    
           The results are returned in a **cachestat** structure, pointed to by
           the _cstat_ argument.
    
           The _.off_ and _.len_ fields must be non-negative.  If _.len > 0_, the
           queried range is [_.off_ , _.off+.len_].  If _len == 0_ , the range is
           from _.off_ to the end of the file.
    
           The _flags_ argument is reserved for future use and must be set to
           **0**.
    
           Currently, **hugetlbfs** files are not supported.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _cstat_ or _cstat_range_ point to an invalid address.
    
           **EINVAL** Invalid _flags_ value.
    
           **EBADF** Invalid file descriptor.
    
           **EOPNOTSUPP**
                  The file descriptor refers to a **hugetlbfs** file, which is
                  unsupported.
    


## STANDARDS



           Linux.
    


## CAVEATS



           Note that the status of a page may change after **cachestat()**
           retrieves it but before the values are returned to the
           application; thus, the values may be slightly outdated.
    


* * *
# fcntl

## NAME



           fcntl - manipulate file descriptor
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <fcntl.h>**
    
           **int fcntl(int** _fd_**, int** _op_**, ...);**
    


## DESCRIPTION



           **fcntl**() performs one of the operations described below on the open
           file descriptor _fd_.  The operation is determined by _op_.
    
           Certain of the operations below are supported only since a
           particular Linux kernel version.  The preferred method of checking
           whether the host kernel supports a particular operation is to
           invoke **fcntl**() with the desired _op_ value and then test whether the
           call failed with **EINVAL** , indicating that the kernel does not
           recognize this value.
    
       **Duplicating a file descriptor**
           F_DUPFD(2const)
           F_DUPFD_CLOEXEC(2const)
    
       **File descriptor flags**
           F_GETFD(2const)
           F_SETFD(2const)
    
       **File status flags**
           F_GETFL(2const)
           F_SETFL(2const)
    
       **Advisory record locking**
           F_SETLK(2const)
           F_SETLKW(2const)
           F_GETLK(2const)
    
       **Open file description locks (non-POSIX)**
           F_OFD_SETLK(2const)
           F_OFD_SETLKW(2const)
           F_OFD_GETLK(2const)
    
       **Managing signals**
           F_GETOWN(2const)
           F_SETOWN(2const)
           F_GETOWN_EX(2const)
           F_SETOWN_EX(2const)
           F_GETSIG(2const)
           F_SETSIG(2const)
    
       **Leases**
           F_SETLEASE(2const)
           F_GETLEASE(2const)
    
       **File and directory change notification (dnotify)**
           F_NOTIFY(2const)
    
       **Changing the capacity of a pipe**
           F_SETPIPE_SZ(2const)
           F_GETPIPE_SZ(2const)
    
       **File Sealing**
           F_ADD_SEALS(2const)
           F_GET_SEALS(2const)
    
       **File read/write hints**
           F_GET_RW_HINT(2const)
           F_SET_RW_HINT(2const)
           F_GET_FILE_RW_HINT(2const)
           F_SET_FILE_RW_HINT(2const)
    


## RETURN VALUE



           For a successful call, the return value depends on the operation.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EACCES** or **EAGAIN**
                  Operation is prohibited by locks held by other processes.
    
           **EAGAIN** The operation is prohibited because the file has been
                  memory-mapped by another process.
    
           **EBADF** _fd_ is not an open file descriptor
    
           **EINVAL** The value specified in _op_ is not recognized by this kernel.
    


## VERSIONS



           POSIX.1-2024 specifies **FD_CLOFORK** and **F_DUPFD_CLOFORK** , but Linux
           doesn't support them.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# FUTEX_WAKE

## NAME



           FUTEX_WAKE - wake waiters that are inside FUTEX_WAIT
    


## 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_WAKE, uint32_t** _val_**);**
    


## DESCRIPTION



           This operation wakes at most _val_ of the waiters that are waiting
           (e.g., inside FUTEX_WAIT(2const)) on the futex word at the address
           _uaddr_.
    
           Most commonly, _val_ is specified as either 1 (wake up a single
           waiter) or **INT_MAX**(wake up all waiters).
    
           No guarantee is provided about which waiters are awoken (e.g., a
           waiter with a higher scheduling priority is not guaranteed to be
           awoken in preference to a waiter with a lower priority).
    


## RETURN VALUE



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


## ERRORS



           See futex(2).
    
           **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.
    


* * *
# uselib

## NAME



           uselib - load shared library
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **[[deprecated]] int uselib(const char ***_library_**);**
    


## DESCRIPTION



           The system call **uselib**() serves to load a shared library to be
           used by the calling process.  It is given a pathname.  The address
           where to load is found in the library itself.  The library can
           have any recognized binary format.
    


## RETURN VALUE



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


## ERRORS



           In addition to all of the error codes returned by open(2) and
           mmap(2), the following may also be returned:
    
           **EACCES** The library specified by _library_ does not have read or
                  execute permission, or the caller does not have search
                  permission for one of the directories in the path prefix.
                  (See also path_resolution(7).)
    
           **ENFILE** The system-wide limit on the total number of open files has
                  been reached.
    
           **ENOEXEC**
                  The file specified by _library_ is not an executable of a
                  known type; for example, it does not have the correct magic
                  numbers.
    


## STANDARDS



           Linux.
    


* * *
# TIOCSPGRP

## NAME



           TIOCGPGRP, TIOCSPGRP, TIOCGSID - process group and session ID
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <asm/termbits.h>  **/* Definition of **TIOC*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, TIOCGPGRP, pid_t ***_argp_**);**
           **int ioctl(int** _fd_**, TIOCSPGRP, const pid_t ***_argp_**);**
           **int ioctl(int** _fd_**, TIOCGSID, pid_t ***_argp_**);**
    


## DESCRIPTION



           **TIOCGPGRP**
                  When successful, equivalent to _*argp = tcgetpgrp(fd)_.
    
                  Get the process group ID of the foreground process group on
                  this terminal.
    
           **TIOCSPGRP**
                  Equivalent to _tcsetpgrp(fd, *argp)_.
    
                  Set the foreground process group ID of this terminal.
    
           **TIOCGSID**
                  When successful, equivalent to _*argp = tcgetsid(fd)_.
    
                  Get the session ID of the given terminal.  This fails with
                  the error **ENOTTY** if the terminal is not a master
                  pseudoterminal and not our controlling terminal.  Strange.
    


## RETURN VALUE



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


## ERRORS



           **ENOTTY** The terminal is not a master pseudoterminal and not our
                  controlling terminal.
    
           **EPERM** Insufficient permission.
    


* * *
# KEYCTL_CLEAR

## NAME



           KEYCTL_CLEAR - clear 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_CLEAR, key_serial_t** _key_**);**
    


## DESCRIPTION



           Clear the contents of (i.e., unlink all keys from) a keyring.
    
           The ID of the key (which must be of keyring type) is provided in
           _key_.
    
           The caller must have _write_ permission on the keyring.
    


## RETURN VALUE



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


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_SET_NO_NEW_PRIVS

## NAME



           PR_SET_NO_NEW_PRIVS - set the calling thread's no_new_privs
           attribute
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set the calling thread's _no_new_privs_ attribute.  With
           _no_new_privs_ set to 1, execve(2) promises not to grant privileges
           to do anything that could not have been done without the execve(2)
           call (for example, rendering the set-user-ID and set-group-ID mode
           bits, and file capabilities non-functional).
    
           Once set, the _no_new_privs_ attribute cannot be unset.  The setting
           of this attribute is inherited by children created by fork(2) and
           clone(2), and preserved across execve(2).
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** The second argument is not equal to _1L_.
    


## FILES



           _/proc/_ pid _/status_
                  Since Linux 4.10, the value of a thread's _no_new_privs_
                  attribute can be viewed via the _NoNewPrivs_ field in this
                  file.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM_START_STACK

## NAME



           PR_SET_MM_START_STACK - 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_START_STACK, unsigned long** _addr_**, 0L, 0L);**
    


## DESCRIPTION



           Set the start address of the stack.  The corresponding memory area
           must be readable and writable.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _addr_ is greater than **TASK_SIZE**(the limit on the size of
                  the user address space for this architecture).
    
           **EINVAL** The permissions of the corresponding memory area are not as
                  required.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_THP_DISABLE

## NAME



           PR_SET_THP_DISABLE - set the state of the "THP disable" flag for
           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_SET_THP_DISABLE, long** _flag_**, 0L, 0L, 0L);**
    


## DESCRIPTION



           Set the state of the "THP disable" flag for the calling thread.
           If _flag_ has a nonzero value, the flag is set, otherwise it is
           cleared.
    
           Setting this flag provides a method for disabling transparent huge
           pages for jobs where the code cannot be modified, and using a
           malloc hook with madvise(2) is not an option (i.e., statically
           allocated data).  The setting of the "THP disable" flag is
           inherited by a child created via fork(2) and is preserved across
           execve(2).
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# FUTEX_UNLOCK_PI

## NAME



           FUTEX_UNLOCK_PI - unlock 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_UNLOCK_PI);**
    


## DESCRIPTION



           This operation wakes the top priority waiter that is waiting in
           FUTEX_LOCK_PI(2const) or FUTEX_LOCK_PI2(2const) on the futex
           address provided by the _uaddr_ argument.
    
           This is called when the user-space value at _uaddr_ cannot be
           changed atomically from a TID (of the owner) to 0.
    


## RETURN VALUE



           On error, -1 is returned, and _errno_ is set to indicate the error.
    
           On success, **FUTEX_UNLOCK_PI** returns 0 if the futex was
           successfully unlocked.
    


## ERRORS



           See futex(2).
    
           **EINVAL** The kernel detected an inconsistency between the user-space
                  state at _uaddr_ and the kernel state.  This indicates either
                  state corruption or that the kernel found a waiter on _uaddr_
                  which is waiting via FUTEX_WAIT(2const) or
                  FUTEX_WAIT_BITSET(2const).
    
           **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.
    
           **EPERM** The caller does not own the lock represented by the futex
                  word.
    


## STANDARDS



           Linux.
    


* * *
# inotify_init

## NAME



           inotify_init, inotify_init1 - initialize an inotify instance
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/inotify.h>**
    
           **int inotify_init(void);**
           **int inotify_init1(int** _flags_**);**
    


## DESCRIPTION



           For an overview of the inotify API, see inotify(7).
    
           **inotify_init**() initializes a new inotify instance and returns a
           file descriptor associated with a new inotify event queue.
    
           If _flags_ is 0, then **inotify_init1**() is the same as **inotify_init**().
           The following values can be bitwise ORed in _flags_ to obtain
           different behavior:
    
           **IN_NONBLOCK**
                  Set the **O_NONBLOCK** file status flag on the open file
                  description (see open(2)) referred to by the new file
                  descriptor.  Using this flag saves extra calls to fcntl(2)
                  to achieve the same result.
    
           **IN_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 new file descriptor.  On
           error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL**(**inotify_init1**()) An invalid value was specified in _flags_.
    
           **EMFILE** The user limit on the total number of inotify instances has
                  been reached.
    
           **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** Insufficient kernel memory is available.
    


## STANDARDS



           Linux.
    


* * *
# uname

## NAME



           uname - get name and information about current kernel
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/utsname.h>**
    
           **int uname(struct utsname ***_buf_**);**
    


## DESCRIPTION



           **uname**() returns system information in the structure pointed to by
           _buf_.  The _utsname_ struct is defined in _< sys/utsname.h>_:
    
               struct utsname {
                   char sysname[];    /* Operating system name (e.g., "Linux") */
                   char nodename[];   /* Name within communications network
                                         to which the node is attached, if any */
                   char release[];    /* Operating system release
                                         (e.g., "2.6.28") */
                   char version[];    /* Operating system version */
                   char machine[];    /* Hardware type identifier */
               #ifdef _GNU_SOURCE
                   char domainname[]; /* NIS or YP domain name */
               #endif
               };
    
           The length of the arrays in a _struct utsname_ is unspecified (see
           VERSIONS and HISTORY); the fields are terminated by a null byte
           ('\0').
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _buf_ is not valid.
    


## VERSIONS



           The _domainname_ member (the NIS or YP domain name) is a GNU
           extension.
    
           The length of the fields in the struct varies.  Some operating
           systems or libraries use a hardcoded 9 or 33 or 65 or 257.  Other
           systems use **SYS_NMLN** or **_SYS_NMLN** or **UTSLEN** or **_UTSNAME_LENGTH**.
           Clearly, it is a bad idea to use any of these constants; just use
           sizeof(...).  SVr4 uses 257, "to support Internet hostnames" —
           this is the largest value likely to be encountered in the wild.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           The kernel has the name, release, version, and supported machine
           type built in.  Conversely, the _nodename_ field is configured by
           the administrator to match the network (this is what the BSD
           historically calls the "hostname", and is set via sethostname(2)).
           Similarly, the _domainname_ field is set via setdomainname(2).
    
           Part of the utsname information is also accessible via
           _/proc/sys/kernel/_{_ostype_ , _hostname_ , _osrelease_ , _version_ ,
           _domainname_}.
    


* * *
# PR_SET_DUMPABLE

## NAME



           PR_SET_DUMPABLE - set the "dumpable" attribute 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_DUMPABLE, long** _dumpable_**);**
    


## DESCRIPTION



           Set the state of the "dumpable" attribute, which determines
           whether core dumps are produced for the calling process upon
           delivery of a signal whose default behavior is to produce a core
           dump.
    
           _dumpable_ must be either **0L**(**SUID_DUMP_DISABLE** , process is not
           dumpable) or **1L**(**SUID_DUMP_USER** , process is dumpable).
    
           Normally, the "dumpable" attribute is set to 1.  However, it is
           reset to the current value contained in the file _/proc/sys/fs/_
           _suid_dumpable_ (which by default has the value 0), in the following
           circumstances:
    
           •  The process's effective user or group ID is changed.
    
           •  The process's filesystem user or group ID is changed (see
              credentials(7)).
    
           •  The process executes (execve(2)) a set-user-ID or set-group-ID
              program, resulting in a change of either the effective user ID
              or the effective group ID.
    
           •  The process executes (execve(2)) a program that has file
              capabilities (see capabilities(7)), but only if the permitted
              capabilities gained exceed those already permitted for the
              process.
    
           Processes that are not dumpable can not be attached via ptrace(2)
           **PTRACE_ATTACH** ; see ptrace(2) for further details.
    
           If a process is not dumpable, the ownership of files in the
           process's _/proc/_ pid directory is affected as described in
           proc_pid(5).
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _arg2_ is neither **SUID_DUMP_DISABLE** nor **SUID_DUMP_USER**.
    


## FILES



           _/proc/sys/fs/suid_dumpable_
    
           _/proc/_ pid _/_
    


## STANDARDS



           Linux.
    


* * *
# PR_CAPBSET_DROP

## NAME



           PR_CAPBSET_DROP - drop a capability from 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_DROP, long** _cap_**);**
    


## DESCRIPTION



           Drop the capability specified by _cap_ from the calling thread's
           capability bounding set.  Any children of the calling thread will
           inherit the newly reduced bounding set.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** File capabilities are not enabled in the kernel.
    
           **EINVAL** _cap_ does not specify a valid capability.
    
           **EPERM** The caller does not have the **CAP_SETPCAP** capability.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_FUTEX_HASH

## NAME



           PR_FUTEX_HASH - configure the private futex hash
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Configure the attributes for the underlying hash used by the
           futex(2) family of operations.  The Linux kernel uses a hash to
           distribute the unrelated futex(2) requests to different data
           structures in order to reduce the lock contention.  Unrelated
           requests are requests which are not related to one another because
           they use a different futex word.  The data structure holds the in-
           kernel representation of the operation and keeps track of the
           current users which are enqueued and wait for a wake up.  It also
           provides synchronisation of waiters against wakers.  The size of
           the global hash is determined at boot time and is based on the
           number of CPUs in the system.  Due to hash collision, two
           unrelated futex(2) requests can share the same hash bucket.  This
           in turn can lead to delays of the futex(2) operation due to lock
           contention while accessing the data structure.  These delays can
           be problematic on a real-time system since random processes can
           share in-kernel locks and it is not deterministic which process
           will be involved.
    
           Linux 6.16 implements a process-wide private hash which is used by
           all futex(2) operations that specify the **FUTEX_PRIVATE_FLAG** option
           as part of the operation.  Without any configuration the kernel
           will allocate 16 hash slots once the first thread has been
           created.  If the process continues to create threads, the kernel
           will try to resize the private hash based on the number of threads
           and available CPUs in the system.  The kernel will only increase
           the size and will make sure it does not exceed the size of the
           global hash.
    
           The user can configure the size of the private hash which will
           also disable the automatic resize provided by the kernel.
    
           The value in _op_ is one of the options below.
    
           **PR_FUTEX_HASH_GET_IMMUTABLE**
           **PR_FUTEX_HASH_GET_SLOTS**
           **PR_FUTEX_HASH_SET_SLOTS**
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# getresuid

## NAME



           getresuid, getresgid - get real, effective, and saved user/group
           IDs
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#define _GNU_SOURCE** /* See feature_test_macros(7) */
           **#include <unistd.h>**
    
           **int getresuid(uid_t ***_ruid_**, uid_t ***_euid_**, uid_t ***_suid_**);**
           **int getresgid(gid_t ***_rgid_**, gid_t ***_egid_**, gid_t ***_sgid_**);**
    


## DESCRIPTION



           **getresuid**() returns the real UID, the effective UID, and the saved
           set-user-ID of the calling process, in the arguments _ruid_ , _euid_ ,
           and _suid_ , respectively.  **getresgid**() performs the analogous task
           for the process's group IDs.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** One of the arguments specified an address outside the
                  calling program's address space.
    


## STANDARDS



           None.  These calls also appear on HP-UX and some of the BSDs.
    


* * *