-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
e1385b3
commit 70bbeea
Showing
7 changed files
with
78 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __DIRENT_H | ||
#define __DIRENT_H | ||
|
||
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; | ||
|
||
DIR *opendir(const char *pathname); | ||
struct dirent *readdir(DIR *dir); | ||
int closedir(DIR *dir); | ||
|
||
#endif /* __DIRENT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __SYS_IOCTL_H | ||
#define __SYS_IOCTL_H | ||
|
||
int ioctl(int fd, int request, void *buf); | ||
|
||
#endif /* __SYS_IOCTL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __SYS_MOUNT_H | ||
#define __SYS_MOUNT_H | ||
|
||
int mount(const char *device, const char *fsname, const char *path, | ||
const char *fsoptions); | ||
int umount(const char *pathname); | ||
|
||
#endif /* __SYS_MOUNT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef __STAT_H | ||
#define __STAT_H | ||
|
||
#include <linux/types.h> | ||
#include <linux/stat.h> | ||
|
||
int mkdir (const char *pathname, mode_t mode); | ||
|
||
#endif /* __STAT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |