Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: fusl/src/misc/ptsname.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/misc/openpty.c ('k') | fusl/src/misc/pty.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/misc/ptsname.c
diff --git a/fusl/src/misc/ptsname.c b/fusl/src/misc/ptsname.c
new file mode 100644
index 0000000000000000000000000000000000000000..a34779276fa011be935e1db0860d775165ba8729
--- /dev/null
+++ b/fusl/src/misc/ptsname.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <errno.h>
+
+int __ptsname_r(int, char *, size_t);
+
+char *ptsname(int fd)
+{
+ static char buf[9 + sizeof(int)*3 + 1];
+ int err = __ptsname_r(fd, buf, sizeof buf);
+ if (err) {
+ errno = err;
+ return 0;
+ }
+ return buf;
+}
« no previous file with comments | « fusl/src/misc/openpty.c ('k') | fusl/src/misc/pty.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698