Changes in uspace/srv/loader/main.c [622cdbe:0da4e41] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loader/main.c
r622cdbe r0da4e41 72 72 static pcb_t pcb; 73 73 74 /** Current working directory */75 static char *cwd = NULL;76 77 74 /** Number of arguments */ 78 75 static int argc = 0; … … 118 115 } 119 116 120 /** Receive a call setting the current working directory.121 *122 * @param rid123 * @param request124 */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 }148 117 149 118 /** Receive a call setting pathname of the program to execute. … … 344 313 elf_create_pcb(&prog_info, &pcb); 345 314 346 pcb.cwd = cwd;347 348 315 pcb.argc = argc; 349 316 pcb.argv = argv; … … 439 406 case LOADER_GET_TASKID: 440 407 ldr_get_taskid(callid, &call); 441 continue;442 case LOADER_SET_CWD:443 ldr_set_cwd(callid, &call);444 408 continue; 445 409 case LOADER_SET_PATHNAME:
Note:
See TracChangeset
for help on using the changeset viewer.