OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libc/] [hosterr.c] - Blame information for rev 666

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: hosterr.c,v 1.2 2001-09-27 12:01:15 chris Exp $
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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.