[53] | 1 | /* Template for the remote job exportation interface to GNU Make.
|
---|
[3140] | 2 | Copyright (C) 1988-2016 Free Software Foundation, Inc.
|
---|
[53] | 3 | This file is part of GNU Make.
|
---|
| 4 |
|
---|
[503] | 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
|
---|
[1993] | 7 | Foundation; either version 3 of the License, or (at your option) any later
|
---|
| 8 | version.
|
---|
[53] | 9 |
|
---|
[503] | 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.
|
---|
[53] | 13 |
|
---|
[503] | 14 | You should have received a copy of the GNU General Public License along with
|
---|
[1993] | 15 | this program. If not, see <http://www.gnu.org/licenses/>. */
|
---|
[53] | 16 |
|
---|
[3140] | 17 | #include "makeint.h"
|
---|
[53] | 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 | |
---|
| 39 |
|
---|
| 40 | /* Return nonzero if the next job should be done remotely. */
|
---|
| 41 |
|
---|
[153] | 42 | int
|
---|
[53] | 43 | start_remote_job_p (int first_p UNUSED)
|
---|
| 44 | {
|
---|
| 45 | return 0;
|
---|
| 46 | }
|
---|
| 47 | |
---|
| 48 |
|
---|
| 49 | /* Start a remote job running the command in ARGV,
|
---|
| 50 | with environment from ENVP. It gets standard input from STDIN_FD. On
|
---|
| 51 | failure, return nonzero. On success, return zero, and set *USED_STDIN
|
---|
| 52 | to nonzero if it will actually use STDIN_FD, zero if not, set *ID_PTR to
|
---|
| 53 | a unique identification, and set *IS_REMOTE to zero if the job is local,
|
---|
| 54 | nonzero if it is remote (meaning *ID_PTR is a process ID). */
|
---|
[153] | 55 |
|
---|
| 56 | int
|
---|
| 57 | start_remote_job (char **argv UNUSED, char **envp UNUSED, int stdin_fd UNUSED,
|
---|
[53] | 58 | int *is_remote UNUSED, int *id_ptr UNUSED,
|
---|
| 59 | int *used_stdin UNUSED)
|
---|
| 60 | {
|
---|
| 61 | return -1;
|
---|
| 62 | }
|
---|
| 63 | |
---|
| 64 |
|
---|
| 65 | /* Get the status of a dead remote child. Block waiting for one to die
|
---|
| 66 | if BLOCK is nonzero. Set *EXIT_CODE_PTR to the exit status, *SIGNAL_PTR
|
---|
| 67 | to the termination signal or zero if it exited normally, and *COREDUMP_PTR
|
---|
| 68 | nonzero if it dumped core. Return the ID of the child that died,
|
---|
[153] | 69 | 0 if we would have to block and !BLOCK, or < 0 if there were none. */
|
---|
| 70 |
|
---|
[53] | 71 | int
|
---|
| 72 | remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED,
|
---|
| 73 | int *coredump_ptr UNUSED, int block UNUSED)
|
---|
| 74 | {
|
---|
| 75 | errno = ECHILD;
|
---|
| 76 | return -1;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | /* Block asynchronous notification of remote child death.
|
---|
| 80 | If this notification is done by raising the child termination
|
---|
| 81 | signal, do not block that signal. */
|
---|
| 82 | void
|
---|
| 83 | block_remote_children (void)
|
---|
| 84 | {
|
---|
| 85 | return;
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | /* Restore asynchronous notification of remote child death.
|
---|
| 89 | If this is done by raising the child termination signal,
|
---|
| 90 | do not unblock that signal. */
|
---|
| 91 | void
|
---|
| 92 | unblock_remote_children (void)
|
---|
| 93 | {
|
---|
| 94 | return;
|
---|
| 95 | }
|
---|
[153] | 96 |
|
---|
[53] | 97 | /* Send signal SIG to child ID. Return 0 if successful, -1 if not. */
|
---|
| 98 | int
|
---|
| 99 | remote_kill (int id UNUSED, int sig UNUSED)
|
---|
| 100 | {
|
---|
| 101 | return -1;
|
---|
| 102 | }
|
---|