FreeBSD/sys/fs/nfsclient/nfs_clport.c
/*
 * Check to see if the process for this owner exists. Return 1 if it doesn't
 * and 0 otherwise.
 */
Check to see if the process for this owner exists. Return 1 if it doesn't
and 0 otherwise.
Check to see if the process for this owner exists . Return 1 if it doesn ' t and 0 otherwise .
int
nfscl_procdoesntexist(u_int8_t *own)
{
	union {
		u_int32_t	lval;
		u_int8_t	cval[4];
	} tl;
	struct proc *p;
	pid_t pid;
	int ret = 0;
	tl.cval[0] = *own++;
	tl.cval[1] = *own++;
	tl.cval[2] = *own++;
	tl.cval[3] = *own++;
	pid = tl.lval;
	p = pfind_locked(pid);
	if (p == NULL)
		return (1);
	if (p->p_stats == NULL) {
		PROC_UNLOCK(p);
		return (0);
	}
	tl.cval[0] = *own++;
	tl.cval[1] = *own++;
	tl.cval[2] = *own++;
	tl.cval[3] = *own++;
	if (tl.lval != p->p_stats->p_start.tv_sec) {
		ret = 1;
	} else {
		tl.cval[0] = *own++;
		tl.cval[1] = *own++;
		tl.cval[2] = *own++;
		tl.cval[3] = *own;
		if (tl.lval != p->p_stats->p_start.tv_usec)
			ret = 1;
	}
	PROC_UNLOCK(p);
	return (ret);
}
int nfscl_procdoesntexist ( u_int8_t * own ) { union { u_int32_t lval ; u_int8_t cval [ 4 ] ; } tl ; struct proc * p ; pid_t pid ; int ret = 0 ; tl . cval [ 0 ] = * own ++ ; tl . cval [ 1 ] = * own ++ ; tl . cval [ 2 ] = * own ++ ; tl . cval [ 3 ] = * own ++ ; pid = tl . lval ; p = pfind_locked ( pid ) ; if ( p == NULL ) return ( 1 ) ; if ( p -> p_stats == NULL ) { PROC_UNLOCK ( p ) ; return ( 0 ) ; } tl . cval [ 0 ] = * own ++ ; tl . cval [ 1 ] = * own ++ ; tl . cval [ 2 ] = * own ++ ; tl . cval [ 3 ] = * own ++ ; if ( tl . lval != p -> p_stats -> p_start . tv_sec ) { ret = 1 ; } else { tl . cval [ 0 ] = * own ++ ; tl . cval [ 1 ] = * own ++ ; tl . cval [ 2 ] = * own ++ ; tl . cval [ 3 ] = * own ; if ( tl . lval != p -> p_stats -> p_start . tv_usec ) ret = 1 ; } PROC_UNLOCK ( p ) ; return ( ret ) ; }
Check to see if the process for this owner exists.
Check to see if the process for this owner exists .