Main Page   Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

legOS/include/unistd.h File Reference

reduced UNIX standard library. More...


Functions

pid_t execi (int (*code_start) (int, char **), int argc, char **argv, priority_t priority, size_t stack_size)
execute a memory image. More...

void exit (int code) __attribute__((noreturn))
exit task, returning code. More...

void yield (void)
yield the rest of the current timeslice. More...

wakeup_t wait_event (wakeup_t(*wakeup) (wakeup_t), wakeup_t data)
suspend process until wakeup function is non-null. More...

unsigned int sleep (unsigned int sec)
delay execution allowing other tasks to run. More...

unsigned int msleep (unsigned int msec)
delay execution allowing other tasks to run. More...

void kill (pid_t pid)
kill a process. More...

void killall (priority_t p)
kill all processes with priority lower or equal than p, excluding self.


Detailed Description

reduced UNIX standard library.

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

Function Documentation

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

execute a memory image.

Parameters:
code_start   start address of code to execute
argc   first argument passed, normally number of strings in argv
argv   second argument passed, normally pointer to argument pointers.
priority   new task's priority
stack_size   stack size for new process
Returns:
-1: fail, else pid.

will return to caller in any case.

void exit (int code)

exit task, returning code.

Parameters:
code   The return code

FIXME: for now, scrap the code.

void yield (void)

yield the rest of the current timeslice.

doesn't speed up the system clock.

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

suspend process until wakeup function is non-null.

Parameters:
wakeup   the wakeup function. called in task scheduler context.
data   argument passed to wakeup function by scheduler
Returns:
return value passed on from wakeup

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.
Bugs and limitations:
interruptions not implemented.

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.
Bugs and limitations:
interruptions not implemented.

void kill (pid_t pid)

kill a process.

Parameters:
pid   must be valid process ID, or undefined behaviour will result!

void killall (priority_t p)

kill all processes with priority lower or equal than p, excluding self.

legOS-0.2.4 is released under the Mozilla Public License. Original code copyright 1998-1999 by the authors.