xref: /plan9-contrib/sys/src/ape/lib/ap/plan9/ctermid.c (revision 2d069fea74dfcc83c6858e715bf74862cb64720a)
1 #include <unistd.h>
2 #include <stdio.h>
3 #include <string.h>
4 
5 char *
ctermid(char * s)6 ctermid(char *s)
7 {
8 	static char buf[L_ctermid];
9 
10 	if(s == 0)
11 		s = buf;
12 	strncpy(s, "/dev/cons", sizeof buf);
13 	return(s);
14 }
15 
16 char *
ctermid_r(char * s)17 ctermid_r(char *s)
18 {
19 	return s ? ctermid(s) : NULL;
20 }
21