You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
get_compat_sigset()
similar to put_compat_sigset() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
+16
-7
@@ -467,17 +467,26 @@ Efault:
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
void
|
||||
sigset_from_compat(sigset_t *set, const compat_sigset_t *compat)
|
||||
int
|
||||
get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat)
|
||||
{
|
||||
#ifdef __BIG_ENDIAN
|
||||
compat_sigset_t v;
|
||||
if (copy_from_user(&v, compat, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4: set->sig[3] = compat->sig[6] | (((long)compat->sig[7]) << 32 );
|
||||
case 3: set->sig[2] = compat->sig[4] | (((long)compat->sig[5]) << 32 );
|
||||
case 2: set->sig[1] = compat->sig[2] | (((long)compat->sig[3]) << 32 );
|
||||
case 1: set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32 );
|
||||
case 4: set->sig[3] = v.sig[6] | (((long)v.sig[7]) << 32 );
|
||||
case 3: set->sig[2] = v.sig[4] | (((long)v.sig[5]) << 32 );
|
||||
case 2: set->sig[1] = v.sig[2] | (((long)v.sig[3]) << 32 );
|
||||
case 1: set->sig[0] = v.sig[0] | (((long)v.sig[1]) << 32 );
|
||||
}
|
||||
#else
|
||||
if (copy_from_user(set, compat, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sigset_from_compat);
|
||||
EXPORT_SYMBOL_GPL(get_compat_sigset);
|
||||
|
||||
int
|
||||
put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
|
||||
|
||||
Reference in New Issue
Block a user