00001 00006 /* 00007 * The contents of this file are subject to the Mozilla Public License 00008 * Version 1.0 (the "License"); you may not use this file except in 00009 * compliance with the License. You may obtain a copy of the License 00010 * at http://www.mozilla.org/MPL/ 00011 * 00012 * Software distributed under the License is distributed on an "AS IS" 00013 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00014 * the License for the specific language governing rights and 00015 * limitations under the License. 00016 * 00017 * The Original Code is legOS code, released October 17, 1999. 00018 * 00019 * The Initial Developer of the Original Code is Markus L. Noga. 00020 * Portions created by Markus L. Noga are Copyright (C) 1999 00021 * Markus L. Noga. All Rights Reserved. 00022 * 00023 * Contributor(s): Markus L. Noga <markus@noga.de> 00024 */ 00025 00026 #ifndef __unistd_h__ 00027 #define __unistd_h__ 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 #include <tm.h> 00034 #include <time.h> 00035 00037 // 00038 // Functions 00039 // 00041 00051 extern tid_t execi(int (*code_start) (int, char **), int argc, char **argv, 00052 priority_t priority, size_t stack_size); 00053 00054 00058 extern void exit(int code) __attribute__((noreturn)); 00059 00060 // 00062 // 00063 extern void yield(void); 00064 00071 #ifdef CONF_TM 00072 extern wakeup_t wait_event(wakeup_t(*wakeup) (wakeup_t), wakeup_t data); 00073 00074 00076 00080 extern unsigned int sleep(unsigned int sec); 00081 00087 extern unsigned int msleep(unsigned int msec); 00088 00089 #else 00090 extern inline wakeup_t wait_event(wakeup_t(*wakeup) (wakeup_t), wakeup_t data) 00091 { 00092 wakeup_t res; 00093 00094 while (!(res = wakeup(data))) 00095 /* wait */; 00096 return res; 00097 } 00098 00099 00100 // Replacement for sleep/msleep if no TM 00101 #define sleep(s) delay(1000*(s)) 00102 #define msleep(s) delay(s) 00103 #endif 00104 00108 extern void shutdown_task(tid_t tid); 00109 00114 extern void shutdown_tasks(tflags_t flags); 00115 00120 extern void kill(tid_t tid); 00121 00126 extern void killall(priority_t p); 00127 00128 #ifdef __cplusplus 00129 } 00130 #endif 00131 00132 #endif // __unistd_h__
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |