Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7171760 in mainline for uspace/lib/c/generic/task.c


Ignore:
Timestamp:
2011-08-18T12:05:00Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
b33ec43
Parents:
866e627
Message:

Rework the way how open files are passed from parent task to child.

  • Instead of passing fdi_node_t's, pass handles directly using the IPC_M_STATE_CHANGE_AUTHORIZE mechanism.
  • Remove open_node(), fd_node(), fdi_node_t.
  • Replace fopen_node() with fopen_handle().
  • Replace fnode() with fhandle().
  • The child task does not synchronize with VFS yet.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/task.c

    r866e627 r7171760  
    103103{
    104104        /* Send default files */
    105         fdi_node_t *files[4];
    106         fdi_node_t stdin_node;
    107         fdi_node_t stdout_node;
    108         fdi_node_t stderr_node;
    109        
    110         if ((stdin != NULL) && (fnode(stdin, &stdin_node) == EOK))
    111                 files[0] = &stdin_node;
     105        int *files[4];
     106        int fd_stdin;
     107        int fd_stdout;
     108        int fd_stderr;
     109       
     110        if ((stdin != NULL) && (fhandle(stdin, &fd_stdin) == EOK))
     111                files[0] = &fd_stdin;
    112112        else
    113113                files[0] = NULL;
    114114       
    115         if ((stdout != NULL) && (fnode(stdout, &stdout_node) == EOK))
    116                 files[1] = &stdout_node;
     115        if ((stdout != NULL) && (fhandle(stdout, &fd_stdout) == EOK))
     116                files[1] = &fd_stdout;
    117117        else
    118118                files[1] = NULL;
    119119       
    120         if ((stderr != NULL) && (fnode(stderr, &stderr_node) == EOK))
    121                 files[2] = &stderr_node;
     120        if ((stderr != NULL) && (fhandle(stderr, &fd_stderr) == EOK))
     121                files[2] = &fd_stderr;
    122122        else
    123123                files[2] = NULL;
     
    143143 */
    144144int task_spawnvf(task_id_t *id, const char *path, const char *const args[],
    145     fdi_node_t *const files[])
     145    int *const files[])
    146146{
    147147        /* Connect to a program loader. */
Note: See TracChangeset for help on using the changeset viewer.