12 #include <sys/signal.h>
18 extern char **environ
;
19 static int was_mallocated
= 0;
22 /* Compute the size of environ array including the final NULL */
23 for (size
= 1; environ
[size
++];)
32 environ
= malloc(size
* sizeof(char *));
33 for (i
= 0; i
< size
; i
++)
37 environ
= realloc(environ
, (size
+ 1) * sizeof(char *));
38 environ
[size
- 1] = strcpy(malloc(strlen(name
) + 1), name
);
44 sigaddset(int *set
, int signo
)
46 *set
|= sigmask(signo
);
57 getcwd(char *buf
, size_t size
)