Changes in uspace/lib/c/generic/loader.c [cde999a:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/loader.c
rcde999a rb7fd2a0 54 54 * @return Error code. 55 55 */ 56 int loader_spawn(const char *name)57 { 58 return ( int) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,56 errno_t loader_spawn(const char *name) 57 { 58 return (errno_t) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER, 59 59 (sysarg_t) name, str_size(name)); 60 60 } … … 87 87 * 88 88 */ 89 int loader_get_task_id(loader_t *ldr, task_id_t *task_id)89 errno_t loader_get_task_id(loader_t *ldr, task_id_t *task_id) 90 90 { 91 91 /* Get task ID. */ … … 94 94 ipc_call_t answer; 95 95 aid_t req = async_send_0(exch, LOADER_GET_TASKID, &answer); 96 int rc = async_data_read_start(exch, task_id, sizeof(task_id_t));97 98 async_exchange_end(exch); 99 100 if (rc != EOK) { 101 async_forget(req); 102 return ( int) rc;96 errno_t rc = async_data_read_start(exch, task_id, sizeof(task_id_t)); 97 98 async_exchange_end(exch); 99 100 if (rc != EOK) { 101 async_forget(req); 102 return (errno_t) rc; 103 103 } 104 104 105 105 async_wait_for(req, &rc); 106 return ( int) rc;106 return (errno_t) rc; 107 107 } 108 108 … … 116 116 * 117 117 */ 118 int loader_set_cwd(loader_t *ldr)118 errno_t loader_set_cwd(loader_t *ldr) 119 119 { 120 120 char *cwd = (char *) malloc(MAX_PATH_LEN + 1); … … 131 131 ipc_call_t answer; 132 132 aid_t req = async_send_0(exch, LOADER_SET_CWD, &answer); 133 int rc = async_data_write_start(exch, cwd, len);133 errno_t rc = async_data_write_start(exch, cwd, len); 134 134 135 135 async_exchange_end(exch); … … 138 138 if (rc != EOK) { 139 139 async_forget(req); 140 return ( int) rc;140 return (errno_t) rc; 141 141 } 142 142 143 143 async_wait_for(req, &rc); 144 return ( int) rc;144 return (errno_t) rc; 145 145 } 146 146 … … 154 154 * 155 155 */ 156 int loader_set_program(loader_t *ldr, const char *name, int file)156 errno_t loader_set_program(loader_t *ldr, const char *name, int file) 157 157 { 158 158 async_exch_t *exch = async_exchange_begin(ldr->sess); … … 161 161 aid_t req = async_send_0(exch, LOADER_SET_PROGRAM, &answer); 162 162 163 int rc = async_data_write_start(exch, name, str_size(name) + 1);163 errno_t rc = async_data_write_start(exch, name, str_size(name) + 1); 164 164 if (rc == EOK) { 165 165 async_exch_t *vfs_exch = vfs_exchange_begin(); … … 172 172 if (rc != EOK) { 173 173 async_forget(req); 174 return ( int) rc;174 return (errno_t) rc; 175 175 } 176 176 177 177 async_wait_for(req, &rc); 178 return ( int) rc;178 return (errno_t) rc; 179 179 } 180 180 … … 187 187 * 188 188 */ 189 int loader_set_program_path(loader_t *ldr, const char *path)189 errno_t loader_set_program_path(loader_t *ldr, const char *path) 190 190 { 191 191 const char *name = str_rchr(path, '/'); … … 197 197 198 198 int fd; 199 int rc = vfs_lookup(path, 0, &fd);199 errno_t rc = vfs_lookup(path, 0, &fd); 200 200 if (rc != EOK) { 201 201 return rc; … … 220 220 * 221 221 */ 222 int loader_set_args(loader_t *ldr, const char *const argv[])222 errno_t loader_set_args(loader_t *ldr, const char *const argv[]) 223 223 { 224 224 /* … … 252 252 ipc_call_t answer; 253 253 aid_t req = async_send_0(exch, LOADER_SET_ARGS, &answer); 254 int rc = async_data_write_start(exch, (void *) arg_buf,254 errno_t rc = async_data_write_start(exch, (void *) arg_buf, 255 255 buffer_size); 256 256 … … 260 260 if (rc != EOK) { 261 261 async_forget(req); 262 return ( int) rc;262 return (errno_t) rc; 263 263 } 264 264 265 265 async_wait_for(req, &rc); 266 return ( int) rc;266 return (errno_t) rc; 267 267 } 268 268 … … 276 276 * 277 277 */ 278 int loader_add_inbox(loader_t *ldr, const char *name, int file)278 errno_t loader_add_inbox(loader_t *ldr, const char *name, int file) 279 279 { 280 280 async_exch_t *exch = async_exchange_begin(ldr->sess); … … 283 283 aid_t req = async_send_0(exch, LOADER_ADD_INBOX, NULL); 284 284 285 int rc = async_data_write_start(exch, name, str_size(name) + 1);285 errno_t rc = async_data_write_start(exch, name, str_size(name) + 1); 286 286 if (rc == EOK) { 287 287 rc = vfs_pass_handle(vfs_exch, file, exch); … … 297 297 } 298 298 299 return ( int) rc;299 return (errno_t) rc; 300 300 } 301 301 … … 310 310 * 311 311 */ 312 int loader_load_program(loader_t *ldr)313 { 314 async_exch_t *exch = async_exchange_begin(ldr->sess); 315 int rc = async_req_0_0(exch, LOADER_LOAD);312 errno_t loader_load_program(loader_t *ldr) 313 { 314 async_exch_t *exch = async_exchange_begin(ldr->sess); 315 errno_t rc = async_req_0_0(exch, LOADER_LOAD); 316 316 async_exchange_end(exch); 317 317 … … 333 333 * 334 334 */ 335 int loader_run(loader_t *ldr)336 { 337 async_exch_t *exch = async_exchange_begin(ldr->sess); 338 int rc = async_req_0_0(exch, LOADER_RUN);335 errno_t loader_run(loader_t *ldr) 336 { 337 async_exch_t *exch = async_exchange_begin(ldr->sess); 338 errno_t rc = async_req_0_0(exch, LOADER_RUN); 339 339 async_exchange_end(exch); 340 340
Note:
See TracChangeset
for help on using the changeset viewer.