当前位置: 首页>>代码示例>>C++>>正文


C++ SCARG_P32函数代码示例

本文整理汇总了C++中SCARG_P32函数的典型用法代码示例。如果您正苦于以下问题:C++ SCARG_P32函数的具体用法?C++ SCARG_P32怎么用?C++ SCARG_P32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SCARG_P32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: linux32_sys_futex

int
linux32_sys_futex(struct lwp *l,
    const struct linux32_sys_futex_args *uap, register_t *retval)
{
	/* {
		syscallarg(linux32_intp_t) uaddr;
		syscallarg(int) op;
		syscallarg(int) val;
		syscallarg(linux32_timespecp_t) timeout;
		syscallarg(linux32_intp_t) uaddr2;
		syscallarg(int) val3;
	} */
	struct linux_sys_futex_args ua;
	struct linux32_timespec lts;
	struct timespec ts = { 0, 0 };
	int error;

	NETBSD32TOP_UAP(uaddr, int);
	NETBSD32TO64_UAP(op);
	NETBSD32TO64_UAP(val);
	NETBSD32TOP_UAP(timeout, struct linux_timespec);
	NETBSD32TOP_UAP(uaddr2, int);
	NETBSD32TO64_UAP(val3);
	if ((SCARG(uap, op) & ~LINUX_FUTEX_PRIVATE_FLAG) == LINUX_FUTEX_WAIT &&
	    SCARG_P32(uap, timeout) != NULL) {
		if ((error = copyin((void *)SCARG_P32(uap, timeout), 
		    &lts, sizeof(lts))) != 0) {
			return error;
		}
		linux32_to_native_timespec(&ts, &lts);
	}
	return linux_do_futex(l, &ua, retval, &ts);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:33,代码来源:linux32_misc.c

示例2: netbsd32___setitimer50

int
netbsd32___setitimer50(struct lwp *l, const struct netbsd32___setitimer50_args *uap, register_t *retval)
{
	/* {
		syscallarg(int) which;
		syscallarg(const netbsd32_itimervalp_t) itv;
		syscallarg(netbsd32_itimervalp_t) oitv;
	} */
	struct proc *p = l->l_proc;
	struct netbsd32_itimerval s32it, *itv32;
	int which = SCARG(uap, which);
	struct netbsd32___getitimer50_args getargs;
	struct itimerval aitv;
	int error;

	if ((u_int)which > ITIMER_PROF)
		return (EINVAL);
	itv32 = SCARG_P32(uap, itv);
	if (itv32) {
		if ((error = copyin(itv32, &s32it, sizeof(s32it))))
			return (error);
		netbsd32_to_itimerval(&s32it, &aitv);
	}
	if (SCARG_P32(uap, oitv) != 0) {
		SCARG(&getargs, which) = which;
		SCARG(&getargs, itv) = SCARG(uap, oitv);
		if ((error = netbsd32___getitimer50(l, &getargs, retval)) != 0)
			return (error);
	}
	if (itv32 == 0)
		return 0;

	return dosetitimer(p, which, &aitv);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:34,代码来源:netbsd32_time.c

示例3: linux32_sys_fstatat64

int
linux32_sys_fstatat64(struct lwp *l, const struct linux32_sys_fstatat64_args *uap, register_t *retval)
{
	/* {
		syscallarg(int) fd;
		syscallarg(netbsd32_charp) path;
		syscallarg(linux32_stat64p) sp;
		syscallarg(int) flag;
	} */
	int error, nd_flag;
	struct stat st;
	struct linux32_stat64 st32;

	if (SCARG(uap, flag) & LINUX_AT_SYMLINK_NOFOLLOW)
		nd_flag = NOFOLLOW;
	else
		nd_flag = FOLLOW;

	error = do_sys_statat(l, SCARG(uap, fd), SCARG_P32(uap, path), nd_flag, &st);
	if (error != 0)
		return error;

	bsd_to_linux32_stat64(&st, &st32);

	return copyout(&st32, SCARG_P32(uap, sp), sizeof st32);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:26,代码来源:linux32_stat.c

示例4: compat_50_netbsd32_mq_timedsend

int
compat_50_netbsd32_mq_timedsend(struct lwp *l,
    const struct compat_50_netbsd32_mq_timedsend_args *uap,
    register_t *retval)
{
	/* {
		syscallarg(mqd_t) mqdes;
		syscallarg(const netbsd32_charp) msg_ptr;
		syscallarg(netbsd32_size_t) msg_len;
		syscallarg(unsigned) msg_prio;
		syscallarg(const netbsd32_timespec50p_t) abs_timeout;
	} */
	struct timespec ts, *tsp;
	struct netbsd32_timespec50 ts32;
	int error;

	/* Get and convert time value */
	if (SCARG_P32(uap, abs_timeout)) {
		error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
		     sizeof(ts32));
		if (error)
			return error;
		netbsd32_to_timespec50(&ts32, &ts);
		tsp = &ts;
	} else {
		tsp = NULL;
	}

	return mq_send1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
	    SCARG(uap, msg_len), SCARG(uap, msg_prio), tsp);
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:31,代码来源:netbsd32_mqueue.c

示例5: compat_50_netbsd32_nanosleep

int
compat_50_netbsd32_nanosleep(struct lwp *l,
    const struct compat_50_netbsd32_nanosleep_args *uap, register_t *retval)
{
	/* {
		syscallarg(const netbsd32_timespec50p_t) rqtp;
		syscallarg(netbsd32_timespecp_t) rmtp;
	} */
	struct netbsd32_timespec50 ts32;
	struct timespec rqt, rmt;
	int error, error1;

	error = copyin(SCARG_P32(uap, rqtp), &ts32, sizeof(ts32));
	if (error)
		return (error);
	netbsd32_to_timespec50(&ts32, &rqt);

	error = nanosleep1(l, CLOCK_MONOTONIC, 0, &rqt,
	    SCARG_P32(uap, rmtp) ? &rmt : NULL);
	if (SCARG_P32(uap, rmtp) == NULL || (error != 0 && error != EINTR))
		return error;

	netbsd32_from_timespec50(&rmt, &ts32);
	error1 = copyout(&ts32, SCARG_P32(uap,rmtp), sizeof(ts32));
	return error1 ? error1 : error;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:26,代码来源:netbsd32_compat_50.c

示例6: netbsd32_mq_open

int
netbsd32_mq_open(struct lwp *l, const struct netbsd32_mq_open_args *uap,
    register_t *retval)
{
	/* {
		syscallarg(const netbsd32_charp) name;
		syscallarg(int) oflag;
		syscallarg(mode_t) mode;
		syscallarg(struct netbsd32_mq_attrp_t) attr;
	} */
	struct netbsd32_mq_attr attr32;
	struct mq_attr *attr = NULL, a;
	int error;

	if ((SCARG(uap, oflag) & O_CREAT) && SCARG_P32(uap, attr) != NULL) {
		error = copyin(SCARG_P32(uap, attr), &attr32, sizeof(attr32));
		if (error)
			return error;
		netbsd32_to_mq_attr(&attr32, &a);
		attr = &a;
	}

	return mq_handle_open(l, SCARG_P32(uap, name), SCARG(uap, oflag),
	    SCARG(uap, mode), attr, retval);
}
开发者ID:goroutines,项目名称:rumprun,代码行数:25,代码来源:netbsd32_mqueue.c

示例7: compat_20_netbsd32_statfs

int
compat_20_netbsd32_statfs(struct lwp *l, const struct compat_20_netbsd32_statfs_args *uap, register_t *retval)
{
	/* {
		syscallarg(const netbsd32_charp) path;
		syscallarg(netbsd32_statfsp_t) buf;
	} */
	struct mount *mp;
	struct statvfs *sp;
	struct netbsd32_statfs s32;
	int error;
	struct nameidata nd;

	NDINIT(&nd, LOOKUP, FOLLOW | TRYEMULROOT, UIO_USERSPACE,
	    SCARG_P32(uap, path));
	if ((error = namei(&nd)) != 0)
		return (error);
	mp = nd.ni_vp->v_mount;
	sp = &mp->mnt_stat;
	vrele(nd.ni_vp);
	if ((error = VFS_STATVFS(mp, sp)) != 0)
		return (error);
	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
	compat_20_netbsd32_from_statvfs(sp, &s32);
	return copyout(&s32, SCARG_P32(uap, buf), sizeof(s32));
}
开发者ID:Tommmster,项目名称:netbsd-avr32,代码行数:26,代码来源:netbsd32_compat_20.c

示例8: netbsd32_clock_nanosleep

int
netbsd32_clock_nanosleep(struct lwp *l, const struct netbsd32_clock_nanosleep_args *uap, register_t *retval)
{
	/* {
		clockid_t clock_id;
		int flags;
		syscallarg(const netbsd32_timespecp_t) rqtp;
		syscallarg(netbsd32_timespecp_t) rmtp;
	} */
	struct netbsd32_timespec ts32;
	struct timespec rqt, rmt;
	int error, error1;

	error = copyin(SCARG_P32(uap, rqtp), &ts32, sizeof(ts32));
	if (error)
		return (error);
	netbsd32_to_timespec(&ts32, &rqt);

	error = nanosleep1(l, SCARG(uap, clock_id), SCARG(uap, flags),
	    &rqt, SCARG_P32(uap, rmtp) ? &rmt : NULL);
	if (SCARG_P32(uap, rmtp) == NULL || (error != 0 && error != EINTR))
		return error;

	netbsd32_from_timespec(&rmt, &ts32);
	error1 = copyout(&ts32, SCARG_P32(uap, rmtp), sizeof(ts32));
	return error1 ? error1 : error;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:27,代码来源:netbsd32_time.c

示例9: compat_60_netbsd32__lwp_park

int
compat_60_netbsd32__lwp_park(struct lwp *l,
    const struct compat_60_netbsd32__lwp_park_args *uap, register_t *retval)
{
	/* {
		syscallarg(const netbsd32_timespecp) ts;
		syscallarg(lwpid_t) unpark;
		syscallarg(netbsd32_voidp) hint;
		syscallarg(netbsd32_voidp) unparkhint;
	} */
	struct timespec ts, *tsp;
	struct netbsd32_timespec ts32;
	int error;

	if (SCARG_P32(uap, ts) == NULL)
		tsp = NULL;
	else {
		error = copyin(SCARG_P32(uap, ts), &ts32, sizeof ts32);
		if (error != 0)
			return error;
		tsp = &ts;
	}

	if (SCARG(uap, unpark) != 0) {
		error = lwp_unpark(SCARG(uap, unpark),
		    SCARG_P32(uap, unparkhint));
		if (error != 0)
			return error;
	}

	return lwp_park(CLOCK_REALTIME, TIMER_ABSTIME, tsp,
	    SCARG_P32(uap, hint));
}
开发者ID:goroutines,项目名称:rumprun,代码行数:33,代码来源:netbsd32_compat_60.c

示例10: compat_50_netbsd32_ntp_gettime

int
compat_50_netbsd32_ntp_gettime(struct lwp *l, 
    const struct compat_50_netbsd32_ntp_gettime_args *uap, register_t *retval)
{
	/* {
		syscallarg(netbsd32_ntptimeval50p_t) ntvp;
	} */
	struct netbsd32_ntptimeval50 ntv32;
	struct ntptimeval ntv;
	int error = 0;

	if (SCARG_P32(uap, ntvp)) {
		ntp_gettime(&ntv);

		ntv32.time.tv_sec = (int32_t)ntv.time.tv_sec;
		ntv32.time.tv_nsec = ntv.time.tv_nsec;
		ntv32.maxerror = (netbsd32_long)ntv.maxerror;
		ntv32.esterror = (netbsd32_long)ntv.esterror;
		ntv32.tai = (netbsd32_long)ntv.tai;
		ntv32.time_state = ntv.time_state;
		error = copyout(&ntv32, SCARG_P32(uap, ntvp), sizeof(ntv32));
	}
	if (!error) {
		*retval = ntp_timestatus();
	}

	return (error);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:28,代码来源:netbsd32_time.c

示例11: netbsd32___shmctl13

int
netbsd32___shmctl13(struct lwp *l, const struct netbsd32___shmctl13_args *uap, register_t *retval)
{
	/* {
		syscallarg(int) shmid;
		syscallarg(int) cmd;
		syscallarg(netbsd32_shmid_dsp_t) buf;
	} */
	struct shmid_ds ds;
	struct netbsd32_shmid_ds ds32;
	int error, cmd;

	cmd = SCARG(uap, cmd);
	if (cmd == IPC_SET) {
		error = copyin(SCARG_P32(uap, buf), &ds32, sizeof(ds32));
		if (error)
			return error;
		netbsd32_to_shmid_ds(&ds32, &ds);
	}

	error = shmctl1(l, SCARG(uap, shmid), cmd,
	    (cmd == IPC_SET || cmd == IPC_STAT) ? &ds : NULL);

	if (error == 0 && cmd == IPC_STAT) {
		netbsd32_from_shmid_ds(&ds, &ds32);
		error = copyout(&ds32, SCARG_P32(uap, buf), sizeof(ds32));
	}

	return error;
}
开发者ID:Tommmster,项目名称:netbsd-avr32,代码行数:30,代码来源:netbsd32_ipc.c

示例12: compat_30_netbsd32_fhstatvfs1

int
compat_30_netbsd32_fhstatvfs1(struct lwp *l, const struct compat_30_netbsd32_fhstatvfs1_args *uap, register_t *retval)
{
	/* {
		syscallarg(const netbsd32_fhandlep_t) fhp;
		syscallarg(netbsd32_statvfsp_t) buf;
		syscallarg(int) flags;
	} */
	struct statvfs *sbuf;
	struct netbsd32_statvfs *s32;
	int error;

	sbuf = STATVFSBUF_GET();
	error = do_fhstatvfs(l, SCARG_P32(uap, fhp), FHANDLE_SIZE_COMPAT, sbuf,
	    SCARG(uap, flags));

	if (error != 0) {
		s32 = kmem_alloc(sizeof(*s32), KM_SLEEP);
		netbsd32_from_statvfs(sbuf, s32);
		error = copyout(s32, SCARG_P32(uap, buf), sizeof *s32);
		kmem_free(s32, sizeof(*s32));
	}
	STATVFSBUF_PUT(sbuf);

	return (error);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:26,代码来源:netbsd32_compat_30.c

示例13: compat_50_netbsd32_timer_settime

int
compat_50_netbsd32_timer_settime(struct lwp *l,
    const struct compat_50_netbsd32_timer_settime_args *uap, register_t *retval)
{
	/* {
		syscallarg(netbsd32_timer_t) timerid;
		syscallarg(int) flags;
		syscallarg(const netbsd32_itimerspec50p_t) value;
		syscallarg(netbsd32_itimerspec50p_t) ovalue;
	} */
	int error;
	struct itimerspec value, ovalue, *ovp = NULL;
	struct netbsd32_itimerspec50 its32;

	if ((error = copyin(SCARG_P32(uap, value), &its32, sizeof(its32))) != 0)
		return (error);
	netbsd32_to_timespec50(&its32.it_interval, &value.it_interval);
	netbsd32_to_timespec50(&its32.it_value, &value.it_value);

	if (SCARG_P32(uap, ovalue))
		ovp = &ovalue;

	if ((error = dotimer_settime(SCARG(uap, timerid), &value, ovp,
	    SCARG(uap, flags), l->l_proc)) != 0)
		return error;

	if (ovp) {
		netbsd32_from_timespec50(&ovp->it_interval, &its32.it_interval);
		netbsd32_from_timespec50(&ovp->it_value, &its32.it_value);
		return copyout(&its32, SCARG_P32(uap, ovalue), sizeof(its32));
	}
	return 0;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:33,代码来源:netbsd32_compat_50.c

示例14: netbsd32___mq_timedreceive50

int
netbsd32___mq_timedreceive50(struct lwp *l,
    const struct netbsd32___mq_timedreceive50_args *uap, register_t *retval)
{
	/* {
		syscallarg(mqd_t) mqdes;
		syscallarg(netbsd32_charp) msg_ptr;
		syscallarg(netbsd32_size_t) msg_len;
		syscallarg(netbsd32_uintp) msg_prio;
		syscallarg(const netbsd32_timespecp_t) abs_timeout;
	} */
	struct timespec ts, *tsp;
	struct netbsd32_timespec ts32;
	ssize_t mlen;
	int error;

	/* Get and convert time value */
	if (SCARG_P32(uap, abs_timeout)) {
		error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
		    sizeof(ts32));
		if (error)
			return error;
		netbsd32_to_timespec(&ts32, &ts);
		tsp = &ts;
	} else {
		tsp = NULL;
	}

	error = mq_recv1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
	    SCARG(uap, msg_len), SCARG_P32(uap, msg_prio), tsp, &mlen);
	if (error == 0)
		*retval = mlen;

	return error;
}
开发者ID:goroutines,项目名称:rumprun,代码行数:35,代码来源:netbsd32_mqueue.c

示例15: compat_50_netbsd32_settimeofday

int
compat_50_netbsd32_settimeofday(struct lwp *l,
    const struct compat_50_netbsd32_settimeofday_args *uap, register_t *retval)
{
	/* {
		syscallarg(const netbsd32_timeval50p_t) tv;
		syscallarg(const netbsd32_timezonep_t) tzp;
	} */
	struct netbsd32_timeval50 atv32;
	struct timeval atv;
	struct timespec ats;
	int error;
	struct proc *p = l->l_proc;

	/* Verify all parameters before changing time. */

	/*
	 * NetBSD has no kernel notion of time zone, and only an
	 * obsolete program would try to set it, so we log a warning.
	 */
	if (SCARG_P32(uap, tzp))
		printf("pid %d attempted to set the "
		    "(obsolete) kernel time zone\n", p->p_pid);

	if (SCARG_P32(uap, tv) == 0)
		return 0;

	if ((error = copyin(SCARG_P32(uap, tv), &atv32, sizeof(atv32))) != 0)
		return error;

	netbsd32_to_timeval50(&atv32, &atv);
	TIMEVAL_TO_TIMESPEC(&atv, &ats);
	return settime(p, &ats);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:34,代码来源:netbsd32_compat_50.c


注:本文中的SCARG_P32函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。