Changes in uspace/lib/c/generic/vfs/vfs.c [fa24efa:35a35651] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
rfa24efa r35a35651 43 43 #include <stdio.h> 44 44 #include <sys/stat.h> 45 #include <sys/statfs.h>46 45 #include <sys/types.h> 47 46 #include <ipc/services.h> … … 342 341 } 343 342 344 ssize_t read(int fildes, void *buf, size_t nbyte) 343 ssize_t read(int fildes, void *buf, size_t nbyte) 345 344 { 346 345 sysarg_t rc; … … 348 347 aid_t req; 349 348 350 if (nbyte > DATA_XFER_LIMIT)351 nbyte = DATA_XFER_LIMIT;352 353 349 async_exch_t *exch = vfs_exchange_begin(); 354 350 355 351 req = async_send_1(exch, VFS_IN_READ, fildes, &answer); 356 rc = async_data_read_start(exch, (void *) 352 rc = async_data_read_start(exch, (void *)buf, nbyte); 357 353 if (rc != EOK) { 358 354 vfs_exchange_end(exch); … … 380 376 aid_t req; 381 377 382 if (nbyte > DATA_XFER_LIMIT)383 nbyte = DATA_XFER_LIMIT;384 385 378 async_exch_t *exch = vfs_exchange_begin(); 386 379 387 380 req = async_send_1(exch, VFS_IN_WRITE, fildes, &answer); 388 rc = async_data_write_start(exch, (void *) 381 rc = async_data_write_start(exch, (void *)buf, nbyte); 389 382 if (rc != EOK) { 390 383 vfs_exchange_end(exch); … … 899 892 } 900 893 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 927 894 /** @} 928 895 */
Note:
See TracChangeset
for help on using the changeset viewer.