Changes in uspace/srv/loader/main.c [79ae36dd:27b76ca] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loader/main.c
r79ae36dd r27b76ca 59 59 #include <str.h> 60 60 #include <as.h> 61 #include <elf.h> 62 #include <elf_load.h> 61 #include <elf/elf.h> 62 #include <elf/elf_load.h> 63 #include <vfs/vfs.h> 63 64 64 65 #ifdef CONFIG_RTLD … … 89 90 90 91 /** Number of preset files */ 91 static int filc = 0; 92 /** Preset files vector */ 93 static fdi_node_t **filv = NULL; 94 /** Buffer holding all preset files */ 95 static fdi_node_t *fil_buf = NULL; 92 static unsigned int filc = 0; 96 93 97 94 static elf_info_t prog_info; … … 239 236 static void ldr_set_files(ipc_callid_t rid, ipc_call_t *request) 240 237 { 241 fdi_node_t *buf; 242 size_t buf_size; 243 int rc = async_data_write_accept((void **) &buf, false, 0, 0, 244 sizeof(fdi_node_t), &buf_size); 245 246 if (rc == EOK) { 247 int count = buf_size / sizeof(fdi_node_t); 248 249 /* 250 * Allocate new filv 251 */ 252 fdi_node_t **_filv = (fdi_node_t **) calloc(count + 1, sizeof(fdi_node_t *)); 253 if (_filv == NULL) { 254 free(buf); 255 async_answer_0(rid, ENOMEM); 256 return; 238 size_t count = IPC_GET_ARG1(*request); 239 240 async_exch_t *vfs_exch = vfs_exchange_begin(); 241 242 for (filc = 0; filc < count; filc++) { 243 ipc_callid_t callid; 244 int fd; 245 246 if (!async_state_change_receive(&callid, NULL, NULL, NULL)) { 247 async_answer_0(callid, EINVAL); 248 break; 257 249 } 258 259 /* 260 * Fill the new filv with argument pointers 261 */ 262 int i; 263 for (i = 0; i < count; i++) 264 _filv[i] = &buf[i]; 265 266 _filv[count] = NULL; 267 268 /* 269 * Copy temporary data to global variables 270 */ 271 if (fil_buf != NULL) 272 free(fil_buf); 273 274 if (filv != NULL) 275 free(filv); 276 277 filc = count; 278 fil_buf = buf; 279 filv = _filv; 280 } 281 250 async_state_change_finalize(callid, vfs_exch); 251 fd = fd_wait(); 252 assert(fd == (int) filc); 253 } 254 255 vfs_exchange_end(vfs_exch); 256 282 257 async_answer_0(rid, EOK); 283 258 } … … 308 283 309 284 pcb.filc = filc; 310 pcb.filv = filv;311 285 312 286 if (prog_info.interp == NULL) { … … 348 322 349 323 /* Initialize list of loaded modules */ 350 list_initialize(&runtime_env->modules _head);351 list_append(&prog_mod.modules_link, &runtime_env->modules _head);324 list_initialize(&runtime_env->modules); 325 list_append(&prog_mod.modules_link, &runtime_env->modules); 352 326 353 327 /* Pointer to program module. Used as root of the module graph. */ … … 410 384 * to execute the loaded program). 411 385 */ 412 static void ldr_connection(ipc_callid_t iid, ipc_call_t *icall )386 static void ldr_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 413 387 { 414 388 /* Already have a connection? */
Note:
See TracChangeset
for help on using the changeset viewer.