summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/vfork.S
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-06-10 18:25:35 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-06-10 18:25:35 +0000
commit569b0e03fb08ea519434d26ee77aeb3a9cdeedf3 (patch)
treece7bae583cdc2d0d15ac3f64f5f4d8ac8c13c2d3 /libc/sysdeps/linux/arm/vfork.S
parent79cdbec85c2c0154c8d5c6abeedee2f088300e0d (diff)
Remove TEXTREL relocations for ARM.
Hide __syscall_error from outside libc. From Peter Mazinger.
Diffstat (limited to 'libc/sysdeps/linux/arm/vfork.S')
-rw-r--r--libc/sysdeps/linux/arm/vfork.S63
1 files changed, 24 insertions, 39 deletions
diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S
index 9d18945d1..eecf56b8c 100644
--- a/libc/sysdeps/linux/arm/vfork.S
+++ b/libc/sysdeps/linux/arm/vfork.S
@@ -20,52 +20,37 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <asm/errno.h>
+#define _ERRNO_H
+#include <bits/errno.h>
#include <sys/syscall.h>
-
-
- .text
- .global vfork;
- .type vfork,%function
- .align 4; \
-
-
-
+#ifdef __NR_fork
+ .text
+ .global vfork
+ .type vfork,%function
+ .align 4
vfork:
#ifdef __NR_vfork
- swi __NR_vfork
- cmn r0, #4096
- movcc pc, lr
-
- /* Check if vfork even exists. */
- ldr r1, =-ENOSYS
- teq r0, r1
- bne __syscall_error
+ swi __NR_vfork
+ cmn r0, #4096
+ movcc pc, lr
+
+ /* Check if vfork even exists. */
+ ldr r1, =-ENOSYS
+ teq r0, r1
+ bne __error
#endif
- /* If we don't have vfork, use fork. */
- swi __NR_fork
- cmn r0, #4096
+ /* If we don't have vfork, use fork. */
+ swi __NR_fork
+ cmn r0, #4096
- /* Syscal worked. Return to child/parent */
- movcc pc, lr
-
-__syscall_error:
-
- /* Looks like the syscall choked -- set errno */
- ldr r3, .L4
- /* Calculate the - of the syscall result, in case we need it */
- rsb r2, r0, $0
-
- /* errno = -result */
- str r2, [r9,r3]
-
- /* return -1 */
- mvn r0, $0
- mov pc, lr
-
-.L4: .word errno
+ /* Syscal worked. Return to child/parent */
+ movcc pc, lr
+__error:
+ b __syscall_error
+ .size vfork,.-vfork
+#endif