From c567505d21d14b75b30c3056c301c8cff9fe5846 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 May 2007 19:03:01 +0000 Subject: [PATCH] Added fsync() git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@241 42af7a65-404d-4744-a932-0658087f49c3 --- include/nuttx/fs.h | 15 +++++++++++---- include/unistd.h | 7 ++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/nuttx/fs.h b/include/nuttx/fs.h index 9c4a538df4..043514034c 100644 --- a/include/nuttx/fs.h +++ b/include/nuttx/fs.h @@ -136,16 +136,23 @@ struct mountpt_operations off_t (*seek)(FAR struct file *filp, off_t offset, int whence); int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg); + /* The two structures need not be common after this point. The following + * are extended methods needed to deal with the unique needs of mounted + * file systems. + */ + + int (*sync)(FAR struct file *filp); + /* The two structures need not be common after this point. For the * case of struct mountpt_operations, additional operations are included * that used only for mounting and unmounting the volume. */ - int (*bind)(FAR struct inode *blkdriver, const void *data, void **handle); - int (*unbind)(void *handle); + int (*bind)(FAR struct inode *blkdriver, const void *data, void **handle); + int (*unbind)(void *handle); - /* NOTE: More operations will be needed here to support: disk usage stats, stat(), - * sync(), unlink(), mkdir(), chmod(), rename(), etc. + /* NOTE: More operations will be needed here to support: disk usage stats + * stat(), unlink(), mkdir(), chmod(), rename(), etc. */ }; diff --git a/include/unistd.h b/include/unistd.h index 164b5368e0..16414fc773 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -94,7 +94,7 @@ #undef _POSIX_ASYNC_IO #undef _POSIX_PRIO_IO -#define fsync(f) +#define fdatasync(f) fsync(f) /************************************************************ * Global Function Prototypes @@ -118,8 +118,9 @@ EXTERN void usleep(unsigned long usec); /* File descriptor operations */ EXTERN int close(int fd); -EXTERN int dup(int fildes); -EXTERN int dup2(int fildes1, int fildes2); +EXTERN int dup(int fd); +EXTERN int dup2(int fd1, int fd2); +EXTERN int fsync(int fd); EXTERN off_t lseek(int fd, off_t offset, int whence); EXTERN int read(int fd, void *buf, unsigned int nbytes); EXTERN int unlink(const char *path);