projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add ptsname_r (nonstandard) and split ptsname (standard) to separate file
[musl]
/
src
/
misc
/
ptsname.c
diff --git a/src/misc/ptsname.c
b/src/misc/ptsname.c
new file mode 100644
(file)
index 0000000..
4f56781
--- /dev/null
+++ b/
src/misc/ptsname.c
@@ -0,0
+1,9
@@
+#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;
+}