summaryrefslogtreecommitdiffstats
path: root/firmware/include/file.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 17:35:04 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 17:35:04 +0000
commitc61e89c0eda126c2c1a4a3983520c35fe30db156 (patch)
tree1285f8cbde5485f93f8653f31ea0454587dd741e /firmware/include/file.h
parent684c70bac5f27e8dec49e113563cf6e496da854d (diff)
downloadrockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.tar.gz
rockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.zip
Make creat() posix compliant API-wise. Shouldn't affect the core as it's wrapped via a static inline.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include/file.h')
-rw-r--r--firmware/include/file.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/firmware/include/file.h b/firmware/include/file.h
index 9a9548f8f6..b60c744549 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -48,9 +48,9 @@
#define O_TRUNC 0x10
#endif
-#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
+#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
#define open(x,y) sim_open(x,y)
-#define creat(x) sim_creat(x)
+#define creat(x,m) sim_creat(x,m)
#define remove(x) sim_remove(x)
#define rename(x,y) sim_rename(x,y)
#define filesize(x) sim_filesize(x)
@@ -60,11 +60,12 @@
#define read(x,y,z) sim_read(x,y,z)
#define write(x,y,z) sim_write(x,y,z)
#define close(x) sim_close(x)
+extern int sim_creat(const char *pathname, mode_t mode);
#endif
typedef int (*open_func)(const char* pathname, int flags);
typedef ssize_t (*read_func)(int fd, void *buf, size_t count);
-typedef int (*creat_func)(const char *pathname);
+typedef int (*creat_func)(const char *pathname, mode_t mode);
typedef ssize_t (*write_func)(int fd, const void *buf, size_t count);
typedef void (*qsort_func)(void *base, size_t nmemb, size_t size,
int(*_compar)(const void *, const void *));
@@ -74,7 +75,15 @@ extern int close(int fd);
extern int fsync(int fd);
extern ssize_t read(int fd, void *buf, size_t count);
extern off_t lseek(int fildes, off_t offset, int whence);
-extern int creat(const char *pathname);
+extern int file_creat(const char *pathname);
+#ifndef SIMULATOR
+/* posix compatibility function */
+static inline int creat(const char *pathname, mode_t mode)
+{
+ (void)mode;
+ return file_creat(pathname);
+}
+#endif
extern ssize_t write(int fd, const void *buf, size_t count);
extern int remove(const char* pathname);
extern int rename(const char* path, const char* newname);