aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/i386/sys/cerror.S
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
committerJulian Elischer <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
commitf70177e76e605ec6e6cd5b938fa77ade5d380e87 (patch)
treea89c7f50ec371cef4418259b9dccdd31ebb2f61f /lib/libc/i386/sys/cerror.S
parent61de51cad66df0d565233915f856932159d33a4a (diff)
downloadsrc-f70177e76e605ec6e6cd5b938fa77ade5d380e87.tar.gz
src-f70177e76e605ec6e6cd5b938fa77ade5d380e87.zip
Notes
Diffstat (limited to 'lib/libc/i386/sys/cerror.S')
-rw-r--r--lib/libc/i386/sys/cerror.S28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S
index 875f6db37219..2cbb0f94ab5b 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 */