1994-03-23 14:12:55 +00:00
|
|
|
|
/* Template for the remote job exportation interface to GNU Make.
|
2014-09-30 12:33:21 +00:00
|
|
|
|
Copyright (C) 1988-2014 Free Software Foundation, Inc.
|
1989-05-10 22:57:31 +00:00
|
|
|
|
This file is part of GNU Make.
|
|
|
|
|
|
2006-02-11 19:02:21 +00:00
|
|
|
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
|
|
|
|
terms of the GNU General Public License as published by the Free Software
|
2007-07-04 19:35:15 +00:00
|
|
|
|
Foundation; either version 3 of the License, or (at your option) any later
|
|
|
|
|
version.
|
1989-05-10 22:57:31 +00:00
|
|
|
|
|
2006-02-11 19:02:21 +00:00
|
|
|
|
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
1989-05-10 22:57:31 +00:00
|
|
|
|
|
2006-02-11 19:02:21 +00:00
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
2007-07-04 19:35:15 +00:00
|
|
|
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
1989-05-10 22:57:31 +00:00
|
|
|
|
|
2013-01-20 16:01:01 +00:00
|
|
|
|
#include "makeint.h"
|
1996-03-20 14:57:41 +00:00
|
|
|
|
#include "filedef.h"
|
|
|
|
|
#include "job.h"
|
1989-05-10 22:57:31 +00:00
|
|
|
|
#include "commands.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *remote_description = 0;
|
|
|
|
|
|
1996-06-22 19:31:06 +00:00
|
|
|
|
/* Call once at startup even if no commands are run. */
|
1989-05-10 22:57:31 +00:00
|
|
|
|
|
1996-06-22 19:31:06 +00:00
|
|
|
|
void
|
2002-10-14 21:54:04 +00:00
|
|
|
|
remote_setup (void)
|
1996-06-22 19:31:06 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Called before exit. */
|
|
|
|
|
|
|
|
|
|
void
|
2002-10-14 21:54:04 +00:00
|
|
|
|
remote_cleanup (void)
|
1996-06-22 19:31:06 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1989-05-10 22:57:31 +00:00
|
|
|
|
/* Return nonzero if the next job should be done remotely. */
|
|
|
|
|
|
|
|
|
|
int
|
2004-02-24 13:50:19 +00:00
|
|
|
|
start_remote_job_p (int first_p UNUSED)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-10 22:15:46 +00:00
|
|
|
|
/* Start a remote job running the command in ARGV,
|
|
|
|
|
with environment from ENVP. It gets standard input from STDIN_FD. On
|
|
|
|
|
failure, return nonzero. On success, return zero, and set *USED_STDIN
|
|
|
|
|
to nonzero if it will actually use STDIN_FD, zero if not, set *ID_PTR to
|
|
|
|
|
a unique identification, and set *IS_REMOTE to zero if the job is local,
|
|
|
|
|
nonzero if it is remote (meaning *ID_PTR is a process ID). */
|
1989-05-10 22:57:31 +00:00
|
|
|
|
|
|
|
|
|
int
|
2004-02-24 13:50:19 +00:00
|
|
|
|
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)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Get the status of a dead remote child. Block waiting for one to die
|
|
|
|
|
if BLOCK is nonzero. Set *EXIT_CODE_PTR to the exit status, *SIGNAL_PTR
|
|
|
|
|
to the termination signal or zero if it exited normally, and *COREDUMP_PTR
|
|
|
|
|
nonzero if it dumped core. Return the ID of the child that died,
|
|
|
|
|
0 if we would have to block and !BLOCK, or < 0 if there were none. */
|
|
|
|
|
|
|
|
|
|
int
|
2004-02-24 13:50:19 +00:00
|
|
|
|
remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED,
|
|
|
|
|
int *coredump_ptr UNUSED, int block UNUSED)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
1993-08-09 22:21:56 +00:00
|
|
|
|
errno = ECHILD;
|
1989-05-10 22:57:31 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Block asynchronous notification of remote child death.
|
|
|
|
|
If this notification is done by raising the child termination
|
|
|
|
|
signal, do not block that signal. */
|
|
|
|
|
void
|
2002-10-14 21:54:04 +00:00
|
|
|
|
block_remote_children (void)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Restore asynchronous notification of remote child death.
|
|
|
|
|
If this is done by raising the child termination signal,
|
|
|
|
|
do not unblock that signal. */
|
|
|
|
|
void
|
2002-10-14 21:54:04 +00:00
|
|
|
|
unblock_remote_children (void)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Send signal SIG to child ID. Return 0 if successful, -1 if not. */
|
|
|
|
|
int
|
2004-02-24 13:50:19 +00:00
|
|
|
|
remote_kill (int id UNUSED, int sig UNUSED)
|
1989-05-10 22:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|