current->comm, current->pid, (int)cmd); 
current->comm, current->pid, option); 
asmlinkage int irix_prctl(struct pt_regs *regs){	unsigned long cmd;	int error = 0, base = 0;	if (regs->regs[2] == 1000)		base = 1;	cmd = regs->regs[base + 4];	switch (cmd) {	case PR_MAXPROCS:		printk("irix_prctl[%s:%d]: Wants PR_MAXPROCS\n",		       current->comm, current->pid);		error = max_threads;		break;	case PR_ISBLOCKED: {		struct task_struct *task;		printk("irix_prctl[%s:%d]: Wants PR_ISBLOCKED\n",		       current->comm, current->pid);		read_lock(&tasklist_lock);		task = find_task_by_pid(regs->regs[base + 5]);		error = -ESRCH;		if (error)			error = (task->run_list.next != NULL);		read_unlock(&tasklist_lock);		/* Can _your_ OS find this out that fast? */		break;	}	case PR_SETSTACKSIZE: {		long value = regs->regs[base + 5];		printk("irix_prctl[%s:%d]: Wants PR_SETSTACKSIZE<%08lx>\n",		       current->comm, current->pid, (unsigned long) value);		if (value > RLIM_INFINITY)			value = RLIM_INFINITY;		if (capable(CAP_SYS_ADMIN)) {			task_lock(current->group_leader);			current->signal->rlim[RLIMIT_STACK].rlim_max =				current->signal->rlim[RLIMIT_STACK].rlim_cur = value;			task_unlock(current->group_leader);			error = value;			break;		}		task_lock(current->group_leader);		if (value > current->signal->rlim[RLIMIT_STACK].rlim_max) {			error = -EINVAL;			task_unlock(current->group_leader);			break;		}		current->signal->rlim[RLIMIT_STACK].rlim_cur = value;		task_unlock(current->group_leader);		error = value;		break;	}	case PR_GETSTACKSIZE:		printk("irix_prctl[%s:%d]: Wants PR_GETSTACKSIZE\n",		       current->comm, current->pid);		error = current->signal->rlim[RLIMIT_STACK].rlim_cur;		break;	case PR_MAXPPROCS:		printk("irix_prctl[%s:%d]: Wants PR_MAXPROCS\n",		       current->comm, current->pid);		error = 1;		break;	case PR_UNBLKONEXEC:		printk("irix_prctl[%s:%d]: Wants PR_UNBLKONEXEC\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_SETEXITSIG:		printk("irix_prctl[%s:%d]: Wants PR_SETEXITSIG\n",		       current->comm, current->pid);		/* We can probably play some game where we set the task		 * exit_code to some non-zero value when this is requested,		 * and check whether exit_code is already set in do_exit().		 */		error = -EINVAL;		break;	case PR_RESIDENT:		printk("irix_prctl[%s:%d]: Wants PR_RESIDENT\n",		       current->comm, current->pid);		error = 0; /* Compatibility indeed. */		break;	case PR_ATTACHADDR:		printk("irix_prctl[%s:%d]: Wants PR_ATTACHADDR\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_DETACHADDR:		printk("irix_prctl[%s:%d]: Wants PR_DETACHADDR\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_TERMCHILD:		printk("irix_prctl[%s:%d]: Wants PR_TERMCHILD\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_GETSHMASK:		printk("irix_prctl[%s:%d]: Wants PR_GETSHMASK\n",		       current->comm, current->pid);		error = -EINVAL; /* Until I have the sproc() stuff in. */		break;	case PR_GETNSHARE:		error = 0;       /* Until I have the sproc() stuff in. */		break;	case PR_COREPID:		printk("irix_prctl[%s:%d]: Wants PR_COREPID\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_ATTACHADDRPERM:		printk("irix_prctl[%s:%d]: Wants PR_ATTACHADDRPERM\n",		       current->comm, current->pid);		error = -EINVAL;		break;	case PR_PTHREADEXIT:		printk("irix_prctl[%s:%d]: Wants PR_PTHREADEXIT\n",		       current->comm, current->pid);		do_exit(regs->regs[base + 5]);	default:		printk("irix_prctl[%s:%d]: Non-existant opcode %d\n",		       current->comm, current->pid, (int)cmd);		error = -EINVAL;		break;	}	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/784f7b9d895893c6aa3ca471c1344a62fc29c285/sysirix.c/buggy/arch/mips/kernel/sysirix.c