1 PENV_ITER(3PROC) Process Control Library Functions PENV_ITER(3PROC) 2 3 NAME 4 Penv_iter - iterate process environment 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Penv_iter(struct ps_prochandle *P, proc_env_f *func, void *data); 14 15 DESCRIPTION 16 The Penv_iter() function iterates over the environment of the process 17 represented by P. For each environment variable, func is passed the 18 caller argument data along with the address of the environment variable 19 and the key-value pair. For the full signature of the proc_env_f 20 callback, see libproc(3LIB). 21 22 The callback's return value controls whether or not iteration proceeds. 23 If func returns zero, then iteration continues. Otherwise, iteration is 24 terminated and the value is returned. It is recommended that callback 25 functions do not return -1 so as to distinguish between the failure of 26 the Penv_iter() function and the callback function. 27 28 RETURN VALUES 29 Upon successful completion, the Penv_iter() function returns 0. 30 Otherwise, if there was an internal error, for example due to a corrupted 31 environment, then -1 is returned. Otherwise, if the callback function 32 func returns non-zero, then its return value will be returned instead. 33 34 INTERFACE STABILITY 35 Uncommitted 36 37 MT-LEVEL 38 See LOCKING in libproc(3LIB). 39 40 SEE ALSO 41 libproc(3LIB) 42 43 illumos March 2, 2017 illumos