source: rtems/c/src/exec/libcsupport/src/hosterr.c @ 98e4ebf5

4.104.114.84.95
Last change on this file since 98e4ebf5 was 98e4ebf5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/97 at 15:45:54

Fixed typo in the pointer to the license terms.

  • Property mode set to 100644
File size: 877 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 be
9 *  found in 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.