source: rtems/c/src/lib/libc/hosterr.c @ 61bd0301

4.104.114.84.95
Last change on this file since 61bd0301 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 907 bytes
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
18int host_errno( void );
19
20/*
21 *  fix_syscall_errno
22 *
23 *  copy host errno, if any to thread aware errno, if any
24 */
25
26void 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
42extern int errno;
43int host_errno(void)
44{
45  return errno;
46}
47#endif
Note: See TracBrowser for help on using the repository browser.