repo.or.cz
/
ub0rlay.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
refs
|
edit
|
fork
4abdcccf9dcd594de6163f99dda2935271301508
[ub0rlay.git]
/
net-wireless
/
aircrack-ng
/
files
/
process-group-leader.c
blob
4abdcccf9dcd594de6163f99dda2935271301508
1
#include <unistd.h>
2
#include <sys/signal.h>
3
#include <sys/wait.h>
4
#include <stdlib.h>
5
6
int
main
(
int
argc
,
char
*
argv
[]) {
7
pid_t pid
;
8
9
signal
(
SIGQUIT
,
SIG_IGN
);
10
signal
(
SIGTERM
,
SIG_IGN
);
11
setpgid
(
0
,
0
);
12
13
pid
=
fork
();
14
if
(
pid
==
0
) {
15
int
status
;
16
wait
(&
status
);
17
exit
(
WEXITSTATUS
(
status
));
18
}
19
else
{
20
execv
(
argv
[
1
], &
argv
[
1
]);
21
exit
(
1
);
22
}
23
24
return
0
;
25
}
26