Ignore:
File:
1 edited

Legend:

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

    r63f8966 rd9fae235  
    7070 * loader API.
    7171 *
    72  * @param path pathname of the binary to execute
    73  * @param argv command-line arguments
     72 * @param path Pathname of the binary to execute.
     73 * @param argv Command-line arguments.
     74 * @param err  If not NULL, the error value is stored here.
    7475 *
    7576 * @return ID of the newly created task or zero on error.
    7677 *
    7778 */
    78 task_id_t task_spawn(const char *path, const char *const args[])
     79task_id_t task_spawn(const char *path, const char *const args[], int *err)
    7980{
    8081        /* Connect to a program loader. */
    8182        loader_t *ldr = loader_connect();
    82         if (ldr == NULL)
     83        if (ldr == NULL) {
     84                if (err != NULL)
     85                        *err = EREFUSED;
     86               
    8387                return 0;
     88        }
    8489       
    8590        /* Get task ID. */
     
    143148        /* Success */
    144149        free(ldr);
     150       
     151        if (err != NULL)
     152                *err = EOK;
     153       
    145154        return task_id;
    146155       
     
    149158        loader_abort(ldr);
    150159        free(ldr);
     160       
     161        if (err != NULL)
     162                *err = rc;
    151163       
    152164        return 0;
Note: See TracChangeset for help on using the changeset viewer.