Class Hierarchy   Compound List   File List   Compound Members   File Members  

unistd.h File Reference

reduced UNIX standard library. More...

Functions


Detailed Description

reduced UNIX standard library.

Author(s):
Markus L. Noga <noga@inrialpes.fr>


Function Documentation

pid_t execi (int(* code_start)(void), priority_t priority, size_t stack_size)

execute a memory image.

Parameters:
code_start - start address of code to execute
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

wakeup_t tm_sleep_wakeup (wakeup_t data)

wakeup function for sleep.

Parameters:
data - time to wakeup encoded as a wakeup_t

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!

legOS-0.1.7 is released under Mozilla Public License. Original code © 1998-1999 by Markus L. Noga.