Changeset 354b642 in mainline for uspace/lib/c/generic/vfs/vfs.c
- Timestamp:
- 2017-03-07T10:53:31Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a274a5f
- Parents:
- c577a9a
- git-author:
- Jiri Zarevucky <zarevucky.jiri@…> (2017-03-07 10:53:31)
- git-committer:
- Jakub Jermar <jakub@…> (2017-03-07 10:53:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
rc577a9a r354b642 419 419 req = async_send_1(exch, VFS_IN_READ, fildes, &answer); 420 420 rc = async_data_read_start(exch, (void *) buf, nbyte); 421 if (rc != EOK) { 422 vfs_exchange_end(exch); 423 424 sysarg_t rc_orig; 425 async_wait_for(req, &rc_orig); 426 427 if (rc_orig == EOK) 428 return rc; 429 else 430 return rc_orig; 431 } 432 433 vfs_exchange_end(exch); 434 async_wait_for(req, &rc); 421 422 vfs_exchange_end(exch); 423 424 if (rc == EOK) { 425 async_wait_for(req, &rc); 426 } else { 427 async_forget(req); 428 } 435 429 436 430 if (rc != EOK) … … 467 461 req = async_send_1(exch, VFS_IN_WRITE, fildes, &answer); 468 462 rc = async_data_write_start(exch, (void *) buf, nbyte); 469 if (rc != EOK) { 470 vfs_exchange_end(exch); 471 472 sysarg_t rc_orig; 473 async_wait_for(req, &rc_orig); 474 475 if (rc_orig == EOK) 476 return rc; 477 else 478 return rc_orig; 479 } 480 481 vfs_exchange_end(exch); 482 async_wait_for(req, &rc); 483 463 464 vfs_exchange_end(exch); 465 466 if (rc == EOK) { 467 async_wait_for(req, &rc); 468 } else { 469 async_forget(req); 470 } 471 484 472 if (rc != EOK) 485 473 return rc; … … 1055 1043 } 1056 1044 1057 int vfs_fd_wait(void)1058 {1059 async_exch_t *exch = vfs_exchange_begin();1060 1061 sysarg_t ret;1062 sysarg_t rc = async_req_0_1(exch, VFS_IN_WAIT_HANDLE, &ret);1063 1064 vfs_exchange_end(exch);1065 1066 if (rc == EOK)1067 return (int) ret;1068 1069 return (int) rc;1070 }1071 1072 1045 int vfs_get_mtab_list(list_t *mtab_list) 1073 1046 { … … 1172 1145 } 1173 1146 1147 int vfs_pass_handle(async_exch_t *vfs_exch, int file, async_exch_t *exch) 1148 { 1149 return async_state_change_start(exch, VFS_PASS_HANDLE, (sysarg_t)file, 0, vfs_exch); 1150 } 1151 1152 int vfs_receive_handle() 1153 { 1154 ipc_callid_t callid; 1155 if (!async_state_change_receive(&callid, NULL, NULL, NULL)) { 1156 async_answer_0(callid, EINVAL); 1157 return EINVAL; 1158 } 1159 1160 async_exch_t *vfs_exch = vfs_exchange_begin(); 1161 1162 async_state_change_finalize(callid, vfs_exch); 1163 1164 sysarg_t ret; 1165 sysarg_t rc = async_req_0_1(vfs_exch, VFS_IN_WAIT_HANDLE, &ret); 1166 1167 async_exchange_end(vfs_exch); 1168 1169 if (rc != EOK) { 1170 return rc; 1171 } 1172 return ret; 1173 } 1174 1175 int vfs_clone(int file, bool high_descriptor) 1176 { 1177 async_exch_t *vfs_exch = vfs_exchange_begin(); 1178 int rc = async_req_2_0(vfs_exch, VFS_IN_CLONE, (sysarg_t) file, (sysarg_t) high_descriptor); 1179 vfs_exchange_end(vfs_exch); 1180 return rc; 1181 } 1182 1174 1183 /** @} 1175 1184 */
Note:
See TracChangeset
for help on using the changeset viewer.