ref: 8dfdc38f952b708732e605641bd9cc64b126cbdc 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; }