1 #include <unistd.h> 2 #include <stdio.h> 3 4 char * ttyname(int fd)5 ttyname(int fd) 6 { 7 static char buf[100]; 8 9 sprintf(buf, "/fd/%d", fd); 10 return buf; 11 } 12