| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: job.h,v 1.45 2020/08/22 08:01:34 rillig Exp $ */ | | 1 | /* $NetBSD: job.h,v 1.46 2020/08/27 06:18:22 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Adam de Boor. | | 8 | * Adam de Boor. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -153,27 +153,27 @@ typedef struct Job { | | | @@ -153,27 +153,27 @@ typedef struct Job { |
153 | #define JOB_ST_SETUP 1 /* Job is allocated but otherwise invalid */ | | 153 | #define JOB_ST_SETUP 1 /* Job is allocated but otherwise invalid */ |
154 | #define JOB_ST_RUNNING 3 /* Job is running, pid valid */ | | 154 | #define JOB_ST_RUNNING 3 /* Job is running, pid valid */ |
155 | #define JOB_ST_FINISHED 4 /* Job is done (ie after SIGCHILD) */ | | 155 | #define JOB_ST_FINISHED 4 /* Job is done (ie after SIGCHILD) */ |
156 | char job_suspended; | | 156 | char job_suspended; |
157 | short flags; /* Flags to control treatment of job */ | | 157 | short flags; /* Flags to control treatment of job */ |
158 | #define JOB_IGNERR 0x001 /* Ignore non-zero exits */ | | 158 | #define JOB_IGNERR 0x001 /* Ignore non-zero exits */ |
159 | #define JOB_SILENT 0x002 /* no output */ | | 159 | #define JOB_SILENT 0x002 /* no output */ |
160 | #define JOB_SPECIAL 0x004 /* Target is a special one. i.e. run it locally | | 160 | #define JOB_SPECIAL 0x004 /* Target is a special one. i.e. run it locally |
161 | * if we can't export it and maxLocal is 0 */ | | 161 | * if we can't export it and maxLocal is 0 */ |
162 | #define JOB_IGNDOTS 0x008 /* Ignore "..." lines when processing | | 162 | #define JOB_IGNDOTS 0x008 /* Ignore "..." lines when processing |
163 | * commands */ | | 163 | * commands */ |
164 | #define JOB_TRACED 0x400 /* we've sent 'set -x' */ | | 164 | #define JOB_TRACED 0x400 /* we've sent 'set -x' */ |
165 | | | 165 | |
166 | int jobPipe[2]; /* Pipe for readind output from job */ | | 166 | int jobPipe[2]; /* Pipe for reading output from job */ |
167 | struct pollfd *inPollfd; /* pollfd associated with inPipe */ | | 167 | struct pollfd *inPollfd; /* pollfd associated with inPipe */ |
168 | char outBuf[JOB_BUFSIZE + 1]; | | 168 | char outBuf[JOB_BUFSIZE + 1]; |
169 | /* Buffer for storing the output of the | | 169 | /* Buffer for storing the output of the |
170 | * job, line by line */ | | 170 | * job, line by line */ |
171 | int curPos; /* Current position in op_outBuf */ | | 171 | int curPos; /* Current position in op_outBuf */ |
172 | | | 172 | |
173 | #ifdef USE_META | | 173 | #ifdef USE_META |
174 | struct BuildMon bm; | | 174 | struct BuildMon bm; |
175 | #endif | | 175 | #endif |
176 | } Job; | | 176 | } Job; |
177 | | | 177 | |
178 | #define inPipe jobPipe[0] | | 178 | #define inPipe jobPipe[0] |
179 | #define outPipe jobPipe[1] | | 179 | #define outPipe jobPipe[1] |
| @@ -240,33 +240,30 @@ typedef struct Shell { | | | @@ -240,33 +240,30 @@ typedef struct Shell { |
240 | } Shell; | | 240 | } Shell; |
241 | | | 241 | |
242 | extern const char *shellPath; | | 242 | extern const char *shellPath; |
243 | extern const char *shellName; | | 243 | extern const char *shellName; |
244 | extern char *shellErrFlag; | | 244 | extern char *shellErrFlag; |
245 | | | 245 | |
246 | extern int jobTokensRunning; /* tokens currently "out" */ | | 246 | extern int jobTokensRunning; /* tokens currently "out" */ |
247 | extern int maxJobs; /* Max jobs we can run */ | | 247 | extern int maxJobs; /* Max jobs we can run */ |
248 | | | 248 | |
249 | void Shell_Init(void); | | 249 | void Shell_Init(void); |
250 | const char *Shell_GetNewline(void); | | 250 | const char *Shell_GetNewline(void); |
251 | void Job_Touch(GNode *, Boolean); | | 251 | void Job_Touch(GNode *, Boolean); |
252 | Boolean Job_CheckCommands(GNode *, void (*abortProc )(const char *, ...)); | | 252 | Boolean Job_CheckCommands(GNode *, void (*abortProc )(const char *, ...)); |
253 | #define CATCH_BLOCK 1 | | | |
254 | void Job_CatchChildren(void); | | 253 | void Job_CatchChildren(void); |
255 | void Job_CatchOutput(void); | | 254 | void Job_CatchOutput(void); |
256 | void Job_Make(GNode *); | | 255 | void Job_Make(GNode *); |
257 | void Job_Init(void); | | 256 | void Job_Init(void); |
258 | Boolean Job_Full(void); | | | |
259 | Boolean Job_Empty(void); | | 257 | Boolean Job_Empty(void); |
260 | ReturnStatus Job_ParseShell(char *); | | 258 | ReturnStatus Job_ParseShell(char *); |
261 | int Job_Finish(void); | | 259 | int Job_Finish(void); |
262 | void Job_End(void); | | 260 | void Job_End(void); |
263 | void Job_Wait(void); | | 261 | void Job_Wait(void); |
264 | void Job_AbortAll(void); | | 262 | void Job_AbortAll(void); |
265 | void JobFlagForMigration(int); | | | |
266 | void Job_TokenReturn(void); | | 263 | void Job_TokenReturn(void); |
267 | Boolean Job_TokenWithdraw(void); | | 264 | Boolean Job_TokenWithdraw(void); |
268 | void Job_ServerStart(int, int, int); | | 265 | void Job_ServerStart(int, int, int); |
269 | void Job_SetPrefix(void); | | 266 | void Job_SetPrefix(void); |
270 | Boolean Job_RunTarget(const char *, const char *); | | 267 | Boolean Job_RunTarget(const char *, const char *); |
271 | | | 268 | |
272 | #endif /* MAKE_JOB_H */ | | 269 | #endif /* MAKE_JOB_H */ |