diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-04-18 17:34:51 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-04-18 17:34:51 +0200 |
commit | 4335a620a364b70f06421b1698706a9dc3324a46 (patch) | |
tree | b7cecf621f9751a56faf77ddedc6fe0cb6f5fdbd /1/test/main.c | |
parent | bfb105b36e902ffc1aec9424a38245db693eea02 (diff) |
start writing test applications
Diffstat (limited to '1/test/main.c')
-rw-r--r-- | 1/test/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/1/test/main.c b/1/test/main.c new file mode 100644 index 0000000..7329e16 --- /dev/null +++ b/1/test/main.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <unistd.h> + +int main(int argc, char** argv) { + if (geteuid() != 0) { + fprintf(stderr, "run me as root!\n"); + return 1; + } + + argc--; // argv[0] is the program name + if (argc == 0) { + fprintf(stderr, "usage: %s /dev/lork\n", argv[0]); + return 1; + } + + return 0; +} + |