Lines Matching refs:_environ

43 extern const char		**_environ;
47 * For performance and consistency reasons we expand the _environ list using
51 * 3x the space needed to hold any _environ list.
53 * The only abnormal circumstance is if an application modifies the _environ
56 * issue. For this reason we keep a working copy of our notion of _environ in
57 * my_environ. If, when we are called upon to modify _environ, we ever detect
58 * a mismatch between _environ and my_environ we discard all our assumptions
59 * concerning the location and size of the _environ list. As an additional
60 * precaution we only ever update _environ once we have finished manipulating
70 * Although we don't allocate the original _environ list it is likely that
90 * Compute the size an _environ list including the terminating NULL entry.
91 * This is the only way we have to determine the size of an _environ list
110 * 1. The very first time we reference the _environ list we must call in the
111 * NLSPATH janitor, make a reference to the original _environ list to keep
114 * 2. Whenever we detect that someone else has hijacked _environ (something
121 * may safely test initenv_done or my_environ against _environ just prior to
127 if ((my_environ != _environ) || !initenv_done) {
129 if ((my_environ != _environ) || !initenv_done) {
135 orig_environ = _environ;
141 my_environ = _environ;
153 * Search an _environ list for a particular entry. If name_only is set, then
197 * use a lock (update_lock) to protect all updates to the _environ list, but
200 * or removed from, the _environ list so that we can detect collisions with
250 * the _environ list pointer.
255 _environ = my_environ;
267 * There is no room. Attempt to allocate a new _environ list
308 /* Copy the old _environ list into the top of the new _environ list. */
313 /* Insert the new entry at the bottom of the new _environ list. */
317 /* Ensure that the new _environ list is visible to all. */
320 /* Make the switch (dropping the old _environ list on the floor). */
323 _environ = my_environ;
344 * and construct an _environ entry on behalf of the caller. The bulk of the
399 * unsetenv() is tricky because we need to compress the _environ list in a way
402 * deleted, and then to increment _environ. This has the added advantage of
403 * making _any_ incremental linear search of the _environ list consistent (i.e.
423 * _environ pointer.
432 /* Shrink the _environ list. */
434 _environ = my_environ;
457 _environ = &nullp;
478 if (findenv(_environ, name, 1, &value) != NULL)