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
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.
12 .\" Copyright 2015 Joyent, Inc.
19 .Nd iterate process environment
25 .Fa "struct ps_prochandle *P"
26 .Fa "proc_env_f *func"
32 function iterates over the environment of the process represented by
34 For each environment variable,
36 is passed the caller argument
38 along with the address of the environment variable and the key-value pair.
39 For the full signature of the
44 The callback's return value controls whether or not iteration proceeds.
47 returns zero, then iteration continues.
48 Otherwise, iteration is terminated and the value is returned.
49 It is recommended that callback functions do not return
51 so as to distinguish between the failure of the
53 function and the callback function.
55 Upon successful completion, the
59 Otherwise, if there was an internal error, for example due to a
60 corrupted environment, then
63 Otherwise, if the callback function
65 returns non-zero, then its return value will be returned instead.
66 .Sh INTERFACE STABILITY