Changes in uspace/lib/c/generic/vfs/vfs.c [35a35651:38db6288] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r35a35651 r38db6288 43 43 #include <stdio.h> 44 44 #include <sys/stat.h> 45 #include <sys/statfs.h> 45 46 #include <sys/types.h> 46 47 #include <ipc/services.h> … … 341 342 } 342 343 343 ssize_t read(int fildes, void *buf, size_t nbyte) 344 ssize_t read(int fildes, void *buf, size_t nbyte) 344 345 { 345 346 sysarg_t rc; … … 347 348 aid_t req; 348 349 350 if (nbyte > DATA_XFER_LIMIT) 351 nbyte = DATA_XFER_LIMIT; 352 349 353 async_exch_t *exch = vfs_exchange_begin(); 350 354 351 355 req = async_send_1(exch, VFS_IN_READ, fildes, &answer); 352 rc = async_data_read_start(exch, (void *) buf, nbyte);356 rc = async_data_read_start(exch, (void *) buf, nbyte); 353 357 if (rc != EOK) { 354 358 vfs_exchange_end(exch); … … 376 380 aid_t req; 377 381 382 if (nbyte > DATA_XFER_LIMIT) 383 nbyte = DATA_XFER_LIMIT; 384 378 385 async_exch_t *exch = vfs_exchange_begin(); 379 386 380 387 req = async_send_1(exch, VFS_IN_WRITE, fildes, &answer); 381 rc = async_data_write_start(exch, (void *) buf, nbyte);388 rc = async_data_write_start(exch, (void *) buf, nbyte); 382 389 if (rc != EOK) { 383 390 vfs_exchange_end(exch); … … 735 742 } 736 743 744 int remove(const char *path) 745 { 746 return unlink(path); 747 } 748 737 749 int chdir(const char *path) 738 750 { … … 892 904 } 893 905 906 int statfs(const char *path, struct statfs *st) 907 { 908 sysarg_t rc, rc_orig; 909 aid_t req; 910 size_t pa_size; 911 912 char *pa = absolutize(path, &pa_size); 913 if (!pa) 914 return ENOMEM; 915 916 async_exch_t *exch = vfs_exchange_begin(); 917 918 req = async_send_0(exch, VFS_IN_STATFS, NULL); 919 rc = async_data_write_start(exch, pa, pa_size); 920 if (rc != EOK) 921 goto exit; 922 923 rc = async_data_read_start(exch, (void *) st, sizeof(*st)); 924 925 exit: 926 vfs_exchange_end(exch); 927 free(pa); 928 async_wait_for(req, &rc_orig); 929 return (int) (rc_orig != EOK ? rc_orig : rc); 930 } 931 894 932 /** @} 895 933 */
Note:
See TracChangeset
for help on using the changeset viewer.