4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * Routines to access a host errno |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.OARcorp.com/rtems/license.html. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #include <rtems.h> |
---|
15 | #if defined(RTEMS_UNIX) |
---|
16 | #include <errno.h> |
---|
17 | |
---|
18 | int host_errno( void ); |
---|
19 | |
---|
20 | /* |
---|
21 | * fix_syscall_errno |
---|
22 | * |
---|
23 | * copy host errno, if any to thread aware errno, if any |
---|
24 | */ |
---|
25 | |
---|
26 | void fix_syscall_errno( void ) |
---|
27 | { |
---|
28 | errno = host_errno(); |
---|
29 | } |
---|
30 | |
---|
31 | /* |
---|
32 | * host_errno |
---|
33 | * |
---|
34 | * Get the host system errno, if any |
---|
35 | * When using newlib (or possibly other libc's) on top of UNIX |
---|
36 | * the errno returned by system calls may be unavailable due |
---|
37 | * to trickery of making errno thread aware. |
---|
38 | * This provides a kludge of getting at it. |
---|
39 | */ |
---|
40 | |
---|
41 | #undef errno |
---|
42 | extern int errno; |
---|
43 | int host_errno(void) |
---|
44 | { |
---|
45 | return errno; |
---|
46 | } |
---|
47 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.