diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2012-08-18 22:40:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-19 11:41:19 -0400 |
commit | be53db6e4edd9dc013b21a929ad2b142dea8b9c0 (patch) | |
tree | 7c4604295375f432071c2077362df2e6c278af53 /arch/alpha/kernel/osf_sys.c | |
parent | f2db633d301b4b50f5f93de0e8314cc81e9bc7de (diff) |
alpha: take a bunch of syscalls into osf_sys.c
New helper: current_thread_info(). Allows to do a bunch of odd syscalls
in C. While we are at it, there had never been a reason to do
osf_getpriority() in assembler. We also get "namespace"-aware (read:
consistent with getuid(2), etc.) behaviour from getx?id() syscalls now.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha/kernel/osf_sys.c')
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 98a103621af6..bc1acdda7a5e 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -1404,3 +1404,52 @@ SYSCALL_DEFINE3(osf_writev, unsigned long, fd, | |||
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | #endif | 1406 | #endif |
1407 | |||
1408 | SYSCALL_DEFINE2(osf_getpriority, int, which, int, who) | ||
1409 | { | ||
1410 | int prio = sys_getpriority(which, who); | ||
1411 | if (prio >= 0) { | ||
1412 | /* Return value is the unbiased priority, i.e. 20 - prio. | ||
1413 | This does result in negative return values, so signal | ||
1414 | no error */ | ||
1415 | force_successful_syscall_return(); | ||
1416 | prio = 20 - prio; | ||
1417 | } | ||
1418 | return prio; | ||
1419 | } | ||
1420 | |||
1421 | SYSCALL_DEFINE0(getxuid) | ||
1422 | { | ||
1423 | current_pt_regs()->r20 = sys_geteuid(); | ||
1424 | return sys_getuid(); | ||
1425 | } | ||
1426 | |||
1427 | SYSCALL_DEFINE0(getxgid) | ||
1428 | { | ||
1429 | current_pt_regs()->r20 = sys_getegid(); | ||
1430 | return sys_getgid(); | ||
1431 | } | ||
1432 | |||
1433 | SYSCALL_DEFINE0(getxpid) | ||
1434 | { | ||
1435 | current_pt_regs()->r20 = sys_getppid(); | ||
1436 | return sys_getpid(); | ||
1437 | } | ||
1438 | |||
1439 | SYSCALL_DEFINE0(alpha_pipe) | ||
1440 | { | ||
1441 | int fd[2]; | ||
1442 | int res = do_pipe_flags(fd, 0); | ||
1443 | if (!res) { | ||
1444 | /* The return values are in $0 and $20. */ | ||
1445 | current_pt_regs()->r20 = fd[1]; | ||
1446 | res = fd[0]; | ||
1447 | } | ||
1448 | return res; | ||
1449 | } | ||
1450 | |||
1451 | SYSCALL_DEFINE1(sethae, unsigned long, val) | ||
1452 | { | ||
1453 | current_pt_regs()->hae = val; | ||
1454 | return 0; | ||
1455 | } | ||