Files
semi-libc/src/misc/ptsname.c
T
Rich Felker 750b738e53 add ptsname_r (nonstandard) and split ptsname (standard) to separate file
this eliminates the ugly static buffer in programs that use ptsname_r.
2011-04-13 08:35:32 -04:00

10 lines
183 B
C

#include <stdlib.h>
int __ptsname_r(int, char *, size_t);
char *ptsname(int fd)
{
static char buf[9 + sizeof(int)*3 + 1];
return __ptsname_r(fd, buf, sizeof buf) < 0 ? 0 : buf;
}