diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-09 10:38:28 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-15 20:46:47 -0400 |
commit | a78ee9ed2f828e1960f366bf7ab204e7f19924c7 (patch) | |
tree | 4404d3fe1a46a34c28028df0826dfa71ccf356bc /ipc/shm.c | |
parent | 9b1404c24a357332cb2a6df7c4337e943a4545fd (diff) |
shmat(2): move compat to native
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1439,6 +1439,25 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) | |||
1439 | return (long)ret; | 1439 | return (long)ret; |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | #ifdef CONFIG_COMPAT | ||
1443 | |||
1444 | #ifndef COMPAT_SHMLBA | ||
1445 | #define COMPAT_SHMLBA SHMLBA | ||
1446 | #endif | ||
1447 | |||
1448 | COMPAT_SYSCALL_DEFINE3(shmat, int, shmid, compat_uptr_t, shmaddr, int, shmflg) | ||
1449 | { | ||
1450 | unsigned long ret; | ||
1451 | long err; | ||
1452 | |||
1453 | err = do_shmat(shmid, compat_ptr(shmaddr), shmflg, &ret, COMPAT_SHMLBA); | ||
1454 | if (err) | ||
1455 | return err; | ||
1456 | force_successful_syscall_return(); | ||
1457 | return (long)ret; | ||
1458 | } | ||
1459 | #endif | ||
1460 | |||
1442 | /* | 1461 | /* |
1443 | * detach and kill segment if marked destroyed. | 1462 | * detach and kill segment if marked destroyed. |
1444 | * The work is done in shm_close. | 1463 | * The work is done in shm_close. |