Changeset 67e881c in mainline for uspace/lib/c
- Timestamp:
- 2017-03-30T20:59:36Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a56cef9
- Parents:
- 79ea5af
- Location:
- uspace/lib/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r79ea5af r67e881c 408 408 assert(!(oflag & O_APPEND)); 409 409 410 (void) ftruncate(fd, 0);410 (void) vfs_resize(fd, 0); 411 411 } 412 412 … … 620 620 * @param length Length 621 621 * 622 * @return 0 on success , -1 on error and sets errno.623 */ 624 int ftruncate(int fildes, aoff64_t length)622 * @return 0 on success or a negative erroc code otherwise. 623 */ 624 int vfs_resize(int file, aoff64_t length) 625 625 { 626 626 sysarg_t rc; 627 627 628 628 async_exch_t *exch = vfs_exchange_begin(); 629 rc = async_req_3_0(exch, VFS_IN_TRUNCATE, fildes, 630 LOWER32(length), UPPER32(length)); 631 vfs_exchange_end(exch); 632 633 if (rc != EOK) { 634 errno = rc; 635 return -1; 636 } 637 638 return 0; 629 rc = async_req_3_0(exch, VFS_IN_RESIZE, file, LOWER32(length), 630 UPPER32(length)); 631 vfs_exchange_end(exch); 632 633 return rc; 639 634 } 640 635 -
uspace/lib/c/include/ipc/vfs.h
r79ea5af r67e881c 65 65 VFS_IN_READ = IPC_FIRST_USER_METHOD, 66 66 VFS_IN_WRITE, 67 VFS_IN_ TRUNCATE,67 VFS_IN_RESIZE, 68 68 VFS_IN_STAT, 69 69 VFS_IN_CLOSE, -
uspace/lib/c/include/unistd.h
r79ea5af r67e881c 61 61 extern ssize_t read(int, aoff64_t *, void *, size_t); 62 62 63 extern int ftruncate(int, aoff64_t);64 65 63 extern int close(int); 66 64 extern int fsync(int); -
uspace/lib/c/include/vfs/vfs.h
r79ea5af r67e881c 90 90 extern int vfs_root(void); 91 91 extern void vfs_root_set(int); 92 extern int vfs_resize(int, aoff64_t); 92 93 extern int vfs_stat(int, struct stat *); 93 94 extern int vfs_stat_path(const char *, struct stat *);
Note:
See TracChangeset
for help on using the changeset viewer.