xref: /csrg-svn/lib/libc/gen/ctermid.c (revision 46487)
146476Sbostic /*-
246476Sbostic  * Copyright (c) 1990 The Regents of the University of California.
346476Sbostic  * All rights reserved.
446476Sbostic  *
546476Sbostic  * %sccs.include.redist.c%
646476Sbostic  */
746476Sbostic 
846476Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*46487Sbostic static char sccsid[] = "@(#)ctermid.c	5.2 (Berkeley) 02/20/91";
1046476Sbostic #endif /* LIBC_SCCS and not lint */
1146476Sbostic 
1246476Sbostic #include <stdio.h>
1346476Sbostic #include <paths.h>
1446476Sbostic #include <string.h>
1546476Sbostic 
1646476Sbostic char *
1746476Sbostic ctermid(s)
1846476Sbostic 	char *s;
1946476Sbostic {
20*46487Sbostic 	static char def[] = _PATH_TTY;
2146476Sbostic 
2246476Sbostic 	if (s) {
2346476Sbostic 		bcopy(def, s, sizeof(_PATH_TTY));
2446476Sbostic 		return(s);
2546476Sbostic 	}
2646476Sbostic 	return(def);
2746476Sbostic }
28