Changeset 0ed9cb6 in mainline
- Timestamp:
- 2013-07-25T11:22:55Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1cdc44a
- Parents:
- ff8c87c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
rff8c87c r0ed9cb6 575 575 int stat(const char *path, struct stat *stat) 576 576 { 577 sysarg_t rc;578 sysarg_t rc_orig;579 aid_t req;580 581 577 size_t pa_size; 582 578 char *pa = absolutize(path, &pa_size); 583 if (!pa) 579 if (!pa) { 584 580 return ENOMEM; 585 586 async_exch_t *exch = vfs_exchange_begin(); 587 588 req = async_send_0(exch, VFS_IN_STAT, NULL); 589 rc = async_data_write_start(exch, pa, pa_size); 590 if (rc != EOK) { 591 vfs_exchange_end(exch); 592 free(pa); 593 async_wait_for(req, &rc_orig); 594 if (rc_orig == EOK) 595 return (int) rc; 596 else 597 return (int) rc_orig; 598 } 599 rc = async_data_read_start(exch, stat, sizeof(struct stat)); 600 if (rc != EOK) { 601 vfs_exchange_end(exch); 602 free(pa); 603 async_wait_for(req, &rc_orig); 604 if (rc_orig == EOK) 605 return (int) rc; 606 else 607 return (int) rc_orig; 608 } 609 vfs_exchange_end(exch); 610 free(pa); 611 async_wait_for(req, &rc); 581 } 582 583 int fd = _vfs_walk(-1, pa, 0); 584 if (fd < 0) { 585 return fd; 586 } 587 588 int rc = fstat(fd, stat); 589 close(fd); 612 590 return rc; 613 591 }
Note:
See TracChangeset
for help on using the changeset viewer.