Changeset db4d6de in mainline for uspace/srv/loader/main.c
- Timestamp:
- 2009-11-28T16:30:43Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c4702804
- Parents:
- ba8f8cb (diff), 67392fa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loader/main.c
rba8f8cb rdb4d6de 72 72 static pcb_t pcb; 73 73 74 /** Current working directory */ 75 static char *cwd = NULL; 76 74 77 /** Number of arguments */ 75 78 static int argc = 0; … … 115 118 } 116 119 120 /** Receive a call setting the current working directory. 121 * 122 * @param rid 123 * @param request 124 */ 125 static void ldr_set_cwd(ipc_callid_t rid, ipc_call_t *request) 126 { 127 ipc_callid_t callid; 128 size_t len; 129 130 if (!async_data_write_receive(&callid, &len)) { 131 ipc_answer_0(callid, EINVAL); 132 ipc_answer_0(rid, EINVAL); 133 return; 134 } 135 136 cwd = malloc(len + 1); 137 if (!cwd) { 138 ipc_answer_0(callid, ENOMEM); 139 ipc_answer_0(rid, ENOMEM); 140 return; 141 } 142 143 async_data_write_finalize(callid, cwd, len); 144 cwd[len] = '\0'; 145 146 ipc_answer_0(rid, EOK); 147 } 117 148 118 149 /** Receive a call setting pathname of the program to execute. … … 313 344 elf_create_pcb(&prog_info, &pcb); 314 345 346 pcb.cwd = cwd; 347 315 348 pcb.argc = argc; 316 349 pcb.argv = argv; … … 406 439 case LOADER_GET_TASKID: 407 440 ldr_get_taskid(callid, &call); 441 continue; 442 case LOADER_SET_CWD: 443 ldr_set_cwd(callid, &call); 408 444 continue; 409 445 case LOADER_SET_PATHNAME:
Note:
See TracChangeset
for help on using the changeset viewer.