Skip to content

Commit

Permalink
bsd-user: Define procctl(2) related structs
Browse files Browse the repository at this point in the history
Implement procctl flags and related structs:
struct target_procctl_reaper_status
struct target_procctl_reaper_pidinfo
struct target_procctl_reaper_pids
struct target_procctl_reaper_kill

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-3-kariem.taha2.7@gmail.com>
  • Loading branch information
staceyson authored and bsdimp committed Oct 3, 2023
1 parent 5783a53 commit d314ae9
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions bsd-user/syscall_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,48 @@ struct target_freebsd_flock {
/* user: vfork(2) semantics, clear signals */
#define TARGET_RFSPAWN (1U << 31)

/*
* from sys/procctl.h
*/
#define TARGET_PROC_SPROTECT 1
#define TARGET_PROC_REAP_ACQUIRE 2
#define TARGET_PROC_REAP_RELEASE 3
#define TARGET_PROC_REAP_STATUS 4
#define TARGET_PROC_REAP_GETPIDS 5
#define TARGET_PROC_REAP_KILL 6

struct target_procctl_reaper_status {
uint32_t rs_flags;
uint32_t rs_children;
uint32_t rs_descendants;
uint32_t rs_reaper;
uint32_t rs_pid;
uint32_t rs_pad0[15];
};

struct target_procctl_reaper_pidinfo {
uint32_t pi_pid;
uint32_t pi_subtree;
uint32_t pi_flags;
uint32_t pi_pad0[15];
};

struct target_procctl_reaper_pids {
uint32_t rp_count;
uint32_t rp_pad0[15];
abi_ulong rp_pids;
};

struct target_procctl_reaper_kill {
int32_t rk_sig;
uint32_t rk_flags;
uint32_t rk_subtree;
uint32_t rk_killed;
uint32_t rk_fpid;
uint32_t rk_pad0[15];
};


#define safe_syscall0(type, name) \
type safe_##name(void) \
{ \
Expand Down

0 comments on commit d314ae9

Please sign in to comment.