xref: /csrg-svn/lib/libc/gen/ctermid.c (revision 46476)
1*46476Sbostic /*-
2*46476Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*46476Sbostic  * All rights reserved.
4*46476Sbostic  *
5*46476Sbostic  * %sccs.include.redist.c%
6*46476Sbostic  */
7*46476Sbostic 
8*46476Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*46476Sbostic static char sccsid[] = "@(#)ctermid.c	5.1 (Berkeley) 02/19/91";
10*46476Sbostic #endif /* LIBC_SCCS and not lint */
11*46476Sbostic 
12*46476Sbostic #include <stdio.h>
13*46476Sbostic #include <paths.h>
14*46476Sbostic #include <string.h>
15*46476Sbostic 
16*46476Sbostic char *
17*46476Sbostic ctermid(s)
18*46476Sbostic 	char *s;
19*46476Sbostic {
20*46476Sbostic 	static char *def = _PATH_TTY;
21*46476Sbostic 
22*46476Sbostic 	if (s) {
23*46476Sbostic 		bcopy(def, s, sizeof(_PATH_TTY));
24*46476Sbostic 		return(s);
25*46476Sbostic 	}
26*46476Sbostic 	return(def);
27*46476Sbostic }
28