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