tripathysagar/man_text huggingface dataset:
# llseek

## NAME



           _llseek - reposition read/write file offset
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/syscall.h>      **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **int syscall(SYS__llseek, unsigned int** _fd_**, unsigned long** _offset_high_**,**
                       **unsigned long** _offset_low_**, loff_t ***_result_**,**
                       **unsigned int** _whence_**);**
    
           _Note_ : glibc provides no wrapper for **_llseek**(), necessitating the
           use of syscall(2).
    


## DESCRIPTION



           Note: for information about the **llseek**(3) library function, see
           lseek64(3).
    
           The **_llseek**() system call repositions the offset of the open file
           description associated with the file descriptor _fd_ to the value
    
                  (offset_high << 32) | offset_low
    
           This new offset is a byte offset relative to the beginning of the
           file, the current file offset, or the end of the file, depending
           on whether _whence_ is **SEEK_SET** , **SEEK_CUR** , or **SEEK_END** ,
           respectively.
    
           The new file offset is returned in the argument _result_.  The  type
           _loff_t_ is a 64-bit signed type.
    
           This system call exists on various 32-bit platforms to support
           seeking to large file offsets.
    


## RETURN VALUE



           Upon successful completion, **_llseek**() returns 0.  Otherwise, a
           value of -1 is returned and _errno_ is set to indicate the error.
    


## ERRORS



           **EBADF** _fd_ is not an open file descriptor.
    
           **EFAULT** Problem with copying results to user space.
    
           **EINVAL** _whence_ is invalid.
    


## VERSIONS



           You probably want to use the lseek(2) wrapper function instead.
    


## STANDARDS



           Linux.
    


* * *
# sched_yield

## NAME



           sched_yield - yield the processor
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sched.h>**
    
           **int sched_yield(void);**
    


## DESCRIPTION



           **sched_yield**() causes the calling thread to relinquish the CPU.
           The thread is moved to the end of the queue for its static
           priority and a new thread gets to run.
    


## RETURN VALUE



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


## ERRORS



           In the Linux implementation, **sched_yield**() always succeeds.
    


## STANDARDS



           POSIX.1-2008.
    


## CAVEATS



           **sched_yield**() is intended for use with real-time scheduling
           policies (i.e., **SCHED_FIFO** or **SCHED_RR**).  Use of **sched_yield**()
           with nondeterministic scheduling policies such as **SCHED_OTHER** is
           unspecified and very likely means your application design is
           broken.
    
           If the calling thread is the only thread in the highest priority
           list at that time, it will continue to run after a call to
           **sched_yield**().
    
           Avoid calling **sched_yield**() unnecessarily or inappropriately
           (e.g., when resources needed by other schedulable threads are
           still held by the caller), since doing so will result in
           unnecessary context switches, which will degrade system
           performance.
    


* * *
# sched_setparam

## NAME



           sched_setparam, sched_getparam - set and get scheduling parameters
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sched.h>**
    
           **int sched_setparam(pid_t** _pid_**, const struct sched_param ***_param_**);**
           **int sched_getparam(pid_t** _pid_**, struct sched_param ***_param_**);**
    
           **struct sched_param {**
               **...**
               **int** _sched_priority_**;**
               **...**
           **};**
    


## DESCRIPTION



           **sched_setparam**() sets the scheduling parameters associated with
           the scheduling policy for the thread whose thread ID is specified
           in _pid_.  If _pid_ is zero, then the parameters of the calling thread
           are set.  The interpretation of the argument _param_ depends on the
           scheduling policy of the thread identified by _pid_.  See sched(7)
           for a description of the scheduling policies supported under
           Linux.
    
           **sched_getparam**() retrieves the scheduling parameters for the
           thread identified by _pid_.  If _pid_ is zero, then the parameters of
           the calling thread are retrieved.
    
           **sched_setparam**() checks the validity of _param_ for the scheduling
           policy of the thread.  The value _param- >sched_priority_ must lie
           within the range given by sched_get_priority_min(2) and
           sched_get_priority_max(2).
    
           For a discussion of the privileges and resource limits related to
           scheduling priority and policy, see sched(7).
    
           POSIX systems on which **sched_setparam**() and **sched_getparam**() are
           available define **_POSIX_PRIORITY_SCHEDULING** in _< unistd.h>_.
    


## RETURN VALUE



           On success, **sched_setparam**() and **sched_getparam**() return 0.  On
           error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           **EINVAL** Invalid arguments: _param_ is NULL or _pid_ is negative
    
           **EINVAL**(**sched_setparam**()) The argument _param_ does not make sense
                  for the current scheduling policy.
    
           **EPERM**(**sched_setparam**()) The caller does not have appropriate
                  privileges (Linux: does not have the **CAP_SYS_NICE**
                  capability).
    
           **ESRCH** The thread whose ID is _pid_ could not be found.
    


## STANDARDS



           POSIX.1-2008.
    


* * *
# PR_SET_MM_AUXV

## NAME



           PR_SET_MM_AUXV - set a new auxiliary vector
    


## 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_AUXV,**
                     **unsigned long** _addr_**, unsigned long** _size_**, 0L);**
    


## DESCRIPTION



           Set a new auxiliary vector.
    
           _addr_ should provide the address of the vector.  _size_ is the size
           of the vector.
    


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


## STANDARDS



           Linux.
    


* * *
# PR_SET_TIMING

## NAME



           PR_SET_TIMING - set the process timing mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set whether to use (normal, traditional) statistical process
           timing or accurate timestamp-based process timing, by passing
           **PR_TIMING_STATISTICAL** or **PR_TIMING_TIMESTAMP** to _mode_.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _mode_ is not **PR_TIMING_STATISTICAL**.
    


## STANDARDS



           Linux.
    


## CAVEATS



           **PR_TIMING_TIMESTAMP** is not currently implemented (attempting to
           set this mode will yield the error **EINVAL**).
    


* * *
# TCSBRK

## NAME



           TCSBRK, TCSBRKP, TIOCSBRK, TIOCCBRK - sending a break
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <asm/termbits.h>  **/* Definition of **T*BRK*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, TCSBRK, int** _arg_**);**
           **int ioctl(int** _fd_**, TCSBRKP, int** _arg_**);**
           **int ioctl(int** _fd_**, TIOCSBRK);**
           **int ioctl(int** _fd_**, TIOCCBRK);**
    


## DESCRIPTION



           **TCSBRK** Equivalent to _tcsendbreak(fd, arg)_.
    
                  If the terminal is using asynchronous serial data
                  transmission, and _arg_ is zero, then send a break (a stream
                  of zero bits) for between 0.25 and 0.5 seconds.  If the
                  terminal is not using asynchronous serial data
                  transmission, then either a break is sent, or the function
                  returns without doing anything.  When _arg_ is nonzero,
                  nobody knows what will happen.
    
                  (SVr4, UnixWare, Solaris, and Linux treat
                  _tcsendbreak(fd,arg)_ with nonzero _arg_ like _tcdrain(fd)_.
                  SunOS treats _arg_ as a multiplier, and sends a stream of
                  bits _arg_ times as long as done for zero _arg_.  DG/UX and AIX
                  treat _arg_ (when nonzero) as a time interval measured in
                  milliseconds.  HP-UX ignores _arg_.)
    
           **TCSBRKP**
                  So-called "POSIX version" of **TCSBRK**.  It treats nonzero _arg_
                  as a time interval measured in deciseconds, and does
                  nothing when the driver does not support breaks.
    
           **TIOCSBRK**
                  Turn break on, that is, start sending zero bits.
    
           **TIOCCBRK**
                  Turn break off, that is, stop sending zero bits.
    


## RETURN VALUE



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


* * *
# sigsuspend

## NAME



           sigsuspend, rt_sigsuspend - wait for a signal
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           **sigsuspend**() temporarily replaces the signal mask of the calling
           thread with the mask given by _mask_ and then suspends the thread
           until delivery of a signal whose action is to invoke a signal
           handler or to terminate a process.
    
           If the signal terminates the process, then **sigsuspend**() does not
           return.  If the signal is caught, then **sigsuspend**() returns after
           the signal handler returns, and the signal mask is restored to the
           state before the call to **sigsuspend**().
    
           It is not possible to block **SIGKILL** or **SIGSTOP** ; specifying these
           signals in _mask_ , has no effect on the thread's signal mask.
    


## RETURN VALUE



           **sigsuspend**() always returns -1, with _errno_ set to indicate the
           error (normally, **EINTR**).
    


## ERRORS



           **EFAULT** _mask_ points to memory which is not a valid part of the
                  process address space.
    
           **EINTR** The call was interrupted by a signal; signal(7).
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           Normally, **sigsuspend**() is used in conjunction with sigprocmask(2)
           in order to prevent delivery of a signal during the execution of a
           critical code section.  The caller first blocks the signals with
           sigprocmask(2).  When the critical code has completed, the caller
           then waits for the signals by calling **sigsuspend**() with the signal
           mask that was returned by sigprocmask(2) (in the _oldset_ argument).
    
           See sigsetops(3) for details on manipulating signal sets.
    


* * *
# vm86

## NAME



           vm86old, vm86 - enter virtual 8086 mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/vm86.h>**
    
           **int vm86old(struct vm86_struct ***_info_**);**
           **int vm86(unsigned long** _fn_**, struct vm86plus_struct ***_v86_**);**
    


## DESCRIPTION



           The system call **vm86**() was introduced in Linux 0.97p2.  In Linux
           2.1.15 and 2.0.28, it was renamed to **vm86old**(), and a new **vm86**()
           was introduced.  The definition of _struct vm86_struct_ was changed
           in 1.1.8 and 1.1.9.
    
           These calls cause the process to enter VM86 mode (virtual-8086 in
           Intel literature), and are used by **dosemu**.
    
           VM86 mode is an emulation of real mode within a protected mode
           task.
    


## RETURN VALUE



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


## ERRORS



           **EFAULT** This return value is specific to i386 and indicates a
                  problem with getting user-space data.
    
           **ENOSYS** This return value indicates the call is not implemented on
                  the present architecture.
    
           **EPERM** Saved kernel stack exists.  (This is a kernel sanity check;
                  the saved stack should exist only within vm86 mode itself.)
    


## STANDARDS



           Linux on 32-bit Intel processors.
    


* * *
# __riscv_flush_icache

## NAME



           __riscv_flush_icache - Flush icaches on RISC-V
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <sys/cachectl.h>**
    
           **int __riscv_flush_icache(void *start, void *end, unsigned long flags);**
    


## DESCRIPTION



           **__riscv_flush_icache**() enforces ordering between stores and
           instruction cache fetches.
    
           The range of addresses over which ordering is enforced is
           specified by _start_ and _end_.
    
           The _flags_ argument controls the extent of this ordering, with the
           default behavior (a _flags_ value of 0) being to enforce the fence
           on all threads in the current process.  Setting the
           **SYS_RISCV_FLUSH_ICACHE_LOCAL** bit allows users to indicate that
           enforcing ordering on only the current thread is necessary.  All
           other flag bits are reserved.
    


## STANDARDS



           Linux on RISC-V.
    


* * *
# TIOCSCTTY

## NAME



           TIOCSCTTY, TIOCNOTTY - controlling the terminal
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <asm/termbits.h>  **/* Definition of **TIOC*TTY** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, TIOCSCTTY, int** _arg_**);**
           **int ioctl(int** _fd_**, TIOCNOTTY);**
    


## DESCRIPTION



           **TIOCSCTTY**
                  Make the given terminal the controlling terminal of the
                  calling process.  The calling process must be a session
                  leader and not have a controlling terminal already.  For
                  this case, _arg_ should be specified as zero.
    
                  If this terminal is already the controlling terminal of a
                  different session group, then the ioctl fails with **EPERM** ,
                  unless the caller has the **CAP_SYS_ADMIN** capability and _arg_
                  equals 1, in which case the terminal is stolen, and all
                  processes that had it as controlling terminal lose it.
    
           **TIOCNOTTY**
                  If the given terminal was the controlling terminal of the
                  calling process, give up this controlling terminal.  If the
                  process was session leader, then send **SIGHUP** and **SIGCONT** to
                  the foreground process group and all processes in the
                  current session lose their controlling terminal.
    


## RETURN VALUE



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


## ERRORS



           **EPERM** Insufficient permission.
    


* * *
# ioctl_fs

## NAME



           ioctl_fs - filesystem operations
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           The following _op_ values are available.
    
       **Share some of the data of one file with another file**
           FICLONE(2const)
           FICLONERANGE(2const)
    
           FIDEDUPERANGE(2const)
    
       **Operations for inode flags**
           FS_IOC_GETFLAGS(2const)
           FS_IOC_SETFLAGS(2const)
    
       **Get or set a filesystem label**
           FS_IOC_GETFSLABEL(2const)
           FS_IOC_SETFSLABEL(2const)
    
       **Get and/or clear page flags**
           PAGEMAP_SCAN(2const)
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# PR_GET_TIMING

## NAME



           PR_GET_TIMING - get the process timing mode
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Return which process timing method is currently in use.
    


## RETURN VALUE



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


## STANDARDS



           Linux.
    


* * *
# PR_PAC_RESET_KEYS

## NAME



           PR_PAC_RESET_KEYS - reset the calling thread's pointer
           authentication code keys
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Securely reset the thread's pointer authentication keys to fresh
           random values generated by the kernel.
    
           The set of keys to be reset is specified by _keys_ , which must be a
           logical OR of zero or more of the following:
    
           **PR_PAC_APIAKEY**
                  instruction authentication key A
    
           **PR_PAC_APIBKEY**
                  instruction authentication key B
    
           **PR_PAC_APDAKEY**
                  data authentication key A
    
           **PR_PAC_APDBKEY**
                  data authentication key B
    
           **PR_PAC_APGAKEY**
                  generic authentication “A” key.
    
                  (Yes folks, there really is no generic B key.)
    
           As a special case, if _keys_ is zero, then all the keys are reset.
           Since new keys could be added in future, this is the recommended
           way to completely wipe the existing keys when establishing a clean
           execution context.
    
           There is no need to use **PR_PAC_RESET_KEYS** in preparation for
           calling execve(2), since execve(2) resets all the pointer
           authentication keys.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _keys_ contains set bits that are invalid or unsupported on
                  this platform.
    


## STANDARDS



           Linux.  arm64 only.
    


## CAVEATS



           Because the compiler or run-time environment may be using some or
           all of the keys, a successful **PR_PAC_RESET_KEYS** may crash the
           calling process.  The conditions for using it safely are complex
           and system-dependent.  Don't use it unless you know what you are
           doing.
    


* * *
# TIOCCONS

## NAME



           TIOCCONS - redirecting console output
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Redirect output that would have gone to _/dev/console_ or _/dev/tty0_
           to the given terminal.  If that was a pseudoterminal master, send
           it to the slave.
    
           Only a process with the **CAP_SYS_ADMIN** capability may do this.
    
           If output was redirected already, then **EBUSY** is returned, but
           redirection can be stopped by using this ioctl with _fd_ pointing at
           _/dev/console_ or _/dev/tty0_.
    


## RETURN VALUE



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


## ERRORS



           **EBUSY** Output was redirected already.
    
           **EPERM** Insufficient permission.
    


* * *
# sysfs

## NAME



           sysfs - get filesystem type information
    


## SYNOPSIS



           **[[deprecated]] int sysfs(int** _option_**, const char ***_fsname_**);**
           **[[deprecated]] int sysfs(int** _option_**, unsigned int** _fs_index_**, char ***_buf_**);**
           **[[deprecated]] int sysfs(int** _option_**);**
    


## DESCRIPTION



           **Note** : if you are looking for information about the **sysfs**
           filesystem that is normally mounted at _/sys_ , see sysfs(5).
    
           The (obsolete) **sysfs**() system call returns information about the
           filesystem types currently present in the kernel.  The specific
           form of the **sysfs**() call and the information returned depends on
           the _option_ in effect:
    
           **1** Translate the filesystem identifier string _fsname_ into a
              filesystem type index.
    
           **2** Translate the filesystem type index _fs_index_ into a null-
              terminated filesystem identifier string.  This string will be
              written to the buffer pointed to by _buf_.  Make sure that _buf_
              has enough space to accept the string.
    
           **3** Return the total number of filesystem types currently present
              in the kernel.
    
           The numbering of the filesystem type indexes begins with zero.
    


## RETURN VALUE



           On success, **sysfs**() returns the filesystem index for option **1** ,
           zero for option **2** , and the number of currently configured
           filesystems for option **3**.  On error, -1 is returned, and _errno_ is
           set to indicate the error.
    


## ERRORS



           **EFAULT** Either _fsname_ or _buf_ is outside your accessible address
                  space.
    
           **EINVAL** _fsname_ is not a valid filesystem type identifier; _fs_index_
                  is out-of-bounds; _option_ is invalid.
    


## STANDARDS



           None.
    


## BUGS



           There is no libc or glibc support.  There is no way to guess how
           large _buf_ should be.
    


* * *
# PR_SET_TIMERSLACK

## NAME



           PR_SET_TIMERSLACK - set 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_SET_TIMERSLACK, unsigned long** _slack_**);**
    


## DESCRIPTION



           Each thread has two associated timer slack values: a "default"
           value, and a "current" value.  This operation sets the "current"
           timer slack value for the calling thread.  _slack_ is an unsigned
           long value in the range [**1L** , **ULONG_MAX**].  If the nanosecond value
           supplied in _slack_ is greater than zero, then the "current" value
           is set to this value.  If _slack_ is **0L** , the "current" timer slack
           is reset to the thread's "default" timer slack value.
    
           The "current" timer slack is used by the kernel to group timer
           expirations for the calling thread that are close to one another;
           as a consequence, timer expirations for the thread may be up to
           the specified number of nanoseconds late (but will never expire
           early).  Grouping timer expirations can help reduce system power
           consumption by minimizing CPU wake-ups.
    
           The timer expirations affected by timer slack are those set by
           select(2), pselect(2), poll(2), ppoll(2), epoll_wait(2),
           epoll_pwait(2), clock_nanosleep(2), nanosleep(2), and futex(2)
           (and thus the library functions implemented via futexes, including
           pthread_cond_timedwait(3), **pthread_mutex_timedlock**(3),
           **pthread_rwlock_timedrdlock**(3), **pthread_rwlock_timedwrlock**(3), and
           sem_timedwait(3)).
    
           Timer slack is not applied to threads that are scheduled under a
           real-time scheduling policy (see sched_setscheduler(2)).
    
           When a new thread is created, the two timer slack values are made
           the same as the "current" value of the creating thread.
           Thereafter, a thread can adjust its "current" timer slack value
           via **PR_SET_TIMERSLACK**.  The "default" value can't be changed.  The
           timer slack values of _init_ (PID 1), the ancestor of all processes,
           are 50,000 nanoseconds (50 microseconds).  The timer slack value
           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.
    


## FILES



           _/proc/_ pid _/timerslack_ns_
                  Since Linux 4.6, the "current" timer slack value of any
                  process can be examined and changed via this file.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM_ARG_START

## NAME



           PR_SET_MM_ARG_START, PR_SET_MM_ARG_END, PR_SET_MM_ENV_START,
           PR_SET_MM_ENV_END - 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_ARG_START, unsigned long** _addr_**, 0L, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_ARG_END, unsigned long** _addr_**, 0L, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_ENV_START, unsigned long** _addr_**, 0L, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_ENV_END, unsigned long** _addr_**, 0L, 0L);**
    


## DESCRIPTION



           **PR_SET_MM_ARG_START**
                  Set the address above which the program command line is
                  placed.
    
           **PR_SET_MM_ARG_END**
                  Set the address below which the program command line is
                  placed.
    
           **PR_SET_MM_ENV_START**
                  Set the address above which the program environment is
                  placed.
    
           **PR_SET_MM_ENV_END**
                  Set the address below which the program environment is
                  placed.
    
           The address passed with these calls should belong to a process
           stack area.  Thus, the corresponding memory area must be readable,
           writable, and (depending on the kernel configuration) have the
           **MAP_GROWSDOWN** attribute set (see mmap(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).
    


## STANDARDS



           Linux.
    


* * *
# F_DUPFD

## NAME



           F_DUPFD, F_DUPFD_CLOEXEC - duplicate a file descriptor
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <fcntl.h>**
    
           **int fcntl(int** _fd_**, F_DUPFD, int** _arg_**);**
           **int fcntl(int** _fd_**, F_DUPFD_CLOEXEC, int** _arg_**);**
    


## DESCRIPTION



           **F_DUPFD**
                  Duplicate the file descriptor _fd_ using the lowest-numbered
                  available file descriptor greater than or equal to _arg_.
                  This is different from dup2(2), which uses exactly the file
                  descriptor specified.
    
                  On success, the new file descriptor is returned.
    
                  See dup(2) for further details.
    
           **F_DUPFD_CLOEXEC**
                  As for **F_DUPFD** , but additionally set the close-on-exec flag
                  for the duplicate file descriptor.  Specifying this flag
                  permits a program to avoid an additional F_SETFD(2const)
                  operation to set the **FD_CLOEXEC** flag.  For an explanation
                  of why this flag is useful, see the description of
                  **O_CLOEXEC** in open(2).
    


## RETURN VALUE



           The new file descriptor.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## ERRORS



           See fcntl(2).
    
           **EINVAL** _arg_ is negative or is greater than the maximum allowable
                  value (see the discussion of **RLIMIT_NOFILE** in
                  getrlimit(2)).
    
           **EMFILE** The per-process limit on the number of open file
                  descriptors has been reached.
    


## VERSIONS



           POSIX.1-2024 specifies **F_DUPFD_CLOFORK** , but Linux doesn't support
           it.
    


## STANDARDS



           POSIX.1-2008.
    


## CAVEATS



           The errors returned by dup2(2) are different from those returned
           by **F_DUPFD**.
    


* * *
# readahead

## NAME



           readahead - initiate file readahead into page cache
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#define _GNU_SOURCE** /* See feature_test_macros(7) */
           **#define _FILE_OFFSET_BITS 64**
           **#include <fcntl.h>**
    
           **ssize_t readahead(int** _fd_**, off_t** _offset_**, size_t** _count_**);**
    


## DESCRIPTION



           **readahead**() initiates readahead on a file so that subsequent reads
           from that file will be satisfied from the cache, and not block on
           disk I/O (assuming the readahead was initiated early enough and
           that other activity on the system did not in the meantime flush
           pages from the cache).
    
           The _fd_ argument is a file descriptor identifying the file which is
           to be read.  The _offset_ argument specifies the starting point from
           which data is to be read and _count_ specifies the number of bytes
           to be read.  I/O is performed in whole pages, so that _offset_ is
           effectively rounded down to a page boundary and bytes are read up
           to the next page boundary greater than or equal to _(offset+count)_.
           **readahead**() does not read beyond the end of the file.  The file
           offset of the open file description referred to by the file
           descriptor _fd_ is left unchanged.
    


## RETURN VALUE



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


## ERRORS



           **EBADF** _fd_ is not a valid file descriptor or is not open for
                  reading.
    
           **EINVAL** _fd_ does not refer to a file type to which **readahead**() can
                  be applied.
    


## VERSIONS



           On some 32-bit architectures, the calling signature for this
           system call differs, for the reasons described in syscall(2).
    


## STANDARDS



           Linux.
    


## NOTES



           **_FILE_OFFSET_BITS** should be defined to be 64 in code that uses a
           pointer to **readahead** , if the code is intended to be portable to
           traditional 32-bit x86 and ARM platforms where **off_t** 's width
           defaults to 32 bits.
    


## BUGS



           **readahead**() attempts to schedule the reads in the background and
           return immediately.  However, it may block while it reads the
           filesystem metadata needed to locate the requested blocks.  This
           occurs frequently with ext[234] on large files using indirect
           blocks instead of extents, giving the appearance that the call
           blocks until the requested data has been read.
    


* * *
# KEYCTL_UPDATE

## NAME



           KEYCTL_UPDATE - update a key's data payload
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/keyctl.h>  **/* Definition of **KEY*** constants */
           **#include <sys/syscall.h>   **/* Definition of **SYS_*** constants */
           **#include <unistd.h>**
    
           **long syscall(** size_t size;
                        **SYS_keyctl, KEYCTL_UPDATE, key_serial_t** _key_**,**
                        **void** _payload_**[**_size_**], size_t** _size_**);**
    


## DESCRIPTION



           Update a key's data payload.
    
           _key_ specifies the ID of the key to be updated.  _payload_ points to
           the new payload and _size_ contains the new payload size in bytes.
    
           The caller must have _write_ permission on the key specified and the
           key type must support updating.
    
           A negatively instantiated key (see KEYCTL_REJECT(2const)) can be
           positively instantiated with this operation.
    


## RETURN VALUE



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


## ERRORS



           The key type does not support updating.
    


## VERSIONS



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


## STANDARDS



           Linux.
    


* * *
# PR_SET_MM_START_CODE

## NAME



           PR_SET_MM_START_CODE, PR_SET_MM_END_CODE - 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_CODE, unsigned long** _addr_**, 0L, 0L);**
           **int prctl(PR_SET_MM, PR_SET_MM_END_CODE, unsigned long** _addr_**, 0L, 0L);**
    


## DESCRIPTION



           **PR_SET_MM_START_CODE**
                  Set the address above which the program text can run.  The
                  corresponding memory area must be readable and executable,
                  but not writable or shareable (see mprotect(2) and mmap(2)
                  for more information).
    
           **PR_SET_MM_END_CODE**
                  Set the address below which the program text can run.  The
                  corresponding memory area must be readable and executable,
                  but not writable 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.
    


* * *
# chdir

## NAME



           chdir, fchdir - change working directory
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <unistd.h>**
    
           **int chdir(const char ***_path_**);**
           **int fchdir(int** _fd_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **fchdir**():
               _XOPEN_SOURCE >= 500
                   || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
                   || /* glibc up to and including 2.19: */ _BSD_SOURCE
    


## DESCRIPTION



           **chdir**() changes the current working directory of the calling
           process to the directory specified in _path_.
    
           **fchdir**() is identical to **chdir**(); the only difference is that the
           directory is given as an open file descriptor.
    


## RETURN VALUE



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


## ERRORS



           Depending on the filesystem, other errors can be returned.  The
           more general errors for **chdir**() are listed below:
    
           **EACCES** Search permission is denied for one of the components of
                  _path_.  (See also path_resolution(7).)
    
           **EFAULT** _path_ points outside your accessible address space.
    
           **EIO** An I/O error occurred.
    
           **ELOOP** Too many symbolic links were encountered in resolving _path_.
    
           **ENAMETOOLONG**
                  _path_ is too long.
    
           **ENOENT** The directory specified in _path_ does not exist.
    
           **ENOMEM** Insufficient kernel memory was available.
    
           **ENOTDIR**
                  A component of _path_ is not a directory.
    
           The general errors for **fchdir**() are listed below:
    
           **EACCES** Search permission was denied on the directory open on _fd_.
    
           **EBADF** _fd_ is not a valid file descriptor.
    
           **ENOTDIR**
                  _fd_ does not refer to a directory.
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           The current working directory is the starting point for
           interpreting relative pathnames (those not starting with '/').
    
           A child process created via fork(2) inherits its parent's current
           working directory.  The current working directory is left
           unchanged by execve(2).
    


* * *
# NS_GET_NSTYPE

## NAME



           NS_GET_NSTYPE - discovering the namespace type
    


## SYNOPSIS



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


## DESCRIPTION



           The **NS_GET_NSTYPE** operation can be used to discover the type of
           namespace referred to by the file descriptor _fd_.
    
           _fd_ refers to a _/proc/_ pid _/ns/*_ file.
    


## RETURN VALUE



           On success, the return value is one of the **CLONE_NEW*** values that
           can be specified to clone(2) or unshare(2) in order to create a
           namespace.
    
           On error, -1 is returned, and _errno_ is set to indicate the error.
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_SECUREBITS

## NAME



           PR_SET_SECUREBITS - set the "securebits" flags of the calling
           thread
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



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


## DESCRIPTION



           Set the "securebits" flags of the calling thread to the value
           supplied in _flags_.  See capabilities(7).
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _flags_ is not a valid value.
    
           **EPERM** _op_ is **PR_SET_SECUREBITS** , and the caller does not have the
                  **CAP_SETPCAP** capability, or tried to unset a "locked" flag,
                  or tried to set a flag whose corresponding locked flag was
                  set (see capabilities(7)).
    


## STANDARDS



           Linux.
    


* * *
# PR_SET_PTRACER

## NAME



           PR_SET_PTRACER - allow processes to ptrace(2) 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_PTRACER, long** _pid_**);**
    


## DESCRIPTION



           This is meaningful only when the Yama LSM is enabled and in mode 1
           ("restricted ptrace", visible via _/proc/sys/kernel/yama/_
           _ptrace_scope_).
    
           When a "ptracer process ID" is passed in _pid_ , the caller is
           declaring that the ptracer process can ptrace(2) the calling
           process as if it were a direct process ancestor.
    
           Each **PR_SET_PTRACER** operation replaces the previous "ptracer
           process ID".
    
           Employing **PR_SET_PTRACER** with _pid_ set to 0 clears the caller's
           "ptracer process ID".  If _pid_ is **PR_SET_PTRACER_ANY** , the ptrace
           restrictions introduced by Yama are effectively disabled for the
           calling process.
    


## RETURN VALUE



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


## ERRORS



           **EINVAL** _pid_ is not 0, **PR_SET_PTRACER_ANY** , nor the PID of an
                  existing process.
    


## STANDARDS



           Linux.
    


* * *
# UFFDIO_POISON

## NAME



           UFFDIO_POISON - mark an address range as "poisoned"
    


## LIBRARY



           Standard C library (_libc_ , _-lc_)
    


## SYNOPSIS



           **#include <linux/userfaultfd.h>  **/* Definition of **UFFD*** constants */
           **#include <sys/ioctl.h>**
    
           **int ioctl(int** _fd_**, UFFDIO_POISON, ...);**
    
           **#include <linux/userfaultfd.h>**
    
           **struct uffdio_poison {**
                **struct uffdio_range  range;**
                                  /* Range to install poison PTE markers in */
                **__u64   mode;** /* Flags controlling the behavior of poison */
                **__s64   updated;** /* Number of bytes poisoned, or negated error */
           **};**
    


## DESCRIPTION



           Mark an address range as "poisoned".  Future accesses to these
           addresses will raise a **SIGBUS** signal.  Unlike **MADV_HWPOISON** this
           works by installing page table entries, rather than "really"
           poisoning the underlying physical pages.  This means it only
           affects this particular address space.
    
           The following value may be bitwise ORed in _mode_ to change the
           behavior of the **UFFDIO_POISON** operation:
    
           **UFFDIO_POISON_MODE_DONTWAKE**
                  Do not wake up the thread that waits for page-fault
                  resolution.
    
           The _updated_ field is used by the kernel to return the number of
           bytes that were actually poisoned, or an error in the same manner
           as **UFFDIO_COPY**.  If the value returned in the _updated_ field
           doesn't match the value that was specified in _range.len_ , the
           operation fails with the error **EAGAIN**.  The _updated_ field is
           output-only; it is not read by the **UFFDIO_POISON** operation.
    


## RETURN VALUE



           On success, 0 is returned.  In this case, the entire area was
           poisoned.
    
           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
                  _updated_ 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.
    
           **EEXIST** One or more pages were already mapped in the given range.
    
           **ENOENT** The faulting process has changed its virtual memory layout
                  simultaneously with an outstanding **UFFDIO_POISON** operation.
    
           **ENOMEM** Allocating memory for page table entries failed.
    
           **ESRCH** The faulting process has exited at the time of a
                  **UFFDIO_POISON** operation.
    


## STANDARDS



           Linux.
    


## EXAMPLES



           See userfaultfd(2).
    


* * *