tripathysagar/man_text huggingface dataset:
# setfsuid

## NAME



           setfsuid - set user identity used for filesystem checks
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/fsuid.h>**
    
           **[[deprecated]] int setfsuid(uid_t** _fsuid_**);**
    


## DESCRIPTION



           On Linux, a process has both a filesystem user ID and an effective
           user ID.  The (Linux-specific) filesystem user ID is used for
           permissions checking when accessing filesystem objects, while the
           effective user ID is used for various other kinds of permissions
           checks (see credentials(7)).
    
           Normally, the value of the process's filesystem user ID is the
           same as the value of its effective user ID.  This is so, because
           whenever a process's effective user ID is changed, the kernel also
           changes the filesystem user ID to be the same as the new value of
           the effective user ID.  A process can cause the value of its
           filesystem user ID to diverge from its effective user ID by using
           **setfsuid**() to change its filesystem user ID to the value given in
           _fsuid_.
    
           Explicit calls to **setfsuid**() and setfsgid(2) are (were) usually
           used only by programs such as the Linux NFS server that need to
           change what user and group ID is used for file access without a
           corresponding change in the real and effective user and group IDs.
           A change in the normal user IDs for a program such as the NFS
           server is (was) a security hole that can expose it to unwanted
           signals.  (However, this issue is historical; see below.)
    
           **setfsuid**() will succeed only if the caller is the superuser or if
           _fsuid_ matches either the caller's real user ID, effective user ID,
           saved set-user-ID, or current filesystem user ID.
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


## BUGS



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


* * *
# PR_SET_MDWE

## NAME



           PR_SET_MDWE - set the Memory-Deny-Write-Execute protection mask
           for 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_MDWE, unsigned long** _mask_**, 0L, 0L, 0L);**
    


## DESCRIPTION



           Set the calling process' Memory-Deny-Write-Execute protection
           mask.  Once protection bits are set, they can not be changed.
    
           _mask_ must be a bit mask of:
    
           **PR_MDWE_REFUSE_EXEC_GAIN**
                  New memory mapping protections can't be writable and
                  executable.  Non-executable mappings can't become
                  executable.
    
           **PR_MDWE_NO_INHERIT  (since Linux 6.6)**
                  Do not propagate MDWE protection to child processes on
                  fork(2).  Setting this bit requires setting
                  **PR_MDWE_REFUSE_EXEC_GAIN** too.
    


## RETURN VALUE



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


## ERRORS



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


## STANDARDS



           Linux.
    


* * *
# socketcall

## NAME



           socketcall - socket system calls
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/net.h>        **/* Definition of **SYS_*** constants */
           **#include <sys/syscall.h>      **/* Definition of **SYS_socketcall** */
           **#include <unistd.h>**
    
           **int syscall(SYS_socketcall, int** _call_**, unsigned long ***_args_**);**
    
           _Note_ : glibc provides no wrapper for **socketcall**(), necessitating
           the use of syscall(2).
    


## DESCRIPTION



           **socketcall**() is a common kernel entry point for the socket system
           calls.  _call_ determines which socket function to invoke.  _args_
           points to a block containing the actual arguments, which are
           passed through to the appropriate call.
    
           User programs should call the appropriate functions by their usual
           names.  Only standard library implementors and kernel hackers need
           to know about **socketcall**().
    
           _call_              Man page
           **SYS_SOCKET        socket**(2)
           **SYS_BIND          bind**(2)
           **SYS_CONNECT       connect**(2)
           **SYS_LISTEN        listen**(2)
           **SYS_ACCEPT        accept**(2)
           **SYS_GETSOCKNAME   getsockname**(2)
           **SYS_GETPEERNAME   getpeername**(2)
           **SYS_SOCKETPAIR    socketpair**(2)
           **SYS_SEND          send**(2)
           **SYS_RECV          recv**(2)
           **SYS_SENDTO        sendto**(2)
           **SYS_RECVFROM      recvfrom**(2)
           **SYS_SHUTDOWN      shutdown**(2)
           **SYS_SETSOCKOPT    setsockopt**(2)
           **SYS_GETSOCKOPT    getsockopt**(2)
           **SYS_SENDMSG       sendmsg**(2)
           **SYS_RECVMSG       recvmsg**(2)
           **SYS_ACCEPT4       accept4**(2)
           **SYS_RECVMMSG      recvmmsg**(2)
           **SYS_SENDMMSG      sendmmsg**(2)
    


## VERSIONS



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


## STANDARDS



           Linux.
    
           On x86-32, **socketcall**() was historically the only entry point for
           the sockets API.  However, starting in Linux 4.3, direct system
           calls are provided on x86-32 for the sockets API.  This
           facilitates the creation of seccomp(2) filters that filter sockets
           system calls (for new user-space binaries that are compiled to use
           the new entry points) and also provides a (very) small performance
           improvement.
    


* * *
# PR_SET_MM_START_BRK

## NAME



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


## DESCRIPTION



           Set the address above which the program heap can be expanded with
           brk(2) call.
    
           The address must be greater than the ending address of the current
           program data segment.  In addition, the combined size of the
           resulting heap and the data segment can't exceed the **RLIMIT_DATA**
           resource limit (see setrlimit(2)).
    


## 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** _addr_ is less than or equal to the end of the data segment
                  or specifies a value that would cause the **RLIMIT_DATA**
                  resource limit to be exceeded.
    


## STANDARDS



           Linux.
    


* * *
# UFFDIO_ZEROPAGE

## NAME



           UFFDIO_ZEROPAGE - zero out a memory range registered with
           userfaultfd
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, UFFDIO_ZEROPAGE, struct uffdio_zeropage ***_argp_**);**
    
           **#include <linux/userfaultfd.h>**
    
           **struct uffdio_zeropage {**
               **struct uffdio_range  range;**
               **__u64                mode;** /* Flags controlling behavior */
               **__s64                zeropage;** /* Number of bytes zeroed */
           **};**
    


## DESCRIPTION



           Zero out a memory range registered with userfaultfd.
    
           The following value may be bitwise ORed in _mode_ to change the
           behavior of the **UFFDIO_ZEROPAGE** operation:
    
           **UFFDIO_ZEROPAGE_MODE_DONTWAKE**
                  Do not wake up the thread that waits for page-fault
                  resolution.
    
           The _zeropage_ field is used by the kernel to return the number of
           bytes that was actually zeroed, or an error in the same manner as
           **UFFDIO_COPY**.  If the value returned in the _zeropage_ field doesn't
           match the value that was specified in _range.len_ , the operation
           fails with the error **EAGAIN**.  The _zeropage_ field is output-only;
           it is not read by the **UFFDIO_ZEROPAGE** operation.
    


## RETURN VALUE



           This ioctl(2) operation returns 0 on success.  In this case, the
           entire area was zeroed.  On error, -1 is returned and _errno_ is set
           to indicate the error.
    


## ERRORS



           **EAGAIN** The number of bytes zeroed (i.e., the value returned in the
                  _zeropage_ field) does not equal the value that was specified
                  in the _range.len_ field.
    
           **EINVAL** Either _range.start_ or _range.len_ was not a multiple of the
                  system page size; or _range.len_ was zero; or the range
                  specified was invalid.
    
           **EINVAL** An invalid bit was specified in the _mode_ field.
    
           **ESRCH**(since Linux 4.13)
                  The faulting process has exited at the time of a
                  **UFFDIO_ZEROPAGE** operation.
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *
# PR_GET_MDWE

## NAME



           PR_GET_MDWE - get the Memory-Deny-Write-Execute protection mask
           for 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_GET_MDWE, 0L, 0L, 0L, 0L);**
    


## DESCRIPTION



           Return the Memory-Deny-Write-Execute protection mask of the
           calling process.  See PR_SET_MDWE(2const) for information on the
           protection mask bits.
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# getuid

## NAME



           getuid, geteuid - get user identity
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **uid_t getuid(void);**
           **uid_t geteuid(void);**
    


## DESCRIPTION



           **getuid**() returns the real user ID of the calling process.
    
           **geteuid**() returns the effective user ID of the calling process.
    


## ERRORS



           These functions are always successful and never modify _errno_.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# sysinfo

## NAME



           sysinfo - return system information
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/sysinfo.h>**
    
           **int sysinfo(struct sysinfo ***_info_**);**
    


## DESCRIPTION



           **sysinfo**() returns certain statistics on memory and swap usage, as
           well as the load average.
    
           Until Linux 2.3.16, **sysinfo**() returned information in the
           following structure:
    
               struct sysinfo {
                   long uptime;             /* Seconds since boot */
                   unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
                   unsigned long totalram;  /* Total usable main memory size */
                   unsigned long freeram;   /* Available memory size */
                   unsigned long sharedram; /* Amount of shared memory */
                   unsigned long bufferram; /* Memory used by buffers */
                   unsigned long totalswap; /* Total swap space size */
                   unsigned long freeswap;  /* Swap space still available */
                   unsigned short procs;    /* Number of current processes */
                   char _f[22];             /* Pads structure to 64 bytes */
               };
    
           In the above structure, the sizes of the memory and swap fields
           are given in bytes.
    
           Since Linux 2.3.23 (i386) and Linux 2.3.48 (all architectures) the
           structure is:
    
               struct sysinfo {
                   long uptime;             /* Seconds since boot */
                   unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
                   unsigned long totalram;  /* Total usable main memory size */
                   unsigned long freeram;   /* Available memory size */
                   unsigned long sharedram; /* Amount of shared memory */
                   unsigned long bufferram; /* Memory used by buffers */
                   unsigned long totalswap; /* Total swap space size */
                   unsigned long freeswap;  /* Swap space still available */
                   unsigned short procs;    /* Number of current processes */
                   unsigned long totalhigh; /* Total high memory size */
                   unsigned long freehigh;  /* Available high memory size */
                   unsigned int mem_unit;   /* Memory unit size in bytes */
                   char _f[20-2*sizeof(long)-sizeof(int)];
                                            /* Padding to 64 bytes */
               };
    
           In the above structure, sizes of the memory and swap fields are
           given as multiples of _mem_unit_ bytes.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _info_ is not a valid address.
    


## STANDARDS



           Linux.
    


## NOTES



           All of the information provided by this system call is also
           available via _/proc/meminfo_ and _/proc/loadavg_.
    


* * *
# idle

## NAME



           idle - make process 0 idle
    


## SYNOPSIS



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


## DESCRIPTION



           **idle**() is an internal system call used during bootstrap.  It marks
           the process's pages as swappable, lowers its priority, and enters
           the main scheduling loop.  **idle**() never returns.
    
           Only process 0 may call **idle**().  Any user process, even a process
           with superuser permission, will receive **EPERM**.
    


## RETURN VALUE



           **idle**() never returns for process 0, and always returns -1 for a
           user process.
    


## ERRORS



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


## STANDARDS



           Linux.
    


* * *
# UFFDIO_CONTINUE

## NAME



           UFFDIO_CONTINUE - resolve a minor page fault
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, UFFDIO_CONTINUE, struct uffdio_continue ***_argp_**);**
    
           **#include <linux/userfaultfd.h>**
    
           **struct uffdio_continue {**
               **struct uffdio_range  range;**
                                /* Range to install PTEs for and continue */
               **__u64   mode;** /* Flags controlling the behavior of continue */
               **__s64   mapped;** /* Number of bytes mapped, or negated error */
           **};**
    


## DESCRIPTION



           Resolve a minor page fault by installing page table entries for
           existing pages in the page cache.
    
           The following value may be bitwise ORed in _mode_ to change the
           behavior of the **UFFDIO_CONTINUE** operation:
    
           **UFFDIO_CONTINUE_MODE_DONTWAKE**
                  Do not wake up the thread that waits for page-fault
                  resolution.
    
           The _mapped_ field is used by the kernel to return the number of
           bytes that were actually mapped, or an error in the same manner as
           **UFFDIO_COPY**.  If the value returned in the _mapped_ field doesn't
           match the value that was specified in _range.len_ , the operation
           fails with the error **EAGAIN**.  The _mapped_ field is output-only; it
           is not read by the **UFFDIO_CONTINUE** operation.
    


## RETURN VALUE



           This ioctl(2) operation returns 0 on success.  In this case, the
           entire area was mapped.  On error, -1 is returned and _errno_ is set
           to indicate the error.
    


## ERRORS



           **EAGAIN** The number of bytes mapped (i.e., the value returned in the
                  _mapped_ field) does not equal the value that was specified
                  in the _range.len_ field.
    
           **EEXIST** One or more pages were already mapped in the given range.
    
           **EFAULT** No existing page could be found in the page cache for the
                  given range.
    
           **EINVAL** Either _range.start_ or _range.len_ was not a multiple of the
                  system page size; or _range.len_ was zero; or the range
                  specified was invalid.
    
           **EINVAL** An invalid bit was specified in the _mode_ field.
    
           **ENOENT** The faulting process has changed its virtual memory layout
                  simultaneously with an outstanding **UFFDIO_CONTINUE**
                  operation.
    
           **ENOMEM** Allocating memory needed to setup the page table mappings
                  failed.
    
           **ESRCH** The faulting process has exited at the time of a
                  **UFFDIO_CONTINUE** operation.
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *
# ioctl_xfs_getresblks

## NAME



           ioctl_xfs_getresblks - query and set XFS free space reservation
           information
    


## SYNOPSIS



           **#include <xfs/xfs_fs.h>**
    
           **int ioctl(int** _fd_**, XFS_IOC_GET_RESBLKS, struct xfs_fsop_resblks**
           *****_arg_**);**
           **int ioctl(int** _fd_**, XFS_IOC_SET_RESBLKS, struct xfs_fsop_resblks**
           *****_arg_**);**
    


## DESCRIPTION



           Query or set the free space reservation information.  These blocks
           are reserved by the filesystem as a final attempt to prevent
           metadata update failures due to insufficient space.  Only the
           system administrator can use these ioctls, because overriding the
           defaults is extremely dangerous.
    
           This functionality is intended only for use by XFS filesystem
           developers.
    
           The reservation information is conveyed in a structure of the
           following form:
    
               struct xfs_fsop_resblks {
                    __u64  resblks;
                    __u64  resblks_avail;
               };
    
           _resblks_ is the number of blocks that the filesystem will try to
           maintain to prevent critical out of space situations.
    
           _resblks_avail_ is the number of reserved blocks remaining.
    


## RETURN VALUE



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


## ERRORS



           Error codes can be one of, but are not limited to, the following:
    
           **EFSBADCRC**
                  Metadata checksum validation failed while performing the
                  query.
    
           **EFSCORRUPTED**
                  Metadata corruption was encountered while performing the
                  query.
    
           **EINVAL** The specified allocation group number is not valid for this
                  filesystem.
    
           **EIO** An I/O error was encountered while performing the query.
    
           **EPERM** Caller does not have permission to call this ioctl.
    


## CONFORMING TO



           This API is specific to XFS filesystem on the Linux kernel.
    


* * *
# F_GETPIPE_SZ

## NAME



           F_GETPIPE_SZ, F_SETPIPE_SZ - get/set the capacity of a pipe
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#define _GNU_SOURCE**
           **#include <fcntl.h>**
    
           **int fcntl(int** _fd_**, F_SETPIPE_SZ, int** _arg_**);**
           **int fcntl(int** _fd_**, F_GETPIPE_SZ);**
    


## DESCRIPTION



           **F_SETPIPE_SZ**
                  Change the capacity of the pipe referred to by _fd_ to be at
                  least _arg_ bytes.  An unprivileged process can adjust the
                  pipe capacity to any value between the system page size and
                  the limit defined in _/proc/sys/fs/pipe-max-size_ (see
                  proc_sys_fs(5)).  Attempts to set the pipe capacity below
                  the page size are silently rounded up to the page size.
                  Attempts by an unprivileged process to set the pipe
                  capacity above the limit in _/proc/sys/fs/pipe-max-size_
                  yield the error **EPERM** ; a privileged process
                  (**CAP_SYS_RESOURCE**) can override the limit.
    
                  When allocating the buffer for the pipe, the kernel may use
                  a capacity larger than _arg_ , if that is convenient for the
                  implementation.  (In the current implementation, the
                  allocation is the next higher power-of-two page-size
                  multiple of the requested size.)  The actual capacity (in
                  bytes) that is set is returned as the function result.
    
                  Attempting to set the pipe capacity smaller than the amount
                  of buffer space currently used to store data produces the
                  error **EBUSY**.
    
                  Note that because of the way the pages of the pipe buffer
                  are employed when data is written to the pipe, the number
                  of bytes that can be written may be less than the nominal
                  size, depending on the size of the writes.
    
           **F_GETPIPE_SZ**
                  Return (as the function result) the capacity of the pipe
                  referred to by _fd_.
    


## RETURN VALUE



           The pipe capacity.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           See fcntl(2).
    
           **EBUSY** _op_ is **F_SETPIPE_SZ** and the new pipe capacity specified in
                  _arg_ is smaller than the amount of buffer space currently
                  used to store data in the pipe.
    
           **EPERM** _op_ is **F_SETPIPE_SZ** and the soft or hard user pipe limit has
                  been reached; see pipe(7).
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_SECCOMP

## NAME



           PR_SET_SECCOMP - set the secure computing mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/prctl.h>  **/* Definition of **PR_*** constants */
           **#include <sys/prctl.h>**
    
           **[[deprecated]]**
           **int prctl(PR_SET_SECCOMP, long** _mode_**, ...);**
    
           **[[deprecated]]**
           **int prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);**
           **[[deprecated]]**
           **int prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER,**
                     **struct sock_fprog ***_filter_**);**
    


## DESCRIPTION



           Set the secure computing (seccomp) mode for the calling thread, to
           limit the available system calls.  The more recent seccomp(2)
           system call provides a superset of the functionality of
           **PR_SET_SECCOMP** , and is the preferred interface for new
           applications.
    
           The seccomp mode is selected via _mode_.  The seccomp constants are
           defined in _< linux/seccomp.h>_.  The following values can be
           specified:
    
           **SECCOMP_MODE_STRICT**(since Linux 2.6.23)
                  See the description of **SECCOMP_SET_MODE_STRICT** in
                  seccomp(2).
    
                  This operation is available only if the kernel is
                  configured with **CONFIG_SECCOMP** enabled.
    
           **SECCOMP_MODE_FILTER**(since Linux 3.5)
                  The allowed system calls are defined by a pointer to a
                  Berkeley Packet Filter passed in _filter_.  It can be
                  designed to filter arbitrary system calls and system call
                  arguments.  See the description of **SECCOMP_SET_MODE_FILTER**
                  in seccomp(2).
    
                  This operation is available only if the kernel is
                  configured with **CONFIG_SECCOMP_FILTER** enabled.
    


## RETURN VALUE



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


## ERRORS



           **EACCES** _mode_ is **SECCOMP_MODE_FILTER** , but the process does not have
                  the **CAP_SYS_ADMIN** capability or has not set the
                  _no_new_privs_ attribute (see PR_SET_NO_NEW_PRIVS(2const)).
    
           **EFAULT** _mode_ is **SECCOMP_MODE_FILTER** , and _filter_ is an invalid
                  address.
    
           **EINVAL** _mode_ is not a valid value.
    
           **EINVAL** The kernel was not configured with **CONFIG_SECCOMP**.
    
           **EINVAL** _mode_ is **SECCOMP_MODE_FILTER** , and the kernel was not
                  configured with **CONFIG_SECCOMP_FILTER**.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM_BRK

## NAME



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


## DESCRIPTION



           Set the current brk(2) value.
    
           The requirements for the address are the same as for the
           **PR_SET_MM_START_BRK** option.
    


## 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** _addr_ is less than or equal to the end of the data segment
                  or specifies a value that would cause the **RLIMIT_DATA**
                  resource limit to be exceeded.
    


## STANDARDS



           Linux.
    


* * *
# PR_GET_ENDIAN

## NAME



           PR_GET_ENDIAN - get the endian-ness 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_GET_ENDIAN, int ***_endianness_**);**
    


## DESCRIPTION



           Return the endian-ness of the calling process, in the location
           pointed to by _endianness_.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _endianness_ is an invalid address.
    


## STANDARDS



           Linux.  PowerPC only.
    


* * *
# tkill

## NAME



           tkill, tgkill - send a signal to a thread
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <signal.h>           **/* Definition of **SIG*** constants */
           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **[[deprecated]] int syscall(SYS_tkill, pid_t** _tid_**, int** _sig_**);**
    
           **#include <signal.h>**
    
           **int tgkill(pid_t** _tgid_**, pid_t** _tid_**, int** _sig_**);**
    
           _Note_ : glibc provides no wrapper for **tkill**(), necessitating the use
           of syscall(2).
    


## DESCRIPTION



           **tgkill**() sends the signal _sig_ to the thread with the thread ID _tid_
           in the thread group _tgid_.  (By contrast, kill(2) can be used to
           send a signal only to a process (i.e., thread group) as a whole,
           and the signal will be delivered to an arbitrary thread within
           that process.)
    
           **tkill**() is an obsolete predecessor to **tgkill**().  It allows only
           the target thread ID to be specified, which may result in the
           wrong thread being signaled if a thread terminates and its thread
           ID is recycled.  Avoid using this system call.
    
           These are the raw system call interfaces, meant for internal
           thread library use.
    


## RETURN VALUE



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


## ERRORS



           **EAGAIN** The **RLIMIT_SIGPENDING** resource limit was reached and _sig_ is
                  a real-time signal.
    
           **EAGAIN** Insufficient kernel memory was available and _sig_ is a real-
                  time signal.
    
           **EINVAL** An invalid thread ID, thread group ID, or signal was
                  specified.
    
           **EPERM** Permission denied.  For the required permissions, see
                  kill(2).
    
           **ESRCH** No process with the specified thread ID (and thread group
                  ID) exists.
    


## STANDARDS



           Linux.
    


## NOTES



           See the description of **CLONE_THREAD** in clone(2) for an explanation
           of thread groups.
    


* * *
# KEYCTL_SEARCH

## NAME



           KEYCTL_SEARCH - search a keyring for 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_SEARCH, key_serial_t** _src_**,**
                        **char ***_type_**, char ***_desc_**,**
                        **unsigned long** _dst_**);**
    


## DESCRIPTION



           Search for a key in a keyring tree, returning its ID and
           optionally linking it to a specified keyring.
    
           The tree to be searched is specified by passing the ID of the head
           keyring in _src_.  The search is performed breadth-first and
           recursively.
    
           The _type_ and _desc_ arguments specify the key to be searched for:
           _type_ contains the key type (a null-terminated character string up
           to 32 bytes in size, including the terminating null byte), and
           _desc_ contains the description of the key (a null-terminated
           character string up to 4096 bytes in size, including the
           terminating null byte).
    
           The source keyring must grant _search_ permission to the caller.
           When performing the recursive search, only keyrings that grant the
           caller _search_ permission will be searched.  Only keys with for
           which the caller has _search_ permission can be found.
    
           If the key is found, its ID is returned as the function result.
    
           If the key is found and _dst_ is nonzero, then, subject to the same
           constraints and rules as KEYCTL_LINK(2const), the key is linked
           into the keyring whose ID is specified in _dst_.  If the destination
           keyring specified in _dst_ already contains a link to a key that has
           the same type and description, then that link will be displaced by
           a link to the key found by this operation.
    
           Instead of valid existing keyring IDs, the source (_src_) and
           destination (_dst_) keyrings can be one of the special keyring IDs
           listed under KEYCTL_GET_KEYRING_ID(2const).
    


## RETURN VALUE



           On success, the ID of the key that was found.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL** The size of the description in _desc_ (including the
                  terminating null byte) exceeded 4096 bytes.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# getsid

## NAME



           getsid - get session ID
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **pid_t getsid(pid_t** _pid_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **getsid**():
               _XOPEN_SOURCE >= 500
                   || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
    


## DESCRIPTION



           **getsid**() returns the session ID of the process with process ID
           _pid_.  If _pid_ is 0, **getsid**() returns the session ID of the calling
           process.
    


## RETURN VALUE



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


## ERRORS



           **EPERM** A process with process ID _pid_ exists, but it is not in the
                  same session as the calling process, and the implementation
                  considers this an error.
    
           **ESRCH** No process with process ID _pid_ was found.
    


## VERSIONS



           Linux does not return **EPERM**.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           See credentials(7) for a description of sessions and session IDs.
    


* * *
# mq_unlink

## NAME



           mq_unlink - remove a message queue
    


## LIBRARY



           Real-time library (_librt_ , _-lrt_)
    


## SYNOPSIS



           **#include <mqueue.h>**
    
           **int mq_unlink(const char ***_name_**);**
    


## DESCRIPTION



           **mq_unlink**() removes the specified message queue _name_.  The message
           queue name is removed immediately.  The queue itself is destroyed
           once any other processes that have the queue open close their
           descriptors referring to the queue.
    


## RETURN VALUE



           On success **mq_unlink**() returns 0; on error, -1 is returned, with
           _errno_ set to indicate the error.
    


## ERRORS



           **EACCES** The caller does not have permission to unlink this message
                  queue.
    
           **ENAMETOOLONG**
                  _name_ was too long.
    
           **ENOENT** There is no message queue with the given _name_.
    


## ATTRIBUTES



           For an explanation of the terms used in this section, see
           attributes(7).
           ┌──────────────────────────────────────┬───────────────┬─────────┐
           │ **Interface** │ **Attribute** │ **Value** │
           ├──────────────────────────────────────┼───────────────┼─────────┤
           │ **mq_unlink**()                          │ Thread safety │ MT-Safe │
           └──────────────────────────────────────┴───────────────┴─────────┘
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# PR_MCE_KILL_GET

## NAME



           PR_MCE_KILL_GET - get 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_GET, 0L, 0L, 0L, 0L);**
    


## DESCRIPTION



           Return the current per-process machine check kill policy; see
           PR_MCE_KILL_SET(2const).
    


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


## STANDARDS



           Linux.
    


* * *
# sgetmask

## NAME



           sgetmask, ssetmask - manipulation of signal mask (obsolete)
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **[[deprecated]] long syscall(SYS_sgetmask, void);**
           **[[deprecated]] long syscall(SYS_ssetmask, long** _newmask_**);**
    


## DESCRIPTION



           These system calls are obsolete.  _Do not use them_ ; use
           sigprocmask(2) instead.
    
           **sgetmask**() returns the signal mask of the calling process.
    
           **ssetmask**() sets the signal mask of the calling process to the
           value given in _newmask_.  The previous signal mask is returned.
    
           The signal masks dealt with by these two system calls are plain
           bit masks (unlike the _sigset_t_ used by sigprocmask(2)); use
           sigmask(3) to create and inspect these masks.
    


## RETURN VALUE



           **sgetmask**() always successfully returns the signal mask.
           **ssetmask**() always succeeds, and returns the previous signal mask.
    


## ERRORS



           These system calls always succeed.
    


## STANDARDS



           Linux.
    


## NOTES



           These system calls are unaware of signal numbers greater than 31
           (i.e., real-time signals).
    
           These system calls do not exist on x86-64.
    
           It is not possible to block **SIGSTOP** or **SIGKILL**.
    


* * *
# PR_CAP_AMBIENT_RAISE

## NAME



           PR_CAP_AMBIENT_RAISE - add to the ambient capability set of the
           calling thread
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           The capability specified in _cap_ is added to the ambient capability
           set.  The specified capability must already be present in both the
           permitted and the inheritable sets of the process.  This operation
           is not permitted if the **SECBIT_NO_CAP_AMBIENT_RAISE** securebit is
           set.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _cap_ does not specify a valid capability.
    
           **EPERM** either the capability specified in _cap_ is not present in
                  the process's permitted and inheritable capability sets, or
                  the **PR_CAP_AMBIENT_LOWER** securebit has been set.
    


## VERSIONS



           See PR_CAP_AMBIENT(2const).
    


## STANDARDS



           Linux.
    


* * *
# NS_GET_OWNER_UID

## NAME



           NS_GET_OWNER_UID - discovering the owner of a user namespace
    


## SYNOPSIS



           **#include <linux/nsfs.h>  **/* Definition of **NS_GET_OWNER_UID** */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, NS_GET_OWNER_UID, uid_t ***_uid_**);**
    


## DESCRIPTION



           The **NS_GET_OWNER_UID** operation can be used to discover the owner
           user ID of a user namespace (i.e., the effective user ID of the
           process that created the user namespace).
    
           _fd_ refers to a _/proc/_ pid _/ns/user_ file.
    
           The owner user ID is returned in the _uid_t_ pointed to by the third
           argument.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _fd_ does not refer to a user namespace.
    


## STANDARDS



           Linux.
    


* * *
# s390_runtime_instr

## NAME



           s390_runtime_instr - enable/disable s390 CPU run-time
           instrumentation
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <asm/runtime_instr.h> **/* Definition of **S390_*** constants */
           **#include <sys/syscall.h>       **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS_s390_runtime_instr, int** _command_**, int** _signum_**);**
    
           _Note_ : glibc provides no wrapper for **s390_runtime_instr**(),
           necessitating the use of syscall(2).
    


## DESCRIPTION



           The **s390_runtime_instr**() system call starts or stops CPU run-time
           instrumentation for the calling thread.
    
           The _command_ argument controls whether run-time instrumentation is
           started (**S390_RUNTIME_INSTR_START** , 1) or stopped
           (**S390_RUNTIME_INSTR_STOP** , 2) for the calling thread.
    
           The _signum_ argument specifies the number of a real-time signal.
           This argument was used to specify a signal number that should be
           delivered to the thread if the run-time instrumentation buffer was
           full or if the run-time-instrumentation-halted interrupt had
           occurred.  This feature was never used, and in Linux 4.4 support
           for this feature was removed; thus, in current kernels, this
           argument is ignored.
    


## RETURN VALUE



           On success, **s390_runtime_instr**() returns 0 and enables the thread
           for run-time instrumentation by assigning the thread a default
           run-time instrumentation control block.  The caller can then read
           and modify the control block and start the run-time
           instrumentation.  On error, -1 is returned and _errno_ is set to
           indicate the error.
    


## ERRORS



           **EINVAL** The value specified in _command_ is not a valid command.
    
           **EINVAL** The value specified in _signum_ is not a real-time signal
                  number.  From Linux 4.4 onwards, the _signum_ argument has no
                  effect, so that an invalid signal number will not result in
                  an error.
    
           **ENOMEM** Allocating memory for the run-time instrumentation control
                  block failed.
    
           **EOPNOTSUPP**
                  The run-time instrumentation facility is not available.
    


## STANDARDS



           Linux on s390.
    


## NOTES



           The _asm/runtime_instr.h_ header file is available since Linux 4.16.
    
           Starting with Linux 4.4, support for signalling was removed, as
           was the check whether _signum_ is a valid real-time signal.  For
           backwards compatibility with older kernels, it is recommended to
           pass a valid real-time signal number in _signum_ and install a
           handler for that signal.
    


* * *
# PR_GET_TAGGED_ADDR_CTRL

## NAME



           PR_GET_TAGGED_ADDR_CTRL - get the tagged address mode 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_TAGGED_ADDR_CTRL, 0L, 0L, 0L, 0L);**
    


## DESCRIPTION



           Returns the current tagged address mode for the calling thread.
    
           The call returns a nonnegative value describing the current tagged
           address mode, encoded in the same way as the _mode_ argument of
           PR_SET_TAGGED_ADDR_CTRL(2const).
    


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


## ERRORS



           This feature is disabled or unsupported by the kernel, or disabled
           via _/proc/sys/abi/tagged_addr_disabled_.
    


## FILES



           _/proc/sys/abi/tagged_addr_disabled_
    


## STANDARDS



           Linux.  arm64 only.
    


* * *
# PR_GET_THP_DISABLE

## NAME



           PR_GET_THP_DISABLE - get 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_GET_THP_DISABLE, 0L, 0L, 0L, 0L);**
    


## DESCRIPTION



           Return the current setting of the "THP disable" flag for the
           calling thread: either 1, if the flag is set, or 0, if it is not.
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# PR_GET_FPEXC

## NAME



           PR_GET_FPEXC - get the floating-point exception mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Return floating-point exception mode, in the location pointed to
           by _mode_.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** _mode_ is an invalid address.
    


## STANDARDS



           Linux.  PowerPC only.
    


* * *