Files
revng-revng/tests/syscall.c
T
2016-01-04 21:47:34 +01:00

23 lines
432 B
C

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/syscall.h>
int root(char *buffer, size_t size) {
int result;
#ifdef TARGET_mips
__asm__("li $v0,0xfb8\n\tsyscall\n\tmove %0, $v0" : "=r"(result) : : "%v0");
#else
result = syscall(SYS_getuid);
#endif
return result;
}
int main(int argc, char *argv[]) {
printf("%d\n", root(argv[1], strlen(argv[1])));
return EXIT_SUCCESS;
}