Displaying 2 results from an estimated 2 matches for "forkchild".
Did you mean:
fork_child
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...curjob;
+/* Set if we are in the vforked child */
+int vforked;
+
STATIC void set_curjob(struct job *, unsigned);
STATIC int jobno(const struct job *);
STATIC int sprint_status(char *, int, int);
@@ -839,20 +843,29 @@ growjobtab(void)
* Called with interrupts off.
*/
-STATIC inline void
-forkchild(struct job *jp, union node *n, int mode)
+static void forkchild(struct job *jp, union node *n, int mode)
{
+ int lvforked;
int oldlvl;
TRACE(("Child shell %d\n", getpid()));
+
oldlvl = shlvl;
- shlvl++;
+ lvforked = vforked;
+
+ if (!lvforked) {
+ shlvl++;
+
+ closescript();
+...
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Only clear gotsigchld when waiting for everything
...ob(*argv, 0);
/* loop until process terminated or stopped */
- while (job->state == JOBRUNNING)
- if (dowait(DOWAIT_WAITCMD, 0) <= 0)
- goto sigout;
+ if (!dowait(DOWAIT_WAITCMD, job))
+ goto sigout;
job->waited = 1;
retval = getstatus(job);
repeat:
@@ -889,18 +885,14 @@ forkchild(struct job *jp, union node *n, int mode)
}
for (jp = curjob; jp; jp = jp->prev_job)
freejob(jp);
- jobless = 0;
}
STATIC inline void
forkparent(struct job *jp, union node *n, int mode, pid_t pid)
{
TRACE(("In parent shell: child = %d\n", pid));
- if (!jp) {
- while (jo...