ctermid
extern char *ctermid(char *controllingTerminal);
if ((f = fopen(ctermid(NULL), "r")) == NULL)
extern char *ctermid (char *__s) __THROW;