Copyright (c) 2013 Hudson River Trading LLC Written by: John H. Baldwin <jhb@FreeBSD.org> All rights reserved. Copyright (c) 2014 The FreeBSD Foundation Portions of this documentation were written by Konstantin Belousov under sponsorship from the FreeBSD Foundation. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this lis...
NAMEprocctl - control processes
SYNOPSISIn sys/procctl.h Ft int Fn procctl idtype_t idtype id_t id int cmd void *arg
DESCRIPTIONThe Fn procctl system call provides for control over processes. The Fa idtype and Fa id arguments specify the set of processes to control. If multiple processes match the identifier, will make a ``best effort'' to control as many of the selected processes as possible. An error is only returned if no selected processes successfully complete the request. The following identifier types are supported:
- Control the process with the process ID Fa id .
- Control processes belonging to the process group with the ID Fa id .
The control request to perform is specified by the Fa cmd argument. The following commands are supported:
Set process protection state.
This is used to mark a process as protected from being killed if the system
exhausts available memory and swap.
parameter must point to an integer containing an operation and zero or more
The following operations are supported:
- Mark the selected processes as protected.
- Clear the protected state of selected processes.
The following optional flags are supported:
- Apply the requested operation to all child processes of each selected process in addition to each selected process.
- 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 VALUESIf an error occurs, a value of -1 is returned and errno is set to indicate the error.
ERRORSThe Fn procctl system call will fail if:
- Bq Er EFAULT
- The Fa arg points outside the process's allocated address space.
- Bq Er EINVAL
argument specifies an unsupported command.
The Fa idtype argument specifies an unsupported identifier type.
- Bq Er EPERM
- The calling process does not have permission to perform the requested operation on any of the selected processes.
- Bq Er ESRCH
- No processes matched the requested Fa idtype and Fa id .
- Bq Er EINVAL
- An invalid operation or flag was passed in Fa arg for a PROC_SPROTECT command.