Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openhackware / src / libc / include / errno.h
1 /*
2  * <errno.h>
3  *
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
11  *
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.
16  *
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
20  */
21 #if !defined (__OHW_ERRNO_H__)
22 #define __OHW_ERRNO_H__
23
24 struct task {
25     int errno;
26 };
27
28 extern struct task cur_task;
29
30 void *get_current_stack (void);
31
32 static inline int *errno_location (void)
33 {
34     /* XXX: to fix */
35 #if 0
36     struct task *taskp;
37     
38     taskp = get_current_stack();
39
40     return &taskp->errno;
41 #else
42     return &cur_task.errno;
43 #endif
44 }
45
46 static inline void set_errno (int errnum)
47 {
48     *(errno_location()) = errnum;
49 }
50
51 static inline int get_errno (void)
52 {
53     return *(errno_location());
54 }
55
56 #define errno get_errno()
57
58 enum {
59     ENOMEM,
60 };
61
62 #endif /* !defined (__OHW_ERRNO_H__) */