summaryrefslogtreecommitdiffstats
path: root/include/unistd.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-04-07 20:45:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-15 12:21:45 +0200
commit70bbeea7b227866bdbdef0b249ff7f8644713f15 (patch)
tree3cc3d87a42d2edae54563981b4e81a73690db913 /include/unistd.h
parente1385b3399b606c2fe495f2e1967822af715edec (diff)
downloadbarebox-70bbeea7b227866bdbdef0b249ff7f8644713f15.tar.gz
barebox-70bbeea7b227866bdbdef0b249ff7f8644713f15.tar.xz
fs: move libc function prototypes to their correct locations
This moves the function prototypes in include/fs.h which also exist in the libc to the locations they would have in libc. With this it becomes easier to share code between barebox and userspace since the usual libc include files will exist. Also users of the libc functions no longer have to include the barebox internal fs.h header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h
new file mode 100644
index 0000000000..31f430a5b6
--- /dev/null
+++ b/include/unistd.h
@@ -0,0 +1,24 @@
+#ifndef __UNISTD_H
+#define __UNISTD_H
+
+#include <linux/types.h>
+
+struct stat;
+
+int unlink(const char *pathname);
+int close(int fd);
+int lstat(const char *filename, struct stat *s);
+int stat(const char *filename, struct stat *s);
+int fstat(int fd, struct stat *s);
+ssize_t read(int fd, void *buf, size_t count);
+ssize_t pread(int fd, void *buf, size_t count, loff_t offset);
+ssize_t write(int fd, const void *buf, size_t count);
+ssize_t pwrite(int fd, const void *buf, size_t count, loff_t offset);
+loff_t lseek(int fildes, loff_t offset, int whence);
+int rmdir (const char *pathname);
+int symlink(const char *pathname, const char *newpath);
+int readlink(const char *path, char *buf, size_t bufsiz);
+int chdir(const char *pathname);
+const char *getcwd(void);
+
+#endif /* __UNISTD_H */