1 #include <unistd.h> 2 #include <stdio.h> 3 #include <string.h> 4 5 char * ctermid(char * s)6ctermid(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)17ctermid_r(char *s) 18 { 19 return s ? ctermid(s) : NULL; 20 } 21