1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include <features.h>
- #include <sys/syscall.h>
- .text
- .global fork
- #ifdef __UCLIBC_HAS_THREADS__
- .weak fork
- #endif
- .type fork,%function
- .align 4
- fork:
- mov __NR_fork, %g1
- ta 0x10
- bcc,a 9000f
- nop
- save %sp,-96,%sp
- call __errno_location
- nop
- st %i0,[%o0]
- jmpl %i7+8,%g0
- restore %g0,-1,%o0
- 9000:
- sub %o1, 1, %o1
- retl
- and %o0, %o1, %o0
- .size fork,.-fork
- #ifdef __UCLIBC_HAS_THREADS__
- strong_alias(fork,__libc_fork)
- #endif
- libc_hidden_def(fork)
|