1 .\" 2 .\" This file and its contents are supplied under the terms of the 3 .\" Common Development and Distribution License ("CDDL"), version 1.0. 4 .\" You may only use this file in accordance with the terms of version 5 .\" 1.0 of the CDDL. 6 .\" 7 .\" A full copy of the text of the CDDL should have accompanied this 8 .\" source. A copy of the CDDL is also available via the Internet at 9 .\" http://www.illumos.org/license/CDDL. 10 .\" 11 .\" 12 .\" Copyright 2015 Joyent, Inc. 13 .\" 14 .Dd May 11, 2016 15 .Dt PSETFLAGS 3PROC 16 .Os 17 .Sh NAME 18 .Nm Psetflags , 19 .Nm Punsetflags 20 .Nd set and unset process flags 21 .Sh LIBRARY 22 .Lb libproc 23 .Sh SYNOPSIS 24 .In libproc.h 25 .Ft int 26 .Fo Psetflags 27 .Fa "struct ps_prochandle *P" 28 .Fa "long flags" 29 .Fc 30 .Ft int 31 .Fo Punsetflags 32 .Fa "struct ps_prochandle *P" 33 .Fa "long flags" 34 .Fc 35 .Sh DESCRIPTION 36 The 37 .Fn Psetflags 38 and 39 .Fn Punsetflags 40 functions manipulate the process flags for the process handle 41 .Fa P . 42 The process flags determine how the process behaves in the face of 43 various actions. 44 For example, setting the 45 .Sy PR_FORK 46 flag indicates that the tracing flags of the process and the 47 inherit-on-fork mode should be set on children. 48 A full list of the process flags is available in the 49 .Sy PCSET 50 section in 51 .Xr proc 4 . 52 .Pp 53 The 54 .Fn Psetflags 55 function sets the flags specified in 56 .Fa flags 57 by doing a bitwise-inclusive-OR with the previously set flags. 58 .Pp 59 The 60 .Fn Punsetflags 61 function removes the flags specified in 62 .Fa flags 63 from the tracing flags of the process. 64 Items not listed in 65 .Fa flags 66 will remain. 67 .Pp 68 To see the current set of flags active on the process, check the 69 .Sy pr_flags 70 member of the 71 .Sy pstatus_t 72 for the process. 73 It can be obtained through the 74 .Xr Pstatus 3PROC 75 function. 76 .Pp 77 Note, attempting to modify the process flags only works on active 78 processes. 79 Attempting to call these functions of process handles corresponding to core 80 files, zombie processes, or files, will result in an error. 81 .Sh RETURN VALUES 82 Upon successful completion, the 83 .Fn Psetflags 84 and 85 .Fn Punsetflags 86 functions return 87 .Sy 0 . 88 Otherwise, 89 .Sy -1 90 is returned 91 and 92 .Sy errno 93 is set to indicate the error. 94 .Sh ERRORS 95 For a full list of possible errors see the 96 .Sy DIAGNOSTICS 97 section in 98 .Xr proc 4 . 99 .Sh INTERFACE STABILITY 100 .Sy Uncommitted 101 .Sh MT-LEVEL 102 See 103 .Sy LOCKING 104 in 105 .Xr libproc 3LIB . 106 .Sh SEE ALSO 107 .Xr libproc 3LIB , 108 .Xr Pstatus 3PROC , 109 .Xr proc 4