ref: 57f8b3d1acf273a88568c49d0b83b6863485b9e0 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; }