xref: /csrg-svn/lib/libc/gen/ctermid.c (revision 61111)
146476Sbostic /*-
2*61111Sbostic  * Copyright (c) 1990, 1993
3*61111Sbostic  *	The Regents of the University of California.  All rights reserved.
446476Sbostic  *
546476Sbostic  * %sccs.include.redist.c%
646476Sbostic  */
746476Sbostic 
846476Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*61111Sbostic static char sccsid[] = "@(#)ctermid.c	8.1 (Berkeley) 06/04/93";
1046476Sbostic #endif /* LIBC_SCCS and not lint */
1146476Sbostic 
1246476Sbostic #include <stdio.h>
1346476Sbostic #include <paths.h>
1446476Sbostic #include <string.h>
1546476Sbostic 
1646476Sbostic char *
ctermid(s)1746476Sbostic ctermid(s)
1846476Sbostic 	char *s;
1946476Sbostic {
2046487Sbostic 	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