Changeset 4470e26 in mainline for uspace/lib/libc
- Timestamp:
- 2008-09-24T10:57:21Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0993087
- Parents:
- 45454e9b
- Location:
- uspace/lib/libc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/loader.c
r45454e9b r4470e26 206 206 } 207 207 208 /** Instruct loader to load the program. 209 * 210 * If this function succeeds, the program has been successfully loaded 211 * and is ready to be executed. 212 * 213 * @param ldr Loader connection structure. 214 * @return Zero on success or negative error code. 215 */ 216 int loader_load_program(loader_t *ldr) 217 { 218 int rc; 219 220 rc = async_req_0_0(ldr->phone_id, LOADER_LOAD); 221 if (rc != EOK) 222 return rc; 223 224 return EOK; 225 } 226 208 227 /** Instruct loader to execute the program. 228 * 229 * Note that this function blocks until the loader actually replies 230 * so you cannot expect this function to return if you are debugging 231 * the task and its thread is stopped. 209 232 * 210 233 * After using this function, no further operations must be performed … … 214 237 * @return Zero on success or negative error code. 215 238 */ 216 int loader_ start_program(loader_t *ldr)239 int loader_run(loader_t *ldr) 217 240 { 218 241 int rc; … … 222 245 return rc; 223 246 224 ipc_hangup(ldr->phone_id);225 247 return EOK; 226 248 } -
uspace/lib/libc/generic/task.c
r45454e9b r4470e26 64 64 int rc; 65 65 66 /* Spawn a program loader */66 /* Spawn a program loader. */ 67 67 ldr = loader_spawn(); 68 68 if (ldr == NULL) … … 74 74 goto error; 75 75 76 /* Send program pathname */76 /* Send program pathname. */ 77 77 rc = loader_set_pathname(ldr, path); 78 78 if (rc != EOK) 79 79 goto error; 80 80 81 /* Send arguments */81 /* Send arguments. */ 82 82 rc = loader_set_args(ldr, argv); 83 83 if (rc != EOK) 84 84 goto error; 85 85 86 /* Request loader to start the program */ 87 rc = loader_start_program(ldr); 86 /* Load the program. */ 87 rc = loader_load_program(ldr); 88 if (rc != EOK) 89 goto error; 90 91 /* Run it. */ 92 /* Load the program. */ 93 rc = loader_run(ldr); 88 94 if (rc != EOK) 89 95 goto error; 90 96 91 97 /* Success */ 98 99 free(ldr); 92 100 return task_id; 93 101 … … 95 103 error: 96 104 loader_abort(ldr); 105 free(ldr); 106 97 107 return 0; 98 108 } -
uspace/lib/libc/include/ipc/loader.h
r45454e9b r4470e26 43 43 LOADER_SET_PATHNAME, 44 44 LOADER_SET_ARGS, 45 LOADER_LOAD, 45 46 LOADER_RUN 46 47 } fb_request_t; -
uspace/lib/libc/include/loader/loader.h
r45454e9b r4470e26 47 47 extern int loader_set_pathname(loader_t *, const char *); 48 48 extern int loader_set_args(loader_t *, char *const []); 49 extern int loader_start_program(loader_t *); 49 extern int loader_load_program(loader_t *); 50 extern int loader_run(loader_t *); 50 51 extern void loader_abort(loader_t *); 51 52
Note:
See TracChangeset
for help on using the changeset viewer.