#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/io.h>
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 23 of file dio.cxx.
24{
26
27
30 perror("iopl()");
31 exit(2);
32 }
33
34
35
36 if (setuid(getuid()) < 0) {
37 perror("setuid()");
38 exit(2);
39 }
40
41
42 if (argc < 2) {
43 fprintf(stderr, "Usage: %s program [arguments]\n", argv[0]);
44 exit(1);
45 }
46
47
48 if (execvp(argv[1], &argv[1]) < 0) {
49 perror(argv[1]);
50 exit(2);
51 }
52 return 0;
53}