| 1 | /*
|
|---|
| 2 | * SPDX-FileCopyrightText: 2006 Jakub Jermar
|
|---|
| 3 | *
|
|---|
| 4 | * SPDX-License-Identifier: BSD-3-Clause
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | /** @addtogroup libc
|
|---|
| 8 | * @{
|
|---|
| 9 | */
|
|---|
| 10 | /** @file
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 | #ifndef _LIBC_TASK_H_
|
|---|
| 14 | #define _LIBC_TASK_H_
|
|---|
| 15 |
|
|---|
| 16 | #include <async.h>
|
|---|
| 17 | #include <stdint.h>
|
|---|
| 18 | #include <stdarg.h>
|
|---|
| 19 | #include <abi/proc/task.h>
|
|---|
| 20 | #include <async.h>
|
|---|
| 21 | #include <types/task.h>
|
|---|
| 22 |
|
|---|
| 23 | typedef struct {
|
|---|
| 24 | ipc_call_t result;
|
|---|
| 25 | aid_t aid;
|
|---|
| 26 | } task_wait_t;
|
|---|
| 27 |
|
|---|
| 28 | struct _TASK;
|
|---|
| 29 | typedef struct _TASK task_t;
|
|---|
| 30 |
|
|---|
| 31 | extern task_id_t task_get_id(void);
|
|---|
| 32 | extern errno_t task_set_name(const char *);
|
|---|
| 33 | extern errno_t task_kill(task_id_t);
|
|---|
| 34 |
|
|---|
| 35 | extern errno_t task_spawnv(task_id_t *, task_wait_t *, const char *path,
|
|---|
| 36 | const char *const []);
|
|---|
| 37 | extern errno_t task_spawnv_debug(task_id_t *, task_wait_t *, const char *path,
|
|---|
| 38 | const char *const [], async_sess_t **);
|
|---|
| 39 | extern errno_t task_spawnvf(task_id_t *, task_wait_t *, const char *path,
|
|---|
| 40 | const char *const [], int, int, int);
|
|---|
| 41 | extern errno_t task_spawnvf_debug(task_id_t *, task_wait_t *, const char *path,
|
|---|
| 42 | const char *const [], int, int, int, async_sess_t **);
|
|---|
| 43 | extern errno_t task_spawn(task_id_t *, task_wait_t *, const char *path, int,
|
|---|
| 44 | va_list ap);
|
|---|
| 45 | extern errno_t task_spawnl(task_id_t *, task_wait_t *, const char *path, ...)
|
|---|
| 46 | __attribute__((sentinel));
|
|---|
| 47 |
|
|---|
| 48 | extern errno_t task_setup_wait(task_id_t, task_wait_t *);
|
|---|
| 49 | extern void task_cancel_wait(task_wait_t *);
|
|---|
| 50 | extern errno_t task_wait(task_wait_t *, task_exit_t *, int *);
|
|---|
| 51 | extern errno_t task_wait_task_id(task_id_t, task_exit_t *, int *);
|
|---|
| 52 | extern errno_t task_retval(int);
|
|---|
| 53 |
|
|---|
| 54 | #endif
|
|---|
| 55 |
|
|---|
| 56 | /** @}
|
|---|
| 57 | */
|
|---|