Setting errno with pthreads

Alex Waugh alex at alexwaugh.com
Fri Feb 7 12:45:01 PST 2003


In message <09fe0ec14b.peter at moo.chocky.org> you wrote:

> 
> Perhaps I've missed something, but shouldn't the __set_errno macro
> in asm_des.s always set errno too?

Yes, it should. This code should have been changed when I changed the rest of
the errno switching code, but evidently I missed it. The following patch
fixes it.

Alex

Index: unixlib/source/clib/unixlib/asm_dec.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/clib/unixlib/asm_dec.s,v
retrieving revision 1.5
diff -u -r1.5 asm_dec.s
--- unixlib/source/clib/unixlib/asm_dec.s	22 Dec 2002 18:22:28 -0000	1.5
+++ unixlib/source/clib/unixlib/asm_dec.s	7 Feb 2003 20:31:14 -0000
@@ -139,32 +139,18 @@
 	MACRO
 	__set_errno	$val,$Rerrno
 	ASSERT	$val <> $Rerrno
-	[ __FEATURE_PTHREADS = 1
-	IMPORT	|__pthread_running_thread|
-	LDR	$Rerrno, =|__pthread_running_thread|
-	LDR	$Rerrno, [$Rerrno]
-	STR	$val, [$Rerrno, #__PTHREAD_ERRNO_OFFSET]
-	|
 	IMPORT	|errno|
 	LDR	$Rerrno,=|errno|
 	STR	$val,[$Rerrno]
-	]
 	MOV	$val,#-1
 	MEND
 
 	MACRO
 	__get_errno	$val,$Rerrno
 	ASSERT	$val <> $Rerrno
-	[ __FEATURE_PTHREADS = 1
-	IMPORT	|__pthread_running_thread|
-	LDR	$Rerrno, =|__pthread_running_thread|
-	LDR	$Rerrno, [$Rerrno]
-	LDR	$val, [$Rerrno, #__PTHREAD_ERRNO_OFFSET]
-	|
 	IMPORT	|errno|
 	LDR	$Rerrno,=|errno|
 	LDR	$val,[$Rerrno]
-	]
 	MEND
 
 	; NetSWI macro to call a networking (tcp/ip) swi.


-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/




More information about the gcc mailing list