repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
powerpc-sf longjmp clobbering of val argument
[musl.git]
/
src
/
misc
/
login_tty.c
blob
f0be0a09a35533519dbdf4a65c76a895c3ce34e5
1
#include <utmp.h>
2
#include <sys/ioctl.h>
3
#include <unistd.h>
4
5
int
login_tty
(
int
fd
)
6
{
7
setsid
();
8
if
(
ioctl
(
fd
,
TIOCSCTTY
, (
char
*)
0
))
return
-
1
;
9
dup2
(
fd
,
0
);
10
dup2
(
fd
,
1
);
11
dup2
(
fd
,
2
);
12
if
(
fd
>
2
)
close
(
fd
);
13
return
0
;
14
}