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