4.104.114.84.95
Last change
on this file since 4cc631db was
4cc631db,
checked in by Joel Sherrill <joel.sherrill@…>, on 08/11/95 at 14:33:04
|
Added functions to access the errno of the native system when using the
newlib C library.
Fixed bug where length did not take into account amount added
for alignment requirements.
|
-
Property mode set to
100644
|
File size:
951 bytes
|
Rev | Line | |
---|
[4cc631db] | 1 | /* |
---|
| 2 | * Routines to access a host errno |
---|
| 3 | * |
---|
| 4 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 5 | * On-Line Applications Research Corporation (OAR). |
---|
| 6 | * All rights assigned to U.S. Government, 1994. |
---|
| 7 | * |
---|
| 8 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 9 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 10 | * notice must appear in all copies of this file and its derivatives. |
---|
| 11 | * |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #include <rtems.h> |
---|
| 15 | #include <errno.h> |
---|
| 16 | |
---|
| 17 | int host_errno(void); |
---|
| 18 | |
---|
| 19 | /* |
---|
| 20 | * copy host errno, if any to thread aware errno, if any |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | void fix_syscall_errno(void) |
---|
| 24 | { |
---|
| 25 | errno = host_errno(); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | /* |
---|
| 29 | * Get the host system errno, if any |
---|
| 30 | * When using newlib (or possibly other libc's) on top of UNIX |
---|
| 31 | * the errno returned by system calls may be unavailable due |
---|
| 32 | * to trickery of making errno thread aware. |
---|
| 33 | * This provides a kludge of getting at it. |
---|
| 34 | */ |
---|
| 35 | |
---|
| 36 | #undef errno |
---|
| 37 | extern int errno; |
---|
| 38 | int host_errno(void) |
---|
| 39 | { |
---|
| 40 | return errno; |
---|
| 41 | } |
---|
| 42 | |
---|
Note: See
TracBrowser
for help on using the repository browser.