1 /* nojobs.c - functions that make children, remember them, and handle their termination. */
3 /* This file works under BSD, System V, minix, and Posix systems. It does
4 not implement job control. */
6 /* Copyright (C) 1987-2020 Free Software Foundation, Inc.
8 This file is part of GNU Bush, the Bourne Again SHell.
10 Bush is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 Bush is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Bush. If not, see <http://www.gnu.org/licenses/>.
26 #include "bushtypes.h"
29 #if defined (HAVE_UNISTD_H)
37 #if defined (BUFFERED_INPUT)
38 # include "input/input.h"
41 /* Need to include this up here for *_TTY_DRIVER definitions. */
48 #include "runner/execute_cmd.h"
51 #include "builtins/builtext.h" /* for wait_builtin */
52 #include "builtins/common.h"
54 #define DEFAULT_CHILD_MAX 4096
56 #if defined (_POSIX_VERSION) || !defined (HAVE_KILLPG)
57 # define killpg(pg, sig) kill(-(pg),(sig))
58 #endif /* USG || _POSIX_VERSION */
60 #if !defined (HAVE_SIGINTERRUPT) && !defined (HAVE_POSIX_SIGNALS)
61 # define siginterrupt(sig, code)
62 #endif /* !HAVE_SIGINTERRUPT && !HAVE_POSIX_SIGNALS */
64 #if defined (HAVE_WAITPID)
65 # define WAITPID(pid, statusp, options) waitpid (pid, statusp, options)
67 # define WAITPID(pid, statusp, options) wait (statusp)
68 #endif /* !HAVE_WAITPID */
70 /* Return the fd from which we are actually getting input. */
71 #define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
77 extern void set_original_signal
PARAMS((int, SigHandler
*));
79 volatile pid_t last_made_pid
= NO_PID
;
80 volatile pid_t last_asynchronous_pid
= NO_PID
;
82 static int queue_sigchld
; /* dummy declaration */
83 int waiting_for_child
;
85 /* Call this when you start making children. */
86 int already_making_children
= 0;
88 /* The controlling tty for this shell. */
91 /* If this is non-zero, $LINES and $COLUMNS are reset after every process
92 exits from get_tty_state(). */
93 int check_window_size
= CHECKWINSIZE_DEFAULT
;
95 /* We don't have job control. */
98 int running_in_background
= 0; /* can't tell without job control */
100 /* STATUS and FLAGS are only valid if pid != NO_PID
101 STATUS is only valid if (flags & PROC_RUNNING) == 0 */
104 int status
; /* Exit status of PID or 128 + fatal signal number */
108 /* Values for proc_status.flags */
109 #define PROC_RUNNING 0x01
110 #define PROC_NOTIFIED 0x02
111 #define PROC_ASYNC 0x04
112 #define PROC_SIGNALED 0x10
114 /* Return values from find_status_by_pid */
116 #define PROC_STILL_ALIVE -2
118 static struct proc_status
*pid_list
= (struct proc_status
*)NULL
;
119 static int pid_list_size
;
120 static int wait_sigint_received
;
122 static long child_max
= -1L;
124 static void alloc_pid_list
PARAMS((void));
125 static int find_proc_slot
PARAMS((pid_t
));
126 static int find_index_by_pid
PARAMS((pid_t
));
127 static int find_status_by_pid
PARAMS((pid_t
));
128 static int process_exit_status
PARAMS((WAIT
));
129 static int find_termsig_by_pid
PARAMS((pid_t
));
130 static int get_termsig
PARAMS((WAIT
));
131 static void set_pid_status
PARAMS((pid_t
, WAIT
));
132 static void set_pid_flags
PARAMS((pid_t
, int));
133 static void unset_pid_flags
PARAMS((pid_t
, int));
134 static int get_pid_flags
PARAMS((pid_t
));
135 static void add_pid
PARAMS((pid_t
, int));
136 static void mark_dead_jobs_as_notified
PARAMS((int));
138 static sighandler wait_sigint_handler
PARAMS((int));
139 static char *j_strsignal
PARAMS((int));
141 #if defined (HAVE_WAITPID)
142 static void reap_zombie_children
PARAMS((void));
145 #if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS)
146 static int siginterrupt
PARAMS((int, int));
149 static void restore_sigint_handler
PARAMS((void));
151 /* Allocate new, or grow existing PID_LIST. */
156 int old
= pid_list_size
;
159 pid_list
= (struct proc_status
*)xrealloc (pid_list
, pid_list_size
* sizeof (struct proc_status
));
161 /* None of the newly allocated slots have process id's yet. */
162 for (i
= old
; i
< pid_list_size
; i
++)
164 pid_list
[i
].pid
= NO_PID
;
165 pid_list
[i
].status
= pid_list
[i
].flags
= 0;
169 /* Return the offset within the PID_LIST array of an empty slot. This can
170 create new slots if all of the existing slots are taken. */
177 for (i
= 0; i
< pid_list_size
; i
++)
178 if (pid_list
[i
].pid
== NO_PID
|| pid_list
[i
].pid
== pid
)
181 if (i
== pid_list_size
)
187 /* Return the offset within the PID_LIST array of a slot containing PID,
188 or the value NO_PID if the pid wasn't found. */
190 find_index_by_pid (pid
)
195 for (i
= 0; i
< pid_list_size
; i
++)
196 if (pid_list
[i
].pid
== pid
)
202 /* Return the status of PID as looked up in the PID_LIST array. A
203 return value of PROC_BAD indicates that PID wasn't found. */
205 find_status_by_pid (pid
)
210 i
= find_index_by_pid (pid
);
213 if (pid_list
[i
].flags
& PROC_RUNNING
)
214 return (PROC_STILL_ALIVE
);
215 return (pid_list
[i
].status
);
219 process_exit_status (status
)
222 if (WIFSIGNALED (status
))
223 return (128 + WTERMSIG (status
));
225 return (WEXITSTATUS (status
));
228 /* Return the status of PID as looked up in the PID_LIST array. A
229 return value of PROC_BAD indicates that PID wasn't found. */
231 find_termsig_by_pid (pid
)
236 i
= find_index_by_pid (pid
);
239 if (pid_list
[i
].flags
& PROC_RUNNING
)
241 return (get_termsig ((WAIT
)pid_list
[i
].status
));
244 /* Set LAST_COMMAND_EXIT_SIGNAL depending on STATUS. If STATUS is -1, look
245 up PID in the pid array and set LAST_COMMAND_EXIT_SIGNAL appropriately
246 depending on its flags and exit status. */
251 if (WIFSTOPPED (status
) == 0 && WIFSIGNALED (status
))
252 return (WTERMSIG (status
));
257 /* Give PID the status value STATUS in the PID_LIST array. */
259 set_pid_status (pid
, status
)
265 #if defined (COPROCESS_SUPPORT)
266 coproc_pidchk (pid
, status
);
269 #if defined (PROCESS_SUBSTITUTION)
270 if ((slot
= find_procsub_child (pid
)) >= 0)
271 set_procsub_status (slot
, pid
, WSTATUS (status
));
272 /* XXX - also saving in list below */
275 slot
= find_index_by_pid (pid
);
279 pid_list
[slot
].status
= process_exit_status (status
);
280 pid_list
[slot
].flags
&= ~PROC_RUNNING
;
281 if (WIFSIGNALED (status
))
282 pid_list
[slot
].flags
|= PROC_SIGNALED
;
283 /* If it's not a background process, mark it as notified so it gets
285 if ((pid_list
[slot
].flags
& PROC_ASYNC
) == 0)
286 pid_list
[slot
].flags
|= PROC_NOTIFIED
;
289 /* Give PID the flags FLAGS in the PID_LIST array. */
291 set_pid_flags (pid
, flags
)
297 slot
= find_index_by_pid (pid
);
301 pid_list
[slot
].flags
|= flags
;
304 /* Unset FLAGS for PID in the pid list */
306 unset_pid_flags (pid
, flags
)
312 slot
= find_index_by_pid (pid
);
316 pid_list
[slot
].flags
&= ~flags
;
319 /* Return the flags corresponding to PID in the PID_LIST array. */
326 slot
= find_index_by_pid (pid
);
330 return (pid_list
[slot
].flags
);
340 slot
= find_proc_slot (pid
);
342 pid_list
[slot
].pid
= pid
;
343 pid_list
[slot
].status
= -1;
344 pid_list
[slot
].flags
= PROC_RUNNING
;
346 pid_list
[slot
].flags
|= PROC_ASYNC
;
350 mark_dead_jobs_as_notified (force
)
353 register int i
, ndead
;
355 /* first, count the number of non-running async jobs if FORCE == 0 */
356 for (i
= ndead
= 0; force
== 0 && i
< pid_list_size
; i
++)
358 if (pid_list
[i
].pid
== NO_PID
)
360 if (((pid_list
[i
].flags
& PROC_RUNNING
) == 0) &&
361 (pid_list
[i
].flags
& PROC_ASYNC
))
366 child_max
= getmaxchild ();
368 child_max
= DEFAULT_CHILD_MAX
;
370 if (force
== 0 && ndead
<= child_max
)
373 /* If FORCE == 0, we just mark as many non-running async jobs as notified
374 to bring us under the CHILD_MAX limit. */
375 for (i
= 0; i
< pid_list_size
; i
++)
377 if (pid_list
[i
].pid
== NO_PID
)
379 if (((pid_list
[i
].flags
& PROC_RUNNING
) == 0) &&
380 pid_list
[i
].pid
!= last_asynchronous_pid
)
382 pid_list
[i
].flags
|= PROC_NOTIFIED
;
383 if (force
== 0 && (pid_list
[i
].flags
& PROC_ASYNC
) && --ndead
<= child_max
)
389 /* Remove all dead, notified jobs from the pid_list. */
395 #if defined (HAVE_WAITPID)
396 reap_zombie_children ();
399 for (i
= 0; i
< pid_list_size
; i
++)
401 if (pid_list
[i
].pid
!= NO_PID
&&
402 (pid_list
[i
].flags
& PROC_RUNNING
) == 0 &&
403 (pid_list
[i
].flags
& PROC_NOTIFIED
))
404 pid_list
[i
].pid
= NO_PID
;
407 #if defined (COPROCESS_SUPPORT)
417 mark_dead_jobs_as_notified (0);
418 cleanup_dead_jobs ();
421 /* Initialize the job control mechanism, and set up the tty stuff. */
423 initialize_job_control (force
)
426 shell_tty
= fileno (stderr
);
433 /* Setup this shell to handle C-C, etc. */
435 initialize_job_signals ()
437 set_signal_handler (SIGINT
, sigint_sighandler
);
439 /* If this is a login shell we don't wish to be disturbed by
442 ignore_tty_job_signals ();
445 #if defined (HAVE_WAITPID)
446 /* Collect the status of all zombie children so that their system
447 resources can be deallocated. */
449 reap_zombie_children ()
451 # if defined (WNOHANG)
457 while ((pid
= waitpid (-1, (int *)&status
, WNOHANG
)) > 0)
458 set_pid_status (pid
, status
);
459 # endif /* WNOHANG */
465 #if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS)
467 #if !defined (SA_RESTART)
468 # define SA_RESTART 0
472 siginterrupt (sig
, flag
)
475 struct sigaction act
;
477 sigaction (sig
, (struct sigaction
*)NULL
, &act
);
480 act
.sa_flags
&= ~SA_RESTART
;
482 act
.sa_flags
|= SA_RESTART
;
484 return (sigaction (sig
, &act
, (struct sigaction
*)NULL
));
486 #endif /* !HAVE_SIGINTERRUPT && HAVE_POSIX_SIGNALS */
488 /* Fork, handling errors. Returns the pid of the newly made child, or 0.
489 COMMAND is just for remembering the name of the command; we don't do
490 anything else with it. ASYNC_P says what to do with the tty. If
491 non-zero, then don't give it away. */
493 make_child (command
, flags
)
498 int async_p
, forksleep
;
501 /* Discard saved memory. */
505 async_p
= (flags
& FORK_ASYNC
);
508 #if defined (BUFFERED_INPUT)
509 /* If default_buffered_input is active, we are reading a script. If
510 the command is asynchronous, we have already duplicated /dev/null
511 as fd 0, but have not changed the buffered stream corresponding to
512 the old fd 0. We don't want to sync the stream in this case. */
513 if (default_buffered_input
!= -1 && (!async_p
|| default_buffered_input
> 0))
514 sync_buffered_stream (default_buffered_input
);
515 #endif /* BUFFERED_INPUT */
517 /* Block SIGTERM here and unblock in child after fork resets the
518 set of pending signals */
519 if (interactive_shell
)
522 sigaddset (&set
, SIGTERM
);
524 sigprocmask (SIG_BLOCK
, &set
, &oset
);
525 set_signal_handler (SIGTERM
, SIG_DFL
);
528 /* Create the child, handle severe errors. Retry on EAGAIN. */
530 while ((pid
= fork ()) < 0 && errno
== EAGAIN
&& forksleep
< FORKSLEEP_MAX
)
532 sys_error ("fork: retry");
534 #if defined (HAVE_WAITPID)
535 /* Posix systems with a non-blocking waitpid () system call available
536 get another chance after zombies are reaped. */
537 reap_zombie_children ();
538 if (forksleep
> 1 && sleep (forksleep
) != 0)
541 if (sleep (forksleep
) != 0)
543 #endif /* HAVE_WAITPID */
548 if (interactive_shell
)
550 set_signal_handler (SIGTERM
, SIG_IGN
);
551 sigprocmask (SIG_SETMASK
, &oset
, (sigset_t
*)NULL
);
557 last_command_exit_value
= EX_NOEXEC
;
558 throw_to_top_level ();
563 #if defined (BUFFERED_INPUT)
564 unset_bush_input (0);
565 #endif /* BUFFERED_INPUT */
567 CLRINTERRUPT
; /* XXX - children have their own interrupt state */
569 /* Restore top-level signal mask. */
573 /* Ignore INT and QUIT in asynchronous children. */
575 last_asynchronous_pid
= getpid ();
578 default_tty_job_signals ();
587 last_asynchronous_pid
= pid
;
589 add_pid (pid
, async_p
);
595 ignore_tty_job_signals ()
597 #if defined (SIGTSTP)
598 set_signal_handler (SIGTSTP
, SIG_IGN
);
599 set_signal_handler (SIGTTIN
, SIG_IGN
);
600 set_signal_handler (SIGTTOU
, SIG_IGN
);
605 default_tty_job_signals ()
607 #if defined (SIGTSTP)
608 if (signal_is_trapped (SIGTSTP
) == 0 && signal_is_hard_ignored (SIGTSTP
))
609 set_signal_handler (SIGTSTP
, SIG_IGN
);
611 set_signal_handler (SIGTSTP
, SIG_DFL
);
612 if (signal_is_trapped (SIGTTIN
) == 0 && signal_is_hard_ignored (SIGTTIN
))
613 set_signal_handler (SIGTTIN
, SIG_IGN
);
615 set_signal_handler (SIGTTIN
, SIG_DFL
);
616 if (signal_is_trapped (SIGTTOU
) == 0 && signal_is_hard_ignored (SIGTTOU
))
617 set_signal_handler (SIGTTOU
, SIG_IGN
);
619 set_signal_handler (SIGTTOU
, SIG_DFL
);
623 /* Called once in a parent process. */
625 get_original_tty_job_signals ()
627 static int fetched
= 0;
631 #if defined (SIGTSTP)
632 if (interactive_shell
)
634 set_original_signal (SIGTSTP
, SIG_DFL
);
635 set_original_signal (SIGTTIN
, SIG_DFL
);
636 set_original_signal (SIGTTOU
, SIG_DFL
);
640 get_original_signal (SIGTSTP
);
641 get_original_signal (SIGTTIN
);
642 get_original_signal (SIGTTOU
);
649 /* Wait for a single pid (PID) and return its exit status. Called by
652 wait_for_single_pid (pid
, flags
)
660 pstatus
= find_status_by_pid (pid
);
662 if (pstatus
== PROC_BAD
)
664 internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid
);
668 if (pstatus
!= PROC_STILL_ALIVE
)
671 last_command_exit_signal
= find_termsig_by_pid (pid
);
675 siginterrupt (SIGINT
, 1);
676 while ((got_pid
= WAITPID (pid
, &status
, 0)) != pid
)
682 if (errno
!= EINTR
&& errno
!= ECHILD
)
684 siginterrupt (SIGINT
, 0);
689 else if (got_pid
> 0)
690 set_pid_status (got_pid
, status
);
695 set_pid_status (got_pid
, status
);
696 set_pid_flags (got_pid
, PROC_NOTIFIED
);
699 siginterrupt (SIGINT
, 0);
703 return (got_pid
> 0 ? process_exit_status (status
) : -1);
706 /* Wait for all of the shell's children to exit. Called by the `wait'
709 wait_for_background_pids (ps
)
715 /* If we aren't using job control, we let the kernel take care of the
716 bookkeeping for us. wait () will return -1 and set errno to ECHILD
717 when there are no more unwaited-for child processes on both
718 4.2 BSD-based and System V-based systems. */
720 siginterrupt (SIGINT
, 1);
722 /* Wait for ECHILD */
723 waiting_for_child
= 1;
724 while ((got_pid
= WAITPID (-1, &status
, 0)) != -1)
726 waiting_for_child
= 0;
727 set_pid_status (got_pid
, status
);
731 ps
->status
= process_exit_status (status
);
733 waiting_for_child
= 1;
736 waiting_for_child
= 0;
738 if (errno
!= EINTR
&& errno
!= ECHILD
)
740 siginterrupt (SIGINT
, 0);
744 siginterrupt (SIGINT
, 0);
748 mark_dead_jobs_as_notified (1);
749 cleanup_dead_jobs ();
753 wait_sigint_cleanup ()
757 /* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */
758 #define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids
759 static SigHandler
*old_sigint_handler
= INVALID_SIGNAL_HANDLER
;
762 restore_sigint_handler ()
764 if (old_sigint_handler
!= INVALID_SIGNAL_HANDLER
)
766 set_signal_handler (SIGINT
, old_sigint_handler
);
767 old_sigint_handler
= INVALID_SIGNAL_HANDLER
;
771 /* Handle SIGINT while we are waiting for children in a script to exit.
772 All interrupts are effectively ignored by the shell, but allowed to
773 kill a running job. */
775 wait_sigint_handler (sig
)
778 SigHandler
*sigint_handler
;
780 /* If we got a SIGINT while in `wait', and SIGINT is trapped, do
781 what POSIX.2 says (see builtins/wait.def for more info). */
782 if (this_shell_builtin
&& this_shell_builtin
== wait_builtin
&&
783 signal_is_trapped (SIGINT
) &&
784 ((sigint_handler
= trap_to_sighandler (SIGINT
)) == trap_handler
))
786 last_command_exit_value
= 128+SIGINT
;
787 restore_sigint_handler ();
788 trap_handler (SIGINT
); /* set pending_traps[SIGINT] */
789 wait_signal_received
= SIGINT
;
793 wait_sigint_received
= 1;
802 static char retcode_name_buffer
[64] = { '\0' };
808 x
= retcode_name_buffer
;
809 sprintf (x
, "Signal %d", s
);
814 /* Wait for pid (one of our children) to terminate. This is called only
815 by the execution code in execute_cmd.c. */
817 wait_for (pid
, flags
)
821 int return_val
, pstatus
;
825 pstatus
= find_status_by_pid (pid
);
827 if (pstatus
== PROC_BAD
)
830 if (pstatus
!= PROC_STILL_ALIVE
)
833 last_command_exit_signal
= find_termsig_by_pid (pid
);
837 /* If we are running a script, ignore SIGINT while we're waiting for
838 a child to exit. The loop below does some of this, but not all. */
839 wait_sigint_received
= 0;
840 if (interactive_shell
== 0)
841 old_sigint_handler
= set_signal_handler (SIGINT
, wait_sigint_handler
);
843 waiting_for_child
= 1;
845 while ((got_pid
= WAITPID (-1, &status
, 0)) != pid
) /* XXX was pid now -1 */
847 waiting_for_child
= 0;
850 if (got_pid
< 0 && errno
== ECHILD
)
852 #if !defined (_POSIX_VERSION)
853 status
.w_termsig
= status
.w_retcode
= 0;
856 #endif /* _POSIX_VERSION */
859 else if (got_pid
< 0 && errno
!= EINTR
)
860 programming_error ("wait_for(%ld): %s", (long)pid
, strerror(errno
));
861 else if (got_pid
> 0)
862 set_pid_status (got_pid
, status
);
863 waiting_for_child
= 1;
865 waiting_for_child
= 0;
868 set_pid_status (got_pid
, status
);
870 #if defined (HAVE_WAITPID)
872 reap_zombie_children ();
873 #endif /* HAVE_WAITPID */
878 if (interactive_shell
== 0)
880 SigHandler
*temp_handler
;
882 temp_handler
= old_sigint_handler
;
883 restore_sigint_handler ();
885 /* If the job exited because of SIGINT, make sure the shell acts as if
886 it had received one also. */
887 if (WIFSIGNALED (status
) && (WTERMSIG (status
) == SIGINT
))
890 if (maybe_call_trap_handler (SIGINT
) == 0)
892 if (temp_handler
== SIG_DFL
)
893 termsig_handler (SIGINT
);
894 else if (temp_handler
!= INVALID_SIGNAL_HANDLER
&& temp_handler
!= SIG_IGN
)
895 (*temp_handler
) (SIGINT
);
900 /* Default return value. */
901 /* ``a full 8 bits of status is returned'' */
902 return_val
= process_exit_status (status
);
903 last_command_exit_signal
= get_termsig (status
);
905 #if defined (DONT_REPORT_SIGPIPE) && defined (DONT_REPORT_SIGTERM)
906 # define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE && (x) != SIGTERM)
907 #elif !defined (DONT_REPORT_SIGPIPE) && !defined (DONT_REPORT_SIGTERM)
908 # define REPORTSIG(x) ((x) != SIGINT)
909 #elif defined (DONT_REPORT_SIGPIPE)
910 # define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE)
912 # define REPORTSIG(x) ((x) != SIGINT && (x) != SIGTERM)
915 if ((WIFSTOPPED (status
) == 0) && WIFSIGNALED (status
) && REPORTSIG(WTERMSIG (status
)))
917 fprintf (stderr
, "%s", j_strsignal (WTERMSIG (status
)));
918 if (WIFCORED (status
))
919 fprintf (stderr
, _(" (core dumped)"));
920 fprintf (stderr
, "\n");
923 if (interactive_shell
&& subshell_environment
== 0)
925 if (WIFSIGNALED (status
) || WIFSTOPPED (status
))
930 else if (interactive_shell
== 0 && subshell_environment
== 0 && check_window_size
)
931 get_new_window_size (0, (int *)0, (int *)0);
936 /* Send PID SIGNAL. Returns -1 on failure, 0 on success. If GROUP is non-zero,
937 or PID is less than -1, then kill the process group associated with PID. */
939 kill_pid (pid
, signal
, group
)
950 result
= group
? killpg (pid
, signal
) : kill (pid
, signal
);
954 static TTYSTRUCT shell_tty_info
;
955 static int got_tty_state
;
957 /* Fill the contents of shell_tty_info with the current tty info. */
966 ttgetattr (tty
, &shell_tty_info
);
968 if (check_window_size
)
969 get_new_window_size (0, (int *)0, (int *)0);
974 /* Make the current tty use the state in shell_tty_info. */
983 if (got_tty_state
== 0)
985 ttsetattr (tty
, &shell_tty_info
);
990 /* Give the terminal to PGRP. */
992 give_terminal_to (pgrp
, force
)
999 /* Stop a pipeline. */
1001 stop_pipeline (async
, ignore
)
1005 already_making_children
= 0;
1012 already_making_children
= 1;
1016 stop_making_children ()
1018 already_making_children
= 0;
1021 /* The name is kind of a misnomer, but it's what the job control code uses. */
1023 without_job_control ()
1025 stop_making_children ();
1026 last_made_pid
= NO_PID
; /* XXX */
1030 get_job_by_pid (pid
, block
, ignore
)
1037 i
= find_index_by_pid (pid
);
1038 return ((i
== NO_PID
) ? PROC_BAD
: i
);
1041 /* Print descriptive information about the job with leader pid PID. */
1046 fprintf (stderr
, "%ld\n", (long) pid
);
1056 unfreeze_jobs_list ()
1061 set_jobs_list_frozen (s
)