Пример #1
0
int
linux_sys_modify_ldt(struct lwp *l, const struct linux_sys_modify_ldt_args *uap, register_t *retval)
{
	/* {
		syscallarg(int) func;
		syscallarg(void *) ptr;
		syscallarg(size_t) bytecount;
	} */

	switch (SCARG(uap, func)) {
#ifdef USER_LDT
	case 0:
		return linux_read_ldt(l, (const void *)uap, retval);
	case 1:
		return linux_write_ldt(l, (const void *)uap, 1);
	case 2:
#ifdef notyet
		return linux_read_default_ldt(l, (const void *)uap, retval);
#else
		return (ENOSYS);
#endif
	case 0x11:
		return linux_write_ldt(l, (const void *)uap, 0);
#endif /* USER_LDT */

	default:
		return (ENOSYS);
	}
}
Пример #2
0
int
linux_sys_modify_ldt(struct proc *p, void *v, register_t *retval)
{
	struct linux_sys_modify_ldt_args /* {
		syscallarg(int) func;
		syscallarg(void *) ptr;
		syscallarg(size_t) bytecount;
	} */ *uap = v;

	switch (SCARG(uap, func)) {
#ifdef USER_LDT
	case 0:
		return (linux_read_ldt(p, uap, retval));

	case 1:
		return (linux_write_ldt(p, uap, retval));
#endif /* USER_LDT */

	default:
		return (ENOSYS);
	}
}