From 70bbeea7b227866bdbdef0b249ff7f8644713f15 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 7 Apr 2016 20:45:38 +0200 Subject: 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 --- include/fs.h | 51 ++++++--------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) (limited to 'include/fs.h') diff --git a/include/fs.h b/include/fs.h index 7081227780..135cb57be4 100644 --- a/include/fs.h +++ b/include/fs.h @@ -1,6 +1,12 @@ #ifndef __FS_H #define __FS_H +#include +#include +#include +#include +#include +#include #include #include #include @@ -11,18 +17,6 @@ struct partition; struct node_d; struct stat; -struct dirent { - char d_name[256]; -}; - -typedef struct dir { - struct device_d *dev; - struct fs_driver_d *fsdrv; - struct node_d *node; - struct dirent d; - void *priv; /* private data for the fs driver */ -} DIR; - typedef struct filep { struct fs_device_d *fsdev; /* The device this FILE belongs to */ char *path; @@ -107,40 +101,7 @@ struct fs_device_d { #define drv_to_fs_driver(d) container_of(d, struct fs_driver_d, drv) -/* - * standard posix file functions - */ -int open(const char *pathname, int flags, ...); -int creat(const char *pathname, mode_t mode); -int unlink(const char *pathname); -int close(int fd); int flush(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); -int ioctl(int fd, int request, void *buf); -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 mkdir (const char *pathname, mode_t mode); -int rmdir (const char *pathname); - -const char *getcwd(void); -int chdir(const char *pathname); - -DIR *opendir(const char *pathname); -struct dirent *readdir(DIR *dir); -int closedir(DIR *dir); - -int symlink(const char *pathname, const char *newpath); -int readlink(const char *path, char *buf, size_t bufsiz); - -int mount (const char *device, const char *fsname, const char *path, - const char *fsoptions); -int umount(const char *pathname); int umount_by_cdev(struct cdev *cdev); /* not-so-standard functions */ -- cgit v1.2.3