Changeset 758f8d5 in mainline for uspace/lib/c
- Timestamp:
- 2013-09-11T21:53:36Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e1ec5a2
- Parents:
- 1e371cf (diff), 9dbdda9 (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. - Location:
- uspace/lib/c
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r1e371cf r758f8d5 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> … … 892 893 } 893 894 895 int statfs(const char *path, struct statfs *statfs) 896 { 897 sysarg_t rc; 898 sysarg_t rc_orig; 899 aid_t req; 900 size_t pa_size; 901 902 char *pa = absolutize(path, &pa_size); 903 if (!pa) 904 return ENOMEM; 905 async_exch_t *exch = vfs_exchange_begin(); 906 907 req = async_send_0(exch, VFS_IN_STATFS, NULL); 908 rc = async_data_write_start(exch, pa, pa_size); 909 if (rc != EOK) { 910 vfs_exchange_end(exch); 911 free(pa); 912 async_wait_for(req, &rc_orig); 913 if (rc_orig == EOK) 914 return (int) rc; 915 else 916 return (int) rc_orig; 917 } 918 rc = async_data_read_start(exch, (void *) statfs, sizeof(struct statfs)); 919 if (rc != EOK) { 920 vfs_exchange_end(exch); 921 free(pa); 922 async_wait_for(req, &rc_orig); 923 if (rc_orig == EOK) 924 return (int) rc; 925 else 926 return (int) rc_orig; 927 } 928 vfs_exchange_end(exch); 929 free(pa); 930 async_wait_for(req, &rc); 931 return rc; 932 } 933 894 934 /** @} 895 935 */ -
uspace/lib/c/include/ipc/vfs.h
r1e371cf r758f8d5 82 82 VFS_IN_WAIT_HANDLE, 83 83 VFS_IN_MTAB_GET, 84 VFS_IN_STATFS 84 85 } vfs_in_request_t; 85 86 … … 98 99 VFS_OUT_LOOKUP, 99 100 VFS_OUT_DESTROY, 101 VFS_OUT_STATFS, 100 102 VFS_OUT_LAST 101 103 } vfs_out_request_t; -
uspace/lib/c/include/vfs/vfs.h
r1e371cf r758f8d5 44 44 #include "vfs_mtab.h" 45 45 46 46 47 enum vfs_change_state_type { 47 48 VFS_PASS_HANDLE 48 49 }; 50 49 51 50 52 extern char *absolutize(const char *, size_t *); … … 61 63 extern async_exch_t *vfs_exchange_begin(void); 62 64 extern void vfs_exchange_end(async_exch_t *); 63 64 65 #endif 65 66
Note:
See TracChangeset
for help on using the changeset viewer.