Changeset c2a6983 in mainline for uspace/lib/c/generic/vfs/vfs.c
- Timestamp:
- 2013-10-13T20:59:33Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12d6c98
- Parents:
- 820104d (diff), 39bcc99 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/lib/c/generic/vfs/vfs.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r820104d rc2a6983 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); … … 892 899 } 893 900 901 int statfs(const char *path, struct statfs *st) 902 { 903 sysarg_t rc, rc_orig; 904 aid_t req; 905 size_t pa_size; 906 907 char *pa = absolutize(path, &pa_size); 908 if (!pa) 909 return ENOMEM; 910 911 async_exch_t *exch = vfs_exchange_begin(); 912 913 req = async_send_0(exch, VFS_IN_STATFS, NULL); 914 rc = async_data_write_start(exch, pa, pa_size); 915 if (rc != EOK) 916 goto exit; 917 918 rc = async_data_read_start(exch, (void *) st, sizeof(*st)); 919 920 exit: 921 vfs_exchange_end(exch); 922 free(pa); 923 async_wait_for(req, &rc_orig); 924 return (int) (rc_orig != EOK ? rc_orig : rc); 925 } 926 894 927 /** @} 895 928 */
Note:
See TracChangeset
for help on using the changeset viewer.
