Revision 163a05a8 linux-user/syscall.c
b/linux-user/syscall.c | ||
---|---|---|
559 | 559 |
fd_set *, exceptfds, struct timespec *, timeout, void *, sig); |
560 | 560 |
#endif |
561 | 561 |
|
562 |
#if defined(TARGET_NR_prlimit64) |
|
563 |
#ifndef __NR_prlimit64 |
|
564 |
# define __NR_prlimit64 -1 |
|
565 |
#endif |
|
566 |
#define __NR_sys_prlimit64 __NR_prlimit64 |
|
567 |
/* The glibc rlimit structure may not be that used by the underlying syscall */ |
|
568 |
struct host_rlimit64 { |
|
569 |
uint64_t rlim_cur; |
|
570 |
uint64_t rlim_max; |
|
571 |
}; |
|
572 |
_syscall4(int, sys_prlimit64, pid_t, pid, int, resource, |
|
573 |
const struct host_rlimit64 *, new_limit, |
|
574 |
struct host_rlimit64 *, old_limit) |
|
575 |
#endif |
|
576 |
|
|
562 | 577 |
extern int personality(int); |
563 | 578 |
extern int flock(int, int); |
564 | 579 |
extern int setfsuid(int); |
... | ... | |
7990 | 8005 |
} |
7991 | 8006 |
#endif |
7992 | 8007 |
#endif |
8008 |
#ifdef TARGET_NR_prlimit64 |
|
8009 |
case TARGET_NR_prlimit64: |
|
8010 |
{ |
|
8011 |
/* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */ |
|
8012 |
struct target_rlimit64 *target_rnew, *target_rold; |
|
8013 |
struct host_rlimit64 rnew, rold, *rnewp = 0; |
|
8014 |
if (arg3) { |
|
8015 |
if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) { |
|
8016 |
goto efault; |
|
8017 |
} |
|
8018 |
rnew.rlim_cur = tswap64(target_rnew->rlim_cur); |
|
8019 |
rnew.rlim_max = tswap64(target_rnew->rlim_max); |
|
8020 |
unlock_user_struct(target_rnew, arg3, 0); |
|
8021 |
rnewp = &rnew; |
|
8022 |
} |
|
8023 |
|
|
8024 |
ret = get_errno(sys_prlimit64(arg1, arg2, rnewp, arg4 ? &rold : 0)); |
|
8025 |
if (!is_error(ret) && arg4) { |
|
8026 |
if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) { |
|
8027 |
goto efault; |
|
8028 |
} |
|
8029 |
target_rold->rlim_cur = tswap64(rold.rlim_cur); |
|
8030 |
target_rold->rlim_max = tswap64(rold.rlim_max); |
|
8031 |
unlock_user_struct(target_rold, arg4, 1); |
|
8032 |
} |
|
8033 |
break; |
|
8034 |
} |
|
8035 |
#endif |
|
7993 | 8036 |
default: |
7994 | 8037 |
unimplemented: |
7995 | 8038 |
gemu_log("qemu: Unsupported syscall: %d\n", num); |
Also available in: Unified diff