You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
230 B

#include <unistd.h>
#include <errno.h>
#include <limits.h>
char *ttyname(int fd)
{
static char buf[TTY_NAME_MAX];
int result;
if ((result = ttyname_r(fd, buf, sizeof buf))) {
errno = result;
return NULL;
}
return buf;
}