tlib9: add close - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 6fd4e901ce48f2e056c505c81320f786175588ff
DIR parent 58fdc083addda3f95eb8895f474da5a52f145be0
HTML Author: Russ Cox <rsc@swtch.com>
Date: Sun, 17 May 2020 12:37:11 -0400
lib9: add close
More preparation for opendir.
Diffstat:
M include/libc.h | 4 +++-
M src/lib9/open.c | 7 +++++++
2 files changed, 10 insertions(+), 1 deletion(-)
---
DIR diff --git a/include/libc.h b/include/libc.h
t@@ -747,7 +747,7 @@ extern int awaitnohang(char*, int);
/* extern int bind(char*, char*, int); give up */
/* extern int brk(void*); <unistd.h> */
extern int p9chdir(char*);
-extern int close(int);
+extern int p9close(int);
extern int p9create(char*, int, ulong);
extern int p9dup(int, int);
extern int errstr(char*, uint);
t@@ -822,6 +822,8 @@ extern ulong rendezvous(ulong, ulong);
#define create p9create
#undef open
#define open p9open
+#undef close
+#define close p9close
#define pipe p9pipe
#define waitfor p9waitfor
#define write p9write
DIR diff --git a/src/lib9/open.c b/src/lib9/open.c
t@@ -129,6 +129,13 @@ p9open(char *name, int mode)
return fd;
}
+int
+p9close(int fd)
+{
+ return close(fd);
+}
+
+
extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*);
#if defined(__linux__)