Lines Matching defs:envp

88 	char **envp = NULL;
149 if (env && (envp = calloc(1, esize + sizeof (uintptr_t))) == NULL) {
157 * Walk up the 32-bit stack, filling in the 64-bit argv and envp
178 if (envp) {
180 envp[i] = (char *)(uintptr_t)(*(caddr32_t *)stackp);
183 envp[envc] = 0;
198 if (envp)
199 (void) memcpy(envp + eptrcount, (void *)stackp, strpoolsz);
206 * changes to the argv and envp arrays.
225 if (envp) {
226 char *envp_null = (char *)envp + esize;
229 reloc = (char *)(envp + eptrcount) - (char *)
234 if (last_str < (char *)envp ||
235 last_str >= (char *)envp + esize)
239 str = (envp[i] += reloc);
240 if (str < (char *)envp ||
241 str >= (char *)envp + esize) {
243 envp[i] = (char *)((size_t)last_str +
246 envp[i] = envp_null;
248 last_str = envp[i];
250 *env = envp;
269 char **envp = NULL;
273 char *envp_null; /* Known null in the returned envp */
315 if ((envp = malloc(esize + sizeof (uintptr_t))) == NULL) {
320 envp_null = (char *)envp + esize;
331 if (envp)
332 free(envp);
336 if (envp) {
338 * Copy it to the malloc()d space for the envp array
340 (void) memcpy(envp, &argv[argc + 1], esize);
342 } else if (envp) {
345 (uintptr_t)u->u_envp, envp, esize) != esize) {
346 free(envp);
373 * Relocate and sanity check the envp array. A null entry indicates
383 if (envp) {
389 offset = (char *)envp - (char *)u->u_envp;
397 if (last_str < (char *)envp ||
398 last_str >= (char *)envp + esize)
403 * Relocate the envp[] addresses, while ensuring that we
406 for (i = 0; envp[i] != NULL; i++) {
407 str = (envp[i] += offset);
408 if (str < (char *)envp || str >= (char *)envp + esize) {
410 envp[i] = last_str +
413 envp[i] = envp_null;
415 last_str = envp[i];
417 envp[i] = NULL;
418 *env = envp;