1 /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Alexandre Oliva <aoliva@redhat.com>.
5 Based on ../i386/sysdep.S.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
24 #include <bits/errno.h>
26 .globl C_SYMBOL_NAME(errno)
35 #if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
36 /* We translate the system's EWOULDBLOCK error into EAGAIN.
37 The GNU C library always defines EWOULDBLOCK==EAGAIN.
38 EWOULDBLOCK_sys is the original number. */
39 cmp EWOULDBLOCK_sys,d0 /* Is it the old EWOULDBLOCK? */
40 bne .Lnotb /* Branch if not. */
41 mov EAGAIN,d0 /* Yes; translate it to EAGAIN. */
45 # ifndef _LIBC_REENTRANT
46 mov d0,(C_SYMBOL_NAME (errno))
51 call __errno_location,[],0
57 # error "This shouldn't be assembled for PIC"
63 #undef __syscall_error