Lines Matching full:environ
128 * Create a copy of environ and return the new argv[0] size
139 * | environ[0] (pointer)
140 * | environ[1] (pointer)
149 * | *environ[0] (string)
150 * | *environ[1] (string)
153 * After this function is call, all the *environ[*] strings will be moved in
154 * dynamic memory, and the old environ strings space in the stack can be used
158 // Count the number of items in environ in move_environ()
160 if (environ) { in move_environ()
161 while (environ[++env_last_id]) in move_environ()
167 // If there is something in environ (it exists and there is something more in move_environ()
169 // for argv after environ is moved. In fact, this would be the size of all in move_environ()
170 // the argv strings, plus the size of all the current environ strings. in move_environ()
172 // - the address of the last element of environ, in move_environ()
173 // - plus its content size, so now we have the very last byte of environ, in move_environ()
175 argv_strings_size = environ[env_last_id - 1] + strlen(environ[env_last_id - 1]) - argv[0]; in move_environ()
181 if (environ) { in move_environ()
182 // Create a copy of environ in dynamic memory in move_environ()
185 // Create a copy in dynamic memory for all the environ strings in move_environ()
187 while (environ[++i]) { in move_environ()
188 new_environ[i] = strdup(environ[i]); in move_environ()
191 // Also, update the environ pointer in move_environ()
192 environ = new_environ; in move_environ()
206 * function will move environ and use its reclaimed space.