Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PROCCTL(2)		  FreeBSD System Calls Manual		    PROCCTL(2)

NAME
     procctl --	control	processes

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <sys/procctl.h>

     int
     procctl(idtype_t idtype, id_t id, int cmd,	void *arg);

DESCRIPTION
     The procctl() system call provides	for control over processes.  The
     idtype and	id arguments specify the set of	processes to control.  If mul-
     tiple processes match the identifier, procctl will	make a ``best effort''
     to	control	as many	of the selected	possibles as possible.	An error is
     only returned if no selected processes successfully complete the request.
     The following identifier types are	supported:

     P_PID	Control	the process with the process ID	id.

     P_PGID	Control	processes belonging to the process group with the ID
		id.

     The control request to perform is specified by the	cmd argument.  The
     following commands	are supported:

     PROC_SPROTECT     Set process protection state.  This is used to mark a
		       process as protected from being killed if the system
		       exhausts	available memory and swap.  The	arg parameter
		       must point to an	integer	containing an operation	and
		       zero or more optional flags.  The following operations
		       are supported:

		       PPROT_SET       Mark the	selected processes as pro-
				       tected.

		       PPROT_CLEAR     Clear the protected state of selected
				       processes.

		       The following optional flags are	supported:

		       PPROT_DESCEND   Apply the requested operation to	all
				       child processes of each selected
				       process in addition to each selected
				       process.

		       PPROT_INHERIT   When used with PPROT_SET, mark all
				       future child processes of each selected
				       process as protected.  Future child
				       processes will also mark	all of their
				       future child processes.

RETURN VALUES
     If	an error occurs, a value of -1 is returned and errno is	set to indi-
     cate the error.

ERRORS
     The procctl() system call will fail if:

     [EFAULT]		The arg	points outside the process's allocated address
			space.

     [EINVAL]		The cmd	argument specifies an unsupported command.

			The idtype argument specifies an unsupported identi-
			fier type.

     [EPERM]		The calling process does not have permission to	per-
			form the requested operation on	any of the selected
			processes.

     [ESRCH]		No processes matched the requested idtype and id.

     [EINVAL]		An invalid operation or	flag was passed	in arg for a
			PROC_SPROTECT command.

SEE ALSO
     ptrace(2)

HISTORY
     The procctl() function appeared in	FreeBSD	10.

FreeBSD	10.0		      September	19, 2013		  FreeBSD 10.0

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=procctl&sektion=2&manpath=FreeBSD+10.0-RELEASE>

home | help