if (! current->files->fd[fd] || ! current->files->fd[fd]->f_dentry || ! (ino = current->files->fd[fd]->f_dentry->d_inode) || 
fdt = files_fdtable(current->files); if (! fdt->fd[fd] || ! fdt->fd[fd]->f_dentry || ! (ino = fdt->fd[fd]->f_dentry->d_inode) || 
static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg){	struct inode *ino;	/* I wonder which of these tests are superfluous... --patrik */	spin_lock(&current->files->file_lock);	if (! current->files->fd[fd] ||	    ! current->files->fd[fd]->f_dentry ||	    ! (ino = current->files->fd[fd]->f_dentry->d_inode) ||	    ! S_ISSOCK(ino->i_mode)) {		spin_unlock(&current->files->file_lock);		return TBADF;	}	spin_unlock(&current->files->file_lock);		switch (cmd & 0xff) {	case 109: /* SI_SOCKPARAMS */	{		struct solaris_si_sockparams si;		if (copy_from_user (&si, A(arg), sizeof(si)))			return (EFAULT << 8) | TSYSERR;		/* Should we modify socket ino->socket_i.ops and type? */		return 0;	}	case 110: /* SI_GETUDATA */	{		int etsdusize, servtype;		struct solaris_si_udata __user *p = A(arg);		switch (SOCKET_I(ino)->type) {		case SOCK_STREAM:			etsdusize = 1;			servtype = 2;			break;		default:			etsdusize = -2;			servtype = 3;			break;		}		if (put_user(16384, &p->tidusize) ||		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||		    __put_user(-1, &p->optsize) ||		    __put_user(etsdusize, &p->etsdusize) ||		    __put_user(servtype, &p->servtype) ||		    __put_user(0, &p->so_state) ||		    __put_user(0, &p->so_options) ||		    __put_user(16384, &p->tsdusize) ||		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_family) ||		    __put_user(SOCKET_I(ino)->type, &p->sockparams.sp_type) ||		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_protocol))			return (EFAULT << 8) | TSYSERR;		return 0;	}	case 101: /* O_SI_GETUDATA */	{		int etsdusize, servtype;		struct solaris_o_si_udata __user *p = A(arg);		switch (SOCKET_I(ino)->type) {		case SOCK_STREAM:			etsdusize = 1;			servtype = 2;			break;		default:			etsdusize = -2;			servtype = 3;			break;		}		if (put_user(16384, &p->tidusize) ||		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||		    __put_user(-1, &p->optsize) ||		    __put_user(etsdusize, &p->etsdusize) ||		    __put_user(servtype, &p->servtype) ||		    __put_user(0, &p->so_state) ||		    __put_user(0, &p->so_options) ||		    __put_user(16384, &p->tsdusize))			return (EFAULT << 8) | TSYSERR;		return 0;	}	case 102: /* SI_SHUTDOWN */	case 103: /* SI_LISTEN */	case 104: /* SI_SETMYNAME */	case 105: /* SI_SETPEERNAME */	case 106: /* SI_GETINTRANSIT */	case 107: /* SI_TCL_LINK */	case 108: /* SI_TCL_UNLINK */		;	}	return TNOTSUPPORT;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/badf16621c1f9d1ac753be056fce11b43d6e0be5/ioctl.c/clean/arch/sparc64/solaris/ioctl.c