Changes in uspace/lib/c/generic/loader.c [d96d9bc:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/loader.c
rd96d9bc rcde999a 52 52 * @param name Symbolic name to set on the newly created task. 53 53 * 54 * @return Pointer to the loader connection structure (should be 55 * deallocated using free() after use). 56 * 54 * @return Error code. 57 55 */ 58 56 int loader_spawn(const char *name) 59 57 { 60 return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,58 return (int) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER, 61 59 (sysarg_t) name, str_size(name)); 62 60 } … … 86 84 * @param task_id Points to a variable where the ID should be stored. 87 85 * 88 * @return Zero on success or negativeerror code.86 * @return Zero on success or an error code. 89 87 * 90 88 */ … … 96 94 ipc_call_t answer; 97 95 aid_t req = async_send_0(exch, LOADER_GET_TASKID, &answer); 98 sysarg_t rc = async_data_read_start(exch, task_id, sizeof(task_id_t));96 int rc = async_data_read_start(exch, task_id, sizeof(task_id_t)); 99 97 100 98 async_exchange_end(exch); … … 115 113 * @param ldr Loader connection structure. 116 114 * 117 * @return Zero on success or negativeerror code.115 * @return Zero on success or an error code. 118 116 * 119 117 */ … … 133 131 ipc_call_t answer; 134 132 aid_t req = async_send_0(exch, LOADER_SET_CWD, &answer); 135 sysarg_t rc = async_data_write_start(exch, cwd, len);133 int rc = async_data_write_start(exch, cwd, len); 136 134 137 135 async_exchange_end(exch); … … 153 151 * @param file Program file. 154 152 * 155 * @return Zero on success or negativeerror code.153 * @return Zero on success or an error code. 156 154 * 157 155 */ … … 163 161 aid_t req = async_send_0(exch, LOADER_SET_PROGRAM, &answer); 164 162 165 sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);163 int rc = async_data_write_start(exch, name, str_size(name) + 1); 166 164 if (rc == EOK) { 167 165 async_exch_t *vfs_exch = vfs_exchange_begin(); … … 186 184 * @param path Program path. 187 185 * 188 * @return Zero on success or negativeerror code.186 * @return Zero on success or an error code. 189 187 * 190 188 */ … … 198 196 } 199 197 200 int fd = vfs_lookup(path, 0); 201 if (fd < 0) { 202 return fd; 203 } 204 205 int rc = loader_set_program(ldr, name, fd); 198 int fd; 199 int rc = vfs_lookup(path, 0, &fd); 200 if (rc != EOK) { 201 return rc; 202 } 203 204 rc = loader_set_program(ldr, name, fd); 206 205 vfs_put(fd); 207 206 return rc; … … 218 217 * @param argv NULL-terminated array of pointers to arguments. 219 218 * 220 * @return Zero on success or negativeerror code.219 * @return Zero on success or an error code. 221 220 * 222 221 */ … … 253 252 ipc_call_t answer; 254 253 aid_t req = async_send_0(exch, LOADER_SET_ARGS, &answer); 255 sysarg_t rc = async_data_write_start(exch, (void *) arg_buf,254 int rc = async_data_write_start(exch, (void *) arg_buf, 256 255 buffer_size); 257 256 … … 274 273 * @param file The file's descriptor. 275 274 * 276 * @return Zero on success or negativeerror code.275 * @return Zero on success or an error code. 277 276 * 278 277 */ … … 284 283 aid_t req = async_send_0(exch, LOADER_ADD_INBOX, NULL); 285 284 286 sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);285 int rc = async_data_write_start(exch, name, str_size(name) + 1); 287 286 if (rc == EOK) { 288 287 rc = vfs_pass_handle(vfs_exch, file, exch); … … 308 307 * @param ldr Loader connection structure. 309 308 * 310 * @return Zero on success or negativeerror code.309 * @return Zero on success or an error code. 311 310 * 312 311 */ … … 331 330 * @param ldr Loader connection structure. 332 331 * 333 * @return Zero on success or negativeerror code.332 * @return Zero on success or an error code. 334 333 * 335 334 */ … … 357 356 * @param ldr Loader connection structure. 358 357 * 359 * @return Zero on success or negativeerror code.358 * @return Zero on success or an error code. 360 359 * 361 360 */
Note:
See TracChangeset
for help on using the changeset viewer.