$manlookup

prctl

(2)

operations on a process or thread

System callsmanpages-dev 6.9.1-1
#include <linux/prctl.h> /* Definition of PR_* constants */ #include <sys/prctl.h> int prctl(int op, ...);

LIBRARY

Standard C library (libc, -lc)

DESCRIPTION

prctl() manipulates various aspects of the behavior of the calling thread or process.

prctl() is called with a first argument describing what to do, and further arguments with a significance depending on the first one. The first argument can be:

RETURN VALUE

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

ERRORS

The value of op is not recognized, or not supported on this system.
An unused argument is nonzero.

VERSIONS

IRIX has a prctl() system call (also introduced in Linux 2.1.44 as irix_prctl on the MIPS architecture), with prototype


ptrdiff_t prctl(int op, int arg2, int arg3);

and operations to get the maximum number of processes per user, get the maximum number of processors the calling process can use, find out whether a specified process is currently blocked, get or set the maximum stack size, and so on.

STANDARDS

Linux.

HISTORY

Linux 2.1.57, glibc 2.0.6

CAVEATS

The prototype of the libc wrapper uses a variadic argument list. This makes it necessary to pass the arguments with the right width. When passing numeric constants, such as 0, use a suffix: 0L.

Careless use of some prctl() operations can confuse the user-space run-time environment, so these operations should be used with care.

See also