mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
bsd-user: Implement several get/set system calls:
getpid(2), getppid(2), getpgrp(2) setreuid(2), setregid(2) getuid(2), geteuid(2), getgid(2), getegid(2), getpgid(2) setuid(2), seteuid(2), setgid(2), setegid(2), setpgid(2) Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20230925182425.3163-16-kariem.taha2.7@gmail.com>
This commit is contained in:
parent
faba8e123f
commit
e4446e0a2c
2 changed files with 150 additions and 0 deletions
|
@ -196,4 +196,94 @@ static inline abi_long do_bsd_setrlimit(abi_long arg1, abi_ulong arg2)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* getpid(2) */
|
||||
static inline abi_long do_bsd_getpid(void)
|
||||
{
|
||||
return get_errno(getpid());
|
||||
}
|
||||
|
||||
/* getppid(2) */
|
||||
static inline abi_long do_bsd_getppid(void)
|
||||
{
|
||||
return get_errno(getppid());
|
||||
}
|
||||
|
||||
/* getuid(2) */
|
||||
static inline abi_long do_bsd_getuid(void)
|
||||
{
|
||||
return get_errno(getuid());
|
||||
}
|
||||
|
||||
/* geteuid(2) */
|
||||
static inline abi_long do_bsd_geteuid(void)
|
||||
{
|
||||
return get_errno(geteuid());
|
||||
}
|
||||
|
||||
/* getgid(2) */
|
||||
static inline abi_long do_bsd_getgid(void)
|
||||
{
|
||||
return get_errno(getgid());
|
||||
}
|
||||
|
||||
/* getegid(2) */
|
||||
static inline abi_long do_bsd_getegid(void)
|
||||
{
|
||||
return get_errno(getegid());
|
||||
}
|
||||
|
||||
/* setuid(2) */
|
||||
static inline abi_long do_bsd_setuid(abi_long arg1)
|
||||
{
|
||||
return get_errno(setuid(arg1));
|
||||
}
|
||||
|
||||
/* seteuid(2) */
|
||||
static inline abi_long do_bsd_seteuid(abi_long arg1)
|
||||
{
|
||||
return get_errno(seteuid(arg1));
|
||||
}
|
||||
|
||||
/* setgid(2) */
|
||||
static inline abi_long do_bsd_setgid(abi_long arg1)
|
||||
{
|
||||
return get_errno(setgid(arg1));
|
||||
}
|
||||
|
||||
/* setegid(2) */
|
||||
static inline abi_long do_bsd_setegid(abi_long arg1)
|
||||
{
|
||||
return get_errno(setegid(arg1));
|
||||
}
|
||||
|
||||
/* getpgid(2) */
|
||||
static inline abi_long do_bsd_getpgid(pid_t pid)
|
||||
{
|
||||
return get_errno(getpgid(pid));
|
||||
}
|
||||
|
||||
/* setpgid(2) */
|
||||
static inline abi_long do_bsd_setpgid(int pid, int pgrp)
|
||||
{
|
||||
return get_errno(setpgid(pid, pgrp));
|
||||
}
|
||||
|
||||
/* getpgrp(2) */
|
||||
static inline abi_long do_bsd_getpgrp(void)
|
||||
{
|
||||
return get_errno(getpgrp());
|
||||
}
|
||||
|
||||
/* setreuid(2) */
|
||||
static inline abi_long do_bsd_setreuid(abi_long arg1, abi_long arg2)
|
||||
{
|
||||
return get_errno(setreuid(arg1, arg2));
|
||||
}
|
||||
|
||||
/* setregid(2) */
|
||||
static inline abi_long do_bsd_setregid(abi_long arg1, abi_long arg2)
|
||||
{
|
||||
return get_errno(setregid(arg1, arg2));
|
||||
}
|
||||
|
||||
#endif /* !BSD_PROC_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue