1761204953
This commit is contained in:
1 parent
032c5390d0
commit
77b5c2dba1
1 file changed
+15
@@ -0,0 +1,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int rc = system("whoami");
|
||||
if (rc == -1) {
|
||||
perror("system");
|
||||
return 1;
|
||||
}
|
||||
// If you need the command exit code:
|
||||
if (WIFEXITED(rc)) {
|
||||
printf("exit status: %d\n", WEXITSTATUS(rc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user