#ifndef SUDO_EXEC_H
#define SUDO_EXEC_H
#ifndef MSG_WAITALL
# define MSG_WAITALL 0
#endif
#ifdef SA_SIGINFO
# ifdef SI_USER
# define USER_SIGNALED(_info) ((_info) != NULL && (_info)->si_code == SI_USER)
# else
# define USER_SIGNALED(_info) ((_info) != NULL && (_info)->si_code <= 0)
# endif
#endif
#define SIGCONT_FG -2
#define SIGCONT_BG -3
#define SAVED_SIGALRM 0
#define SAVED_SIGCHLD 1
#define SAVED_SIGCONT 2
#define SAVED_SIGHUP 3
#define SAVED_SIGINT 4
#define SAVED_SIGPIPE 5
#define SAVED_SIGQUIT 6
#define SAVED_SIGTERM 7
#define SAVED_SIGTSTP 8
#define SAVED_SIGTTIN 9
#define SAVED_SIGTTOU 10
#define SAVED_SIGUSR1 11
#define SAVED_SIGUSR2 12
#define SESH_SUCCESS 0
#define SESH_ERR_FAILURE 1
#define SESH_ERR_INVALID 30
#define SESH_ERR_BAD_PATHS 31
#define SESH_ERR_NO_FILES 32
#define SESH_ERR_SOME_FILES 33
struct sudo_event_base;
int sudo_execve(int fd, const char *path, char *const argv[], char *envp[], bool noexec);
extern volatile pid_t cmnd_pid;
struct command_details;
struct command_status;
int fork_pty(struct command_details *details, int sv[], sigset_t *omask);
int suspend_parent(int signo);
void exec_cmnd(struct command_details *details, struct command_status *cstat,
int errfd);
void add_io_events(struct sudo_event_base *evbase);
#ifdef SA_SIGINFO
void handler(int s, siginfo_t *info, void *context);
#else
void handler(int s);
#endif
void pty_close(struct command_status *cstat);
void pty_setup(uid_t uid, const char *tty, const char *utmp_user);
void terminate_command(pid_t pid, bool use_pgrp);
bool utmp_login(const char *from_line, const char *to_line, int ttyfd,
const char *user);
bool utmp_logout(const char *line, int status);
#endif