VirtualBox

source: kBuild/trunk/src/gmake/job.h@ 285

Last change on this file since 285 was 227, checked in by bird, 20 years ago

builtin stuff.

  • Property svn:eol-style set to native
File size: 3.6 KB
Line 
1/* Definitions for managing subprocesses in GNU Make.
2Copyright (C) 1992, 1993, 1996, 1999 Free Software Foundation, Inc.
3This file is part of GNU Make.
4
5GNU Make is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2, or (at your option)
8any later version.
9
10GNU Make is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with GNU Make; see the file COPYING. If not, write to
17the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */
19
20#ifndef SEEN_JOB_H
21#define SEEN_JOB_H
22
23#ifdef HAVE_FCNTL_H
24# include <fcntl.h>
25#else
26# include <sys/file.h>
27#endif
28
29/* How to set close-on-exec for a file descriptor. */
30
31#if !defined F_SETFD
32# define CLOSE_ON_EXEC(_d)
33#else
34# ifndef FD_CLOEXEC
35# define FD_CLOEXEC 1
36# endif
37# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
38#endif
39
40/* Structure describing a running or dead child process. */
41
42struct child
43 {
44 struct child *next; /* Link in the chain. */
45
46 struct file *file; /* File being remade. */
47
48 char **environment; /* Environment for commands. */
49
50 char **command_lines; /* Array of variable-expanded cmd lines. */
51 unsigned int command_line; /* Index into above. */
52 char *command_ptr; /* Ptr into command_lines[command_line]. */
53
54 pid_t pid; /* Child process's ID number. */
55#ifdef VMS
56 int efn; /* Completion event flag number */
57 int cstatus; /* Completion status */
58#endif
59 char *sh_batch_file; /* Script file for shell commands */
60#if defined(CONFIG_WITH_KMK_BUILTIN) || defined(MAKE_DLLSHELL)
61 int status; /* Status of the job. */
62 unsigned int have_status:1; /* Nonzero if status is available. */
63#endif
64#ifdef MAKE_DLLSHELL
65 unsigned int dllshelled:1; /* Nonzero if executed thru dllshell. */
66#endif
67 unsigned int remote:1; /* Nonzero if executing remotely. */
68
69 unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
70
71 unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
72 unsigned int deleted:1; /* Nonzero if targets have been deleted. */
73 };
74
75extern struct child *children;
76
77extern void new_job PARAMS ((struct file *file));
78extern void reap_children PARAMS ((int block, int err));
79extern void start_waiting_jobs PARAMS ((void));
80
81extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
82#ifdef VMS
83extern int child_execute_job PARAMS ((char *argv, struct child *child));
84#elif defined(__EMX__) || defined (MAKE_DLLSHELL)
85extern int child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp, struct child *child));
86#else
87extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
88#endif
89#ifdef _AMIGA
90extern void exec_command PARAMS ((char **argv));
91#elif defined(__EMX__)
92extern int exec_command PARAMS ((char **argv, char **envp));
93#else
94extern void exec_command PARAMS ((char **argv, char **envp));
95#endif
96
97extern unsigned int job_slots_used;
98
99extern void block_sigs PARAMS ((void));
100#ifdef POSIX
101extern void unblock_sigs PARAMS ((void));
102#else
103#ifdef HAVE_SIGSETMASK
104extern int fatal_signal_mask;
105#define unblock_sigs() sigsetmask (0)
106#else
107#define unblock_sigs()
108#endif
109#endif
110
111#ifdef MAKE_DLLSHELL
112extern pid_t wait_jobs PARAMS ((int *status, int block));
113#endif
114
115#endif /* SEEN_JOB_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette