#ifndef SEEN_JOB_H
#define SEEN_JOB_H
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
#endif
#if !defined F_SETFD
# define CLOSE_ON_EXEC(_d)
#else
# ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
# endif
# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
#endif
struct child
{
struct child *next;
struct file *file;
char **environment;
char **command_lines;
unsigned int command_line;
char *command_ptr;
pid_t pid;
#ifdef VMS
int efn;
int cstatus;
#endif
char *sh_batch_file;
unsigned int remote:1;
unsigned int noerror:1;
unsigned int good_stdin:1;
unsigned int deleted:1;
unsigned int dontcare:1;
};
extern struct child *children;
extern void new_job PARAMS ((struct file *file));
extern void reap_children PARAMS ((int block, int err));
extern void start_waiting_jobs PARAMS ((void));
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
#ifdef VMS
extern int child_execute_job PARAMS ((char *argv, struct child *child));
#elif defined(__EMX__)
extern int child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
#else
extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
#endif
#ifdef _AMIGA
extern void exec_command PARAMS ((char **argv));
#elif defined(__EMX__)
extern int exec_command PARAMS ((char **argv, char **envp));
#else
extern void exec_command PARAMS ((char **argv, char **envp));
#endif
extern unsigned int job_slots_used;
extern void block_sigs PARAMS ((void));
#ifdef POSIX
extern void unblock_sigs PARAMS ((void));
#else
#ifdef HAVE_SIGSETMASK
extern int fatal_signal_mask;
#define unblock_sigs() sigsetmask (0)
#else
#define unblock_sigs()
#endif
#endif
extern unsigned int jobserver_tokens;
#endif