Changeset a56cef9 in mainline
- Timestamp:
- 2017-03-30T21:09:51Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e5562a
- Parents:
- 67e881c
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/kio/kio.c
r67e881c ra56cef9 48 48 #include <adt/prodcons.h> 49 49 #include <tinput.h> 50 #include <vfs/vfs.h> 50 51 51 52 #define NAME "kio" … … 128 129 129 130 fflush(log); 130 fsync(fileno(log));131 vfs_sync(fileno(log)); 131 132 } 132 133 -
uspace/lib/c/generic/io/io.c
r67e881c ra56cef9 836 836 837 837 if ((stream->fd >= 0) && (stream->need_sync)) { 838 int rc; 839 838 840 /** 839 841 * Better than syncing always, but probably still not the … … 841 843 */ 842 844 stream->need_sync = false; 843 if (fsync(stream->fd) != 0) { 844 /* errno was set by fsync() */ 845 rc = vfs_sync(stream->fd); 846 if (rc != EOK) { 847 errno = rc; 845 848 return EOF; 846 849 } -
uspace/lib/c/generic/vfs/vfs.c
r67e881c ra56cef9 597 597 * 598 598 * @param fildes File descriptor 599 * @return 0 on success. On error returns -1 and sets errno. 600 */ 601 int fsync(int fildes) 602 { 603 async_exch_t *exch = vfs_exchange_begin(); 604 sysarg_t rc = async_req_1_0(exch, VFS_IN_SYNC, fildes); 605 vfs_exchange_end(exch); 606 607 if (rc != EOK) { 608 errno = rc; 609 return -1; 610 } 611 612 return 0; 599 * @return EOK on success or a negative error code otherwise. 600 */ 601 int vfs_sync(int file) 602 { 603 async_exch_t *exch = vfs_exchange_begin(); 604 sysarg_t rc = async_req_1_0(exch, VFS_IN_SYNC, file); 605 vfs_exchange_end(exch); 606 607 return rc; 613 608 } 614 609 … … 620 615 * @param length Length 621 616 * 622 * @return 0on success or a negative erroc code otherwise.617 * @return EOK on success or a negative erroc code otherwise. 623 618 */ 624 619 int vfs_resize(int file, aoff64_t length) -
uspace/lib/c/include/unistd.h
r67e881c ra56cef9 62 62 63 63 extern int close(int); 64 extern int fsync(int);65 64 66 65 extern char *getcwd(char *, size_t); -
uspace/lib/c/include/vfs/vfs.h
r67e881c ra56cef9 95 95 extern int vfs_statfs(int, struct statfs *); 96 96 extern int vfs_statfs_path(const char *, struct statfs *); 97 extern int vfs_sync(int); 97 98 extern int vfs_unlink(int, const char *, int); 98 99 extern int vfs_unlink_path(const char *); -
uspace/lib/posix/source/unistd.c
r67e881c ra56cef9 247 247 int posix_fsync(int fildes) 248 248 { 249 return negerrno(fsync, fildes); 249 if (rcerrno(vfs_sync, fildes) != EOK) 250 return -1; 251 else 252 return 0; 250 253 } 251 254
Note:
See TracChangeset
for help on using the changeset viewer.