ref: 6b8bae6a7e94bbbfb15f8c344ac5beee0bc08eda dir: /sys/src/ape/lib/ap/plan9/ttyname.c/
#include <unistd.h> #include <stdio.h> char * ttyname(int fd) { static char buf[100]; sprintf(buf, "/fd/%d", fd); return buf; }