diff options
author | julian <julian@FreeBSD.org> | 1996-01-22 00:02:33 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-01-22 00:02:33 +0000 |
commit | 619b731f5bb5e09dcf1eaf1fbd96383ca64398fd (patch) | |
tree | a89c7f50ec371cef4418259b9dccdd31ebb2f61f /lib/libc/i386/sys/cerror.S | |
parent | 663b14fb2f3198fb0bfb62ae16b6b56c2a4dd055 (diff) | |
download | FreeBSD-src-619b731f5bb5e09dcf1eaf1fbd96383ca64398fd.zip FreeBSD-src-619b731f5bb5e09dcf1eaf1fbd96383ca64398fd.tar.gz |
Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)
changes for threadsafe operations
Diffstat (limited to 'lib/libc/i386/sys/cerror.S')
-rw-r--r-- | lib/libc/i386/sys/cerror.S | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S index 875f6db..2cbb0f9 100644 --- a/lib/libc/i386/sys/cerror.S +++ b/lib/libc/i386/sys/cerror.S @@ -33,16 +33,39 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cerror.S,v 1.2 1994/08/13 14:00:26 davidg Exp $ + * $Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $ */ #if defined(SYSLIBC_RCS) && !defined(lint) .text - .asciz "$Id$" + .asciz "$Id: cerror.S,v 1.3 1995/01/23 01:29:43 davidg Exp $" #endif /* SYSLIBC_RCS and not lint */ #include "SYS.h" +#ifdef _THREAD_SAFE + /* + * Threaded version using __error(). + */ + .globl ___error + .type ___error,@function +cerror: + pushl %eax +#ifdef PIC + call PIC_PLT(___error) +#else + call ___error +#endif + popl %ecx + movl %ecx,(%eax) + movl $-1,%eax + movl $-1,%edx + ret + +#else /* _THREAD_SAFE */ + /* + * Non-threaded version using global errno. + */ .globl _errno cerror: #ifdef PIC @@ -56,3 +79,4 @@ cerror: movl $-1,%eax movl $-1,%edx ret +#endif /* _THREAD_SAFE */ |