source: rtems/c/src/lib/libc/hosterr.c @ 3473f605

4.104.114.84.95
Last change on this file since 3473f605 was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

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