ref: 48c5cf1f11fb6b8b620e5ed9269a528b5f6633f4 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; }