summaryrefslogtreecommitdiff
path: root/tools/envdump.c
blob: 4536d004184af166e184b2a98747fdbb0a995bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <unistd.h>
#include <stdio.h>

int main(int argc, char* argv[], char* envp[]) {
	char** environ_ = envp;

	FILE* fp = fopen("/tmp/envdump.txt", "w");

	while (*environ_) {
		fprintf(fp, "%s\n", *environ_);
		environ_++;
	}

	fclose(fp);

	return 0;
}