mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 13:04:27 +01:00
userland: move posix/environ from cpp-cheat
This commit is contained in:
15
userland/posix/environ.c
Normal file
15
userland/posix/environ.c
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/* Print all environment variables. */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char **env = environ;
|
||||||
|
while (*env) {
|
||||||
|
printf("%s\n", *env);
|
||||||
|
env++;
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user