/*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)login_tty.c 1.1 (Berkeley) 06/15/90"; #endif /* LIBC_SCCS and not lint */ #include #include login_tty(fd) int fd; { (void) setsid(); (void) ioctl(fd, TIOCSCTTY, (char *)NULL); (void) close(0); (void) close(1); (void) close(2); (void) dup2(fd, 0); (void) dup2(fd, 1); (void) dup2(fd, 2); (void) close(fd); }