repo.or.cz
/
hband-tools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
deprecate execfuse/autosshfs in favor of autosshfs-mount script
[hband-tools.git]
/
compiled-tools
/
setpgrp.c
blob
6b42abb1babbeebbbf0f2d07a739e4d510eb3e0b
1
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <unistd.h>
5
#include <errno.h>
6
#include <err.h>
7
8
9
int
main
(
int
argc
,
char
**
argv
)
10
{
11
if
(
argc
<
2
)
12
{
13
errx
(-
1
,
"Usage: setpgrp <command> [arguments]"
);
14
}
15
16
/*
17
The System V-style setpgrp(), which takes no arguments, is equivalent to setpgid(0, 0).
18
*/
19
20
int
error
=
setpgid
(
0
,
0
);
21
22
if
(
error
!=
0
)
23
{
24
perror
(
"setpgid"
);
25
exit
(
error
);
26
}
27
28
execvp
(
argv
[
1
], &
argv
[
1
]);
29
exit
(
127
);
30
}