diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-07 20:45:38 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-15 12:21:45 +0200 |
commit | 70bbeea7b227866bdbdef0b249ff7f8644713f15 (patch) | |
tree | 3cc3d87a42d2edae54563981b4e81a73690db913 /include/fs.h | |
parent | e1385b3399b606c2fe495f2e1967822af715edec (diff) | |
download | barebox-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/fs.h')
-rw-r--r-- | include/fs.h | 51 |
1 files changed, 6 insertions, 45 deletions
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 <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <dirent.h> +#include <sys/mount.h> +#include <sys/stat.h> #include <driver.h> #include <filetype.h> #include <linux/fs.h> @@ -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 */ |