Keep the command line on the heap to avoid stack overflow.
[make.git] / remote-stub.c
1 /* Template for the remote job exportation interface to GNU Make.
2 Copyright (C) 1988-2012 Free Software Foundation, Inc.
3 This file is part of GNU Make.
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.
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.
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see <>. */
17 #include "make.h"
18 #include "filedef.h"
19 #include "job.h"
20 #include "commands.h"
23 char *remote_description = 0;
25 /* Call once at startup even if no commands are run. */
27 void
28 remote_setup (void)
32 /* Called before exit. */
34 void
35 remote_cleanup (void)
39 /* Return nonzero if the next job should be done remotely. */
41 int
42 start_remote_job_p (int first_p UNUSED)
44 return 0;
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). */
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)
59 return -1;
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. */
68 int
69 remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED,
70 int *coredump_ptr UNUSED, int block UNUSED)
72 errno = ECHILD;
73 return -1;
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)
82 return;
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)
91 return;
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)
98 return -1;