Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

include/unistd.h File Reference

Interface: reduced UNIX standard library. More...

#include <tm.h>
#include <time.h>

Include dependency graph for unistd.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

tid_t execi (int(*code_start)(int, char **), int argc, char **argv, priority_t priority, size_t stack_size)
void shutdown_task (tid_t tid)
void shutdown_tasks (tflags_t flags)
void kill (tid_t tid)
void killall (priority_t p)
void exit (int code) __attribute__((noreturn))
void yield (void)
 current task yields the rest of timeslice

wakeup_t wait_event (wakeup_t(*wakeup)(wakeup_t), wakeup_t data)
unsigned int sleep (unsigned int sec)
 delay execution allowing other tasks to run

unsigned int msleep (unsigned int msec)


Detailed Description

Interface: reduced UNIX standard library.

Author:
Markus L. Noga <markus@noga.de>

Definition in file unistd.h.


Function Documentation

tid_t execi int(*  code_start)(int, char **),
int  argc,
char **  argv,
priority_t  priority,
size_t  stack_size
 

start task executing (with passed paramters) called from user code

Parameters:
code_start the entry-point of the new task
argc the count of arguments passed (0 if none)
argv an array of pointers each pointing to an argument (NULL if none)
priority the priority at which to run this task
stack_size the amount of memory in bytes to allocate to this task for its call stack
Returns:
-1 if failed to start, else tid (task-id)

void exit int  code  ) 
 

exit task, returning code

Parameters:
code the exit code to return to the caller

void kill tid_t  tid  ) 
 

kill specified (tid) task

Parameters:
tid TaskId of task to be killed
Todo:
FIXME: this belongs in a different header

void killall priority_t  p  ) 
 

kill all tasks with priority less than or equal equal to p, excluding self.

Parameters:
p priority of tasks at which or below we kill tasks
Side Effects:
All tasks meeting this criteria are killed

unsigned int msleep unsigned int  msec  ) 
 

delay execution allowing other tasks to run

Parameters:
msec sleep duration in milliSeconds
Returns:
number of milliSeconds left if interrupted, else 0
Bug:
interruptions not implemented

void shutdown_task tid_t  tid  ) 
 

signal shutdown for a task

Parameters:
tid TaskId of task to be notified

void shutdown_tasks tflags_t  flags  ) 
 

signal shutdown for many tasks

Parameters:
flags indicating...
Todo:
research {flags}, then fix this documentation

unsigned int sleep unsigned int  sec  ) 
 

delay execution allowing other tasks to run

Parameters:
sec sleep duration in seconds
Returns:
number of seconds left if interrupted, else 0
Bug:
interruptions not implemented

wakeup_t wait_event wakeup_t(*  wakeup)(wakeup_t),
wakeup_t  data
 

suspend task until wakeup function returns non-null

Parameters:
wakeup the function to be called when woken up
data the wakeup_t structure to be passed to the called function
Returns:
wakeup() return value
Note:
wakeup function is called in task scheduler context

Referenced by get_msg().

void yield void   ) 
 

current task yields the rest of timeslice


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2002 by the authors.

Generated on Mon Feb 16 21:02:07 2004 for brickOS C++ by doxygen 1.3.5