Imported Upstream version 4.0
[platform/upstream/make.git] / remote-stub.c
1 /* Template for the remote job exportation interface to GNU Make.
2 Copyright (C) 1988-2013 Free Software Foundation, Inc.
3 This file is part of GNU Make.
4
5 GNU Make is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3 of the License, or (at your option) any later
8 version.
9
10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program.  If not, see <http://www.gnu.org/licenses/>.  */
16
17 #include "makeint.h"
18 #include "filedef.h"
19 #include "job.h"
20 #include "commands.h"
21
22
23 char *remote_description = 0;
24
25 /* Call once at startup even if no commands are run.  */
26
27 void
28 remote_setup (void)
29 {
30 }
31
32 /* Called before exit.  */
33
34 void
35 remote_cleanup (void)
36 {
37 }
38 \f
39 /* Return nonzero if the next job should be done remotely.  */
40
41 int
42 start_remote_job_p (int first_p UNUSED)
43 {
44   return 0;
45 }
46 \f
47 /* Start a remote job running the command in ARGV,
48    with environment from ENVP.  It gets standard input from STDIN_FD.  On
49    failure, return nonzero.  On success, return zero, and set *USED_STDIN
50    to nonzero if it will actually use STDIN_FD, zero if not, set *ID_PTR to
51    a unique identification, and set *IS_REMOTE to zero if the job is local,
52    nonzero if it is remote (meaning *ID_PTR is a process ID).  */
53
54 int
55 start_remote_job (char **argv UNUSED, char **envp UNUSED, int stdin_fd UNUSED,
56                   int *is_remote UNUSED, int *id_ptr UNUSED,
57                   int *used_stdin UNUSED)
58 {
59   return -1;
60 }
61 \f
62 /* Get the status of a dead remote child.  Block waiting for one to die
63    if BLOCK is nonzero.  Set *EXIT_CODE_PTR to the exit status, *SIGNAL_PTR
64    to the termination signal or zero if it exited normally, and *COREDUMP_PTR
65    nonzero if it dumped core.  Return the ID of the child that died,
66    0 if we would have to block and !BLOCK, or < 0 if there were none.  */
67
68 int
69 remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED,
70                int *coredump_ptr UNUSED, int block UNUSED)
71 {
72   errno = ECHILD;
73   return -1;
74 }
75
76 /* Block asynchronous notification of remote child death.
77    If this notification is done by raising the child termination
78    signal, do not block that signal.  */
79 void
80 block_remote_children (void)
81 {
82   return;
83 }
84
85 /* Restore asynchronous notification of remote child death.
86    If this is done by raising the child termination signal,
87    do not unblock that signal.  */
88 void
89 unblock_remote_children (void)
90 {
91   return;
92 }
93
94 /* Send signal SIG to child ID.  Return 0 if successful, -1 if not.  */
95 int
96 remote_kill (int id UNUSED, int sig UNUSED)
97 {
98   return -1;
99 }