Changeset 3138 in kBuild for vendor/gnumake/current/job.h
- Timestamp:
- Mar 12, 2018 7:32:29 PM (7 years ago)
- File:
-
- 1 edited
-
vendor/gnumake/current/job.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/job.h
r2596 r3138 1 1 /* Definitions for managing subprocesses in GNU Make. 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 4 Foundation, Inc. 2 Copyright (C) 1992-2016 Free Software Foundation, Inc. 5 3 This file is part of GNU Make. 6 4 … … 17 15 this program. If not, see <http://www.gnu.org/licenses/>. */ 18 16 19 #ifndef SEEN_JOB_H 20 #define SEEN_JOB_H 17 #include "output.h" 21 18 22 19 #ifdef HAVE_FCNTL_H … … 28 25 /* How to set close-on-exec for a file descriptor. */ 29 26 30 #if !defined F_SETFD 31 # define CLOSE_ON_EXEC(_d) 27 #if !defined(F_SETFD) || !defined(F_GETFD) 28 # ifdef WINDOWS32 29 # define CLOSE_ON_EXEC(_d) process_noinherit(_d) 30 # else 31 # define CLOSE_ON_EXEC(_d) 32 # endif 32 33 #else 33 34 # ifndef FD_CLOEXEC … … 37 38 #endif 38 39 40 #ifdef NO_OUTPUT_SYNC 41 # define RECORD_SYNC_MUTEX(m) \ 42 O (error, NILF, \ 43 _("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build.")); 44 #else 45 # ifdef WINDOWS32 46 /* For emulations in w32/compat/posixfcn.c. */ 47 # define F_GETFD 1 48 # define F_SETLKW 2 49 /* Implementation note: None of the values of l_type below can be zero 50 -- they are compared with a static instance of the struct, so zero 51 means unknown/invalid, see w32/compat/posixfcn.c. */ 52 # define F_WRLCK 1 53 # define F_UNLCK 2 54 55 struct flock 56 { 57 short l_type; 58 short l_whence; 59 off_t l_start; 60 off_t l_len; 61 pid_t l_pid; 62 }; 63 64 /* This type is actually a HANDLE, but we want to avoid including 65 windows.h as much as possible. */ 66 typedef intptr_t sync_handle_t; 67 68 /* Public functions emulated/provided in posixfcn.c. */ 69 int fcntl (intptr_t fd, int cmd, ...); 70 intptr_t create_mutex (void); 71 int same_stream (FILE *f1, FILE *f2); 72 73 # define RECORD_SYNC_MUTEX(m) record_sync_mutex(m) 74 void record_sync_mutex (const char *str); 75 void prepare_mutex_handle_string (intptr_t hdl); 76 # else /* !WINDOWS32 */ 77 78 typedef int sync_handle_t; /* file descriptor */ 79 80 # define RECORD_SYNC_MUTEX(m) (void)(m) 81 82 # endif 83 #endif /* !NO_OUTPUT_SYNC */ 84 39 85 /* Structure describing a running or dead child process. */ 40 86 41 87 struct child 42 88 { 43 struct child *next; /* Link in the chain. */89 struct child *next; /* Link in the chain. */ 44 90 45 struct file *file; /* File being remade. */91 struct file *file; /* File being remade. */ 46 92 47 char **environment; /* Environment for commands. */ 93 char **environment; /* Environment for commands. */ 94 char *sh_batch_file; /* Script file for shell commands */ 95 char **command_lines; /* Array of variable-expanded cmd lines. */ 96 char *command_ptr; /* Ptr into command_lines[command_line]. */ 48 97 49 char **command_lines; /* Array of variable-expanded cmd lines. */ 50 unsigned int command_line; /* Index into above. */ 51 char *command_ptr; /* Ptr into command_lines[command_line]. */ 98 #ifdef VMS 99 char *comname; /* Temporary command file name */ 100 int efn; /* Completion event flag number */ 101 int cstatus; /* Completion status */ 102 int vms_launch_status; /* non-zero if lib$spawn, etc failed */ 103 #endif 52 104 53 pid_t pid; /* Child process's ID number. */ 54 #ifdef VMS 55 int efn; /* Completion event flag number */ 56 int cstatus; /* Completion status */ 57 char *comname; /* Temporary command file name */ 58 #endif 59 char *sh_batch_file; /* Script file for shell commands */ 60 unsigned int remote:1; /* Nonzero if executing remotely. */ 61 62 unsigned int noerror:1; /* Nonzero if commands contained a `-'. */ 63 64 unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ 65 unsigned int deleted:1; /* Nonzero if targets have been deleted. */ 66 unsigned int dontcare:1; /* Saved dontcare flag. */ 105 unsigned int command_line; /* Index into command_lines. */ 106 struct output output; /* Output for this child. */ 107 pid_t pid; /* Child process's ID number. */ 108 unsigned int remote:1; /* Nonzero if executing remotely. */ 109 unsigned int noerror:1; /* Nonzero if commands contained a '-'. */ 110 unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ 111 unsigned int deleted:1; /* Nonzero if targets have been deleted. */ 112 unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */ 113 unsigned int dontcare:1; /* Saved dontcare flag. */ 67 114 }; 68 115 69 116 extern struct child *children; 70 117 118 /* A signal handler for SIGCHLD, if needed. */ 119 RETSIGTYPE child_handler (int sig); 71 120 int is_bourne_compatible_shell(const char *path); 72 121 void new_job (struct file *file); … … 76 125 char **construct_command_argv (char *line, char **restp, struct file *file, 77 126 int cmd_flags, char** batch_file); 127 78 128 #ifdef VMS 79 int child_execute_job (char *argv, struct child *child); 80 #elif defined(__EMX__) 81 int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp); 129 int child_execute_job (struct child *child, char *argv); 82 130 #else 83 void child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp); 131 # define FD_STDIN (fileno (stdin)) 132 # define FD_STDOUT (fileno (stdout)) 133 # define FD_STDERR (fileno (stderr)) 134 int child_execute_job (struct output *out, int good_stdin, char **argv, char **envp); 84 135 #endif 136 85 137 #ifdef _AMIGA 86 void exec_command (char **argv) ;138 void exec_command (char **argv) __attribute__ ((noreturn)); 87 139 #elif defined(__EMX__) 88 140 int exec_command (char **argv, char **envp); 89 141 #else 90 void exec_command (char **argv, char **envp) ;142 void exec_command (char **argv, char **envp) __attribute__ ((noreturn)); 91 143 #endif 92 144 … … 97 149 void unblock_sigs (void); 98 150 #else 99 #ifdef HAVE_SIGSETMASK151 #ifdef HAVE_SIGSETMASK 100 152 extern int fatal_signal_mask; 101 #define unblock_sigs()sigsetmask (0)153 #define unblock_sigs() sigsetmask (0) 102 154 #else 103 #define unblock_sigs()155 #define unblock_sigs() 104 156 #endif 105 157 #endif 106 158 107 159 extern unsigned int jobserver_tokens; 108 109 #endif /* SEEN_JOB_H */
Note:
See TracChangeset
for help on using the changeset viewer.

