VirtualBox

source: kBuild/vendor/gnumake/current/os.h

Last change on this file was 3138, checked in by bird, 7 years ago

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • Property svn:eol-style set to native
File size: 2.9 KB
Line 
1/* Declarations for operating system interfaces for GNU Make.
2Copyright (C) 2016 Free Software Foundation, Inc.
3This file is part of GNU Make.
4
5GNU Make is free software; you can redistribute it and/or modify it under the
6terms of the GNU General Public License as published by the Free Software
7Foundation; either version 3 of the License, or (at your option) any later
8version.
9
10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License along with
15this program. If not, see <http://www.gnu.org/licenses/>. */
16
17
18/* This section provides OS-specific functions to support the jobserver. */
19
20#ifdef MAKE_JOBSERVER
21
22/* Returns 1 if the jobserver is enabled, else 0. */
23unsigned int jobserver_enabled (void);
24
25/* Called in the master instance to set up the jobserver initially. */
26unsigned int jobserver_setup (int job_slots);
27
28/* Called in a child instance to connect to the jobserver. */
29unsigned int jobserver_parse_auth (const char* auth);
30
31/* Returns an allocated buffer used to pass to child instances. */
32char *jobserver_get_auth (void);
33
34/* Clear this instance's jobserver configuration. */
35void jobserver_clear (void);
36
37/* Recover all the jobserver tokens and return the number we got. */
38unsigned int jobserver_acquire_all (void);
39
40/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
41void jobserver_release (int is_fatal);
42
43/* Notify the jobserver that a child exited. */
44void jobserver_signal (void);
45
46/* Get ready to start a non-recursive child. */
47void jobserver_pre_child (int);
48
49/* Complete starting a non-recursive child. */
50void jobserver_post_child (int);
51
52/* Set up to acquire a new token. */
53void jobserver_pre_acquire (void);
54
55/* Wait until we can acquire a jobserver token.
56 TIMEOUT is 1 if we have other jobs waiting for the load to go down;
57 in this case we won't wait forever, so we can check the load.
58 Returns 1 if we got a token, or 0 if we stopped waiting due to a child
59 exiting or a timeout. */
60unsigned int jobserver_acquire (int timeout);
61
62#else
63
64#define jobserver_enabled() (0)
65#define jobserver_setup(_slots) (0)
66#define jobserver_parse_auth(_auth) (0)
67#define jobserver_get_auth() (NULL)
68#define jobserver_clear() (void)(0)
69#define jobserver_release(_fatal) (void)(0)
70#define jobserver_acquire_all() (0)
71#define jobserver_signal() (void)(0)
72#define jobserver_pre_child(_r) (void)(0)
73#define jobserver_post_child(_r) (void)(0)
74#define jobserver_pre_acquire() (void)(0)
75#define jobserver_acquire(_tmout) (0)
76
77#endif
78
79/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
80#if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
81int get_bad_stdin (void);
82#else
83# define get_bad_stdin() (-1)
84#endif
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