Deleted Added
sdiff udiff text old ( 13545 ) new ( 15634 )
full compact
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $
37 */
38
39#if defined(SYSLIBC_RCS) && !defined(lint)
40 .text
41 .asciz "$Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $"
42#endif /* SYSLIBC_RCS and not lint */
43
44#include "SYS.h"
45
46#ifdef _THREAD_SAFE
47 /*
48 * Threaded version using __error().
49 */
50 .globl ___error
51 .type ___error,@function
52cerror:
53 pushl %eax
54#ifdef PIC
55 call PIC_PLT(___error)
56#else
57 call ___error
58#endif
59 popl %ecx
60 movl %ecx,(%eax)
61 movl $-1,%eax
62 movl $-1,%edx
63 ret
64
65#else /* _THREAD_SAFE */
66 /*
67 * Non-threaded version using global errno.
68 */
69 .globl _errno
70cerror:
71#ifdef PIC
72 PIC_PROLOGUE
73 movl PIC_GOT(_errno),%ecx
74 movl %eax,(%ecx)
75 PIC_EPILOGUE
76#else
77 movl %eax,_errno
78#endif
79 movl $-1,%eax
80 movl $-1,%edx
81 ret
82#endif /* _THREAD_SAFE */