Import of openhackware-0.4.1
[openhackware.git] / src / libc / include / errno.h
blobf6242a5816a9ec5ccac9703912f831735cb25c36
1 /*
2 * <errno.h>
4 * Open Hack'Ware BIOS errno management
5 *
6 * Copyright (c) 2004-2005 Jocelyn Mayer
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License V2
10 * as published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #if !defined (__OHW_ERRNO_H__)
22 #define __OHW_ERRNO_H__
24 struct task {
25 int errno;
28 extern struct task cur_task;
30 void *get_current_stack (void);
32 static inline int *errno_location (void)
34 /* XXX: to fix */
35 #if 0
36 struct task *taskp;
38 taskp = get_current_stack();
40 return &taskp->errno;
41 #else
42 return &cur_task.errno;
43 #endif
46 static inline void set_errno (int errnum)
48 *(errno_location()) = errnum;
51 static inline int get_errno (void)
53 return *(errno_location());
56 #define errno get_errno()
58 enum {
59 ENOMEM,
62 #endif /* !defined (__OHW_ERRNO_H__) */