• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ put_compat_timespec函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: put_compat_itimerspec

int put_compat_itimerspec(struct compat_itimerspec __user *dst,
			  const struct itimerspec *src)
{
	if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
	    put_compat_timespec(&src->it_value, &dst->it_value))
		return -EFAULT;
	return 0;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:8,代码来源:compat.c


示例2: compat_sys_recvmmsg

asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
				    unsigned int vlen, unsigned int flags,
				    struct compat_timespec __user *timeout)
{
	int datagrams;
	struct timespec ktspec;

	if (COMPAT_USE_64BIT_TIME)
		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
				      flags | MSG_CMSG_COMPAT,
				      (struct timespec *) timeout);

	if (timeout == NULL)
		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
				      flags | MSG_CMSG_COMPAT, NULL);

	if (get_compat_timespec(&ktspec, timeout))
		return -EFAULT;

	datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
				   flags | MSG_CMSG_COMPAT, &ktspec);
	if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
		datagrams = -EFAULT;

	return datagrams;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:26,代码来源:compat.c


示例3: compat_put_timespec

int compat_put_timespec(const struct timespec *ts, void __user *uts)
{
	if (COMPAT_USE_64BIT_TIME)
		return copy_to_user(uts, ts, sizeof *ts) ? -EFAULT : 0;
	else
		return put_compat_timespec(ts, uts);
}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:7,代码来源:compat.c


示例4: compat_sys_nanosleep

asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
				     struct compat_timespec __user *rmtp)
{
	struct timespec tu, rmt;
	mm_segment_t oldfs;
	long ret;

	if (get_compat_timespec(&tu, rqtp))
		return -EFAULT;

	if (!timespec_valid(&tu))
		return -EINVAL;

	oldfs = get_fs();
	set_fs(KERNEL_DS);
	ret = hrtimer_nanosleep(&tu,
				rmtp ? (struct timespec __user *)&rmt : NULL,
				HRTIMER_MODE_REL, CLOCK_MONOTONIC);
	set_fs(oldfs);

	if (ret) {
		struct restart_block *restart
			= &current_thread_info()->restart_block;

		restart->fn = compat_nanosleep_restart;
		restart->nanosleep.compat_rmtp = rmtp;

		if (rmtp && put_compat_timespec(&rmt, rmtp))
			return -EFAULT;
	}

	return ret;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:33,代码来源:compat.c


示例5: compat_sys_nanosleep

asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
                                     struct compat_timespec __user *rmtp)
{
    struct timespec t;
    struct restart_block *restart;
    unsigned long expire;

    if (get_compat_timespec(&t, rqtp))
        return -EFAULT;

    if ((t.tv_nsec >= 1000000000L) || (t.tv_nsec < 0) || (t.tv_sec < 0))
        return -EINVAL;

    expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
    expire = schedule_timeout_interruptible(expire);
    if (expire == 0)
        return 0;

    if (rmtp) {
        jiffies_to_timespec(expire, &t);
        if (put_compat_timespec(&t, rmtp))
            return -EFAULT;
    }
    restart = &current_thread_info()->restart_block;
    restart->fn = compat_nanosleep_restart;
    restart->arg0 = jiffies + expire;
    restart->arg1 = (unsigned long) rmtp;
    return -ERESTART_RESTARTBLOCK;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:29,代码来源:compat.c


示例6: compat_put_v4l2_event_data

long compat_put_v4l2_event_data(struct v4l2_event __user *pdata, struct v4l2_event32 __user *pdata32)
{
	long ret = 0;
    compat_uint_t type;
    compat_uint_t pending;
    compat_uint_t sequence;
    struct timespec		timestamp;
    compat_uint_t id;

	if (!access_ok(VERIFY_WRITE, pdata32, sizeof(struct v4l2_event32)))
	    return -EFAULT;

    ret  = get_user(type, &pdata->type);
	ret |= put_user(type, &pdata32->type);
	ret |= copy_in_user(&pdata32->u, &pdata->u, sizeof(pdata->u));
    ret |= get_user(pending, &pdata->pending);
	ret |= put_user(pending, &pdata32->pending);
    ret |= get_user(sequence, &pdata->sequence);
	ret |= put_user(sequence, &pdata32->sequence);
    /* ret |= get_compat_timespec(&timestamp, &pdata->timestamp); */
    ret |= copy_from_user(&timestamp, &pdata->timestamp, sizeof(timestamp));
	ret |= put_compat_timespec(&timestamp, &pdata32->timestamp);
    ret |= get_user(id, &pdata->id);
	ret |= put_user(id, &pdata32->id);
	ret |= copy_in_user(pdata32->reserved, pdata->reserved, 8 * sizeof(__u32));
	return ret;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:27,代码来源:hwcam_compat32.c


示例7: sys32_sched_rr_get_interval

asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
	struct compat_timespec __user *interval)
{
	struct timespec t;
	int ret;

	KERNEL_SYSCALL(ret, sys_sched_rr_get_interval, pid, (struct timespec __user *)&t);
	if (put_compat_timespec(&t, interval))
		return -EFAULT;
	return ret;
}
开发者ID:dduval,项目名称:kernel-rhel5,代码行数:11,代码来源:sys_parisc32.c


示例8: compat_put_v4l2_event_data

long compat_put_v4l2_event_data(struct v4l2_event *kp, struct v4l2_event32 __user *up)
{
	long ret = 0;
	ret  = put_user(kp->type, &up->type);
	ret |= copy_in_user(&up->u, &kp->u, sizeof(kp->u));
	ret |= put_user(kp->pending, &up->pending);
	ret |= put_user(kp->sequence, &up->sequence);
	ret |= put_compat_timespec(&kp->timestamp, &up->timestamp);
	ret |= put_user(kp->id, &up->id);
	ret |= copy_in_user(up->reserved, kp->reserved, 8 * sizeof(__u32));
	return ret;
}
开发者ID:magnusjjj,项目名称:android_kernel_huawei_rle,代码行数:12,代码来源:hwcam_compat32.c


示例9: compat_sys_sched_rr_get_interval

asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval)
{
	struct timespec t;
	int ret;
	mm_segment_t old_fs = get_fs ();
	
	set_fs (KERNEL_DS);
	ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t);
	set_fs (old_fs);
	if (put_compat_timespec(&t, interval))
		return -EFAULT;
	return ret;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:13,代码来源:sys_sparc32.c


示例10: put_v4l2_event32

static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *up)
{
	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_event32)) ||
		put_user(kp->type, &up->type) ||
		copy_to_user(&up->u, &kp->u, sizeof(kp->u)) ||
		put_user(kp->pending, &up->pending) ||
		put_user(kp->sequence, &up->sequence) ||
		put_compat_timespec(&kp->timestamp, &up->timestamp) ||
		put_user(kp->id, &up->id) ||
		copy_to_user(up->reserved, kp->reserved, 8 * sizeof(__u32)))
			return -EFAULT;
	return 0;
}
开发者ID:beam,项目名称:linux-tbs-drivers,代码行数:13,代码来源:v4l2-compat-ioctl32.c


示例11: compat_sys_sched_rr_get_interval

/* Note: it is necessary to treat pid as an unsigned int, 
 * with the corresponding cast to a signed int to insure that the 
 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
 * and the register representation of a signed int (msr in 64-bit mode) is performed.
 */
asmlinkage long compat_sys_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval)
{
	struct timespec t;
	int ret;
	mm_segment_t old_fs = get_fs ();

	/* The __user pointer cast is valid because of the set_fs() */
	set_fs (KERNEL_DS);
	ret = sys_sched_rr_get_interval((int)pid, (struct timespec __user *) &t);
	set_fs (old_fs);
	if (put_compat_timespec(&t, interval))
		return -EFAULT;
	return ret;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:19,代码来源:sys_ppc32.c


示例12: sis33_put_compat_acq_list

static int sis33_put_compat_acq_list(struct sis33_compat_acq_list __user *compat_list,
				struct sis33_acq_list __user *list)
{
	struct sis33_compat_acq __user *compat_acqs;
	struct timeval ktime;
	struct timespec ts;
	compat_uptr_t uptr;
	u32 n_acqs;
	u32 uint;
	int err;
	int i;

	if (!access_ok(VERIFY_READ, list, sizeof(*list)) ||
	    !access_ok(VERIFY_WRITE, compat_list, sizeof(*compat_list)))
		return -EFAULT;

	err = 0;
	err |= __get_user(uint, &list->segment);
	err |= __put_user(uint, &compat_list->segment);
	err |= __get_user(uint, &list->channel);
	err |= __put_user(uint, &compat_list->channel);
	err |= __get_user(uint, &list->n_acqs);
	err |= __put_user(uint, &compat_list->n_acqs);
	n_acqs = uint;
	err |= __get_user(uint, &list->flags);
	err |= __put_user(uint, &compat_list->flags);
	err |= copy_from_user(&ts, &list->timeout, sizeof(ts));
	err |= put_compat_timespec(&ts, &compat_list->timeout);
	err |= __get_user(ktime.tv_sec, &list->endtime.tv_sec);
	err |= __put_user(ktime.tv_sec, &compat_list->endtime.tv_sec);
	err |= __get_user(ktime.tv_usec, &list->endtime.tv_usec);
	err |= __put_user(ktime.tv_usec, &compat_list->endtime.tv_usec);
	err |= __get_user(uptr, &compat_list->acqs);
	compat_acqs = compat_ptr(uptr);
	if (err)
		return -EFAULT;

	for (i = 0; i < n_acqs; i++) {
		err = sis33_put_compat_acq(&compat_acqs[i], &list->acqs[i]);
		if (err)
			return err;
	}
	return 0;
}
开发者ID:bradomyn,项目名称:coht,代码行数:44,代码来源:sis33_compat_ioctl.c


示例13: compat_nanosleep_restart

static long compat_nanosleep_restart(struct restart_block *restart)
{
	struct compat_timespec __user *rmtp;
	struct timespec rmt;
	mm_segment_t oldfs;
	long ret;

	restart->nanosleep.rmtp = (struct timespec __user *) &rmt;
	oldfs = get_fs();
	set_fs(KERNEL_DS);
	ret = hrtimer_nanosleep_restart(restart);
	set_fs(oldfs);

	if (ret) {
		rmtp = restart->nanosleep.compat_rmtp;

		if (rmtp && put_compat_timespec(&rmt, rmtp))
			return -EFAULT;
	}

	return ret;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:22,代码来源:compat.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ put_cpu函数代码示例发布时间:2022-05-30
下一篇:
C++ put_cmsg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap