Add support for CLONE_CHILD_*TID flags.

This commit is contained in:
Ulrich Drepper 2002-11-22 00:01:03 +00:00
parent 714a17c327
commit 56c910668c

View File

@ -35,8 +35,9 @@
#define STACK FUNC+4 #define STACK FUNC+4
#define FLAGS STACK+PTR_SIZE #define FLAGS STACK+PTR_SIZE
#define ARG FLAGS+4 #define ARG FLAGS+4
#define TID ARG+PTR_SIZE #define PTID ARG+PTR_SIZE
#define TLS TID+PTR_SIZE #define TLS PTID+PTR_SIZE
#define CTID TLS+PTR_SIZE
#define __NR_clone 120 #define __NR_clone 120
#define SYS_clone 120 #define SYS_clone 120
@ -61,25 +62,29 @@ ENTRY (BP_SYM (__clone))
#endif #endif
/* Insert the argument onto the new stack. */ /* Insert the argument onto the new stack. */
subl $12,%ecx subl $16,%ecx
movl ARG(%esp),%eax /* no negative argument counts */ movl ARG(%esp),%eax /* no negative argument counts */
movl %eax,8(%ecx) movl %eax,12(%ecx)
/* Save the function pointer as the zeroth argument. /* Save the function pointer as the zeroth argument.
It will be popped off in the child in the ebx frobbing below. */ It will be popped off in the child in the ebx frobbing below. */
movl FUNC(%esp),%eax movl FUNC(%esp),%eax
movl %eax,4(%ecx) movl %eax,8(%ecx)
/* Don't leak any information. */ /* Don't leak any information. */
movl $0,4(%ecx)
movl $0,(%ecx) movl $0,(%ecx)
/* Do the system call */ /* Do the system call */
pushl %ebx pushl %ebx
pushl %esi pushl %esi
movl TLS+8(%esp),%esi pushl %edi
movl TID+8(%esp),%edx movl TLS+12(%esp),%esi
movl FLAGS+8(%esp),%ebx movl PTID+12(%esp),%edx
movl FLAGS+12(%esp),%ebx
movl CTID+12(%esp),%edi
movl $SYS_ify(clone),%eax movl $SYS_ify(clone),%eax
int $0x80 int $0x80
popl %edi
popl %esi popl %esi
popl %ebx popl %ebx