OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / arm / vfork.S
1 /* vi: set sw=4 ts=4: */
2 /* vfork for uClibc
3  *
4  * Copyright (C) 2000 by Lineo, inc. and Erik Andersen
5  * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
6  * Written by Erik Andersen <andersen@uclibc.org>
7  *
8  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9  */
10
11 #include <features.h>
12
13 #define _ERRNO_H
14 #include <bits/errno.h>
15 #include <sys/syscall.h>
16
17 #ifdef __NR_fork
18 .text
19 .global vfork
20 .type   vfork,%function
21 .align 4
22
23 vfork:
24
25 #ifdef __NR_vfork
26         swi     __NR_vfork
27         cmn     r0, #4096
28         movcc   pc, lr
29
30         /* Check if vfork even exists.  */
31         ldr     r1, =-ENOSYS
32         teq     r0, r1
33         bne     __error
34 #endif
35
36         /* If we don't have vfork, use fork.  */
37         swi     __NR_fork
38         cmn     r0, #4096
39
40         /* Syscall worked.  Return to child/parent */
41         movcc   pc, lr
42
43 __error:
44         b       __syscall_error
45
46 .size vfork,.-vfork
47 libc_hidden_def(vfork)
48 #endif