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


Ignore:
Timestamp:
2010-04-17T01:28:38Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d6bfa5
Parents:
9256ad29
Message:

sysinfo overhaul

  • cleanup (nicer data structures, use of SLAB allocator)
  • add support for storing arbitrary binary data
  • properly reimplement non-constant values (generated by functions)
  • add support for non-constant subtrees (generated by functions)
  • syscall ABI change, libc API change
  • reflect changes in user code

libc: task_spawn() can now return error code

  • reflect change in user code, print error strings after failed task_spawn()

uspace cleanup

  • more use of string and other constants
  • more use of str_error()
  • unify error reporting in init
File:
1 edited

Legend:

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

    r9256ad29 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.