int pid, syscall, n, status, count=0; 
int pid, n, status, count=0; 
static void __init check_sysemu(void){	void *stack;	int pid, syscall, n, status, count=0;	printk("Checking syscall emulation patch for ptrace...");	sysemu_supported = 0;	pid = start_ptraced_child(&stack);	if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)		goto fail;	CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));	if (n < 0)		panic("check_sysemu : wait failed, errno = %d", errno);	if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))		panic("check_sysemu : expected SIGTRAP, "		      "got status = %d", status);	n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,		   os_getpid());	if(n < 0)		panic("check_sysemu : failed to modify system "		      "call return, errno = %d", errno);	if (stop_ptraced_child(pid, stack, 0, 0) < 0)		goto fail_stopped;	sysemu_supported = 1;	printk("OK\n");	set_using_sysemu(!force_sysemu_disabled);	printk("Checking advanced syscall emulation patch for ptrace...");	pid = start_ptraced_child(&stack);	while(1){		count++;		if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)			goto fail;		CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));		if(n < 0)			panic("check_ptrace : wait failed, errno = %d", errno);		if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))			panic("check_ptrace : expected (SIGTRAP|SYSCALL_TRAP), "			      "got status = %d", status);		syscall = ptrace(PTRACE_PEEKUSR, pid, PT_SYSCALL_NR_OFFSET,				 0);		if(syscall == __NR_getpid){			if (!count)				panic("check_ptrace : SYSEMU_SINGLESTEP doesn't singlestep");			n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,				   os_getpid());			if(n < 0)				panic("check_sysemu : failed to modify system "				      "call return, errno = %d", errno);			break;		}	}	if (stop_ptraced_child(pid, stack, 0, 0) < 0)		goto fail_stopped;	sysemu_supported = 2;	printk("OK\n");	if ( !force_sysemu_disabled )		set_using_sysemu(sysemu_supported);	return;fail:	stop_ptraced_child(pid, stack, 1, 0);fail_stopped:	printk("missing\n");}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f9dfefe423a7633d81310c7b06c5566c74f9167b/start_up.c/clean/arch/um/os-Linux/start_up.c