/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef JOB_NFLAG
/*
* Interface to job control for shell
* written by David Korn
*
*/
#include <ast.h>
#include <sfio.h>
#ifndef SIGINT
# include <signal.h>
#endif /* !SIGINT */
#endif
#ifdef SIGCHLD
# include "terminal.h"
# ifdef FIOLOOKLD
/* Ninth edition */
# endif /* FIOLOOKLD */
#else
# define SH_MONITOR 0
# define job_set(x)
# define job_reset(x)
#endif
struct process
{
#ifdef JOBS
#endif /* JOBS */
};
struct jobs
{
#ifdef SHOPT_BGX
#endif /* SHOPT_BGX */
#ifdef JOBS
#endif /* JOBS */
};
/* flags for joblist */
#ifdef JOBS
#if !_std_malloc
#include <vmalloc.h>
#if VMALLOC_VERSION >= 20070911L
#endif
#endif
#ifndef vmbusy
#define vmbusy() 0
#endif
#define job_unlock() \
do { \
int sig; \
{ \
job.in_critical--; \
} \
} while(0)
extern const char e_jobusage[];
extern const char e_done[];
extern const char e_running[];
extern const char e_coredump[];
extern const char e_no_proc[];
extern const char e_no_job[];
extern const char e_jobsrunning[];
extern const char e_nlspace[];
extern const char e_access[];
extern const char e_terminate[];
extern const char e_no_jctl[];
extern const char e_signo[];
#ifdef SIGTSTP
extern const char e_no_start[];
#endif /* SIGTSTP */
#ifdef NTTYDISC
extern const char e_newtty[];
extern const char e_oldtty[];
#endif /* NTTYDISC */
#endif /* JOBS */
/*
* The following are defined in jobs.c
*/
extern void job_clear(void);
extern void job_bwait(char**);
extern void *job_subsave(void);
extern void job_subrestore(void*);
#ifdef SHOPT_BGX
extern void job_chldtrap(Shell_t*, const char*,int);
#endif /* SHOPT_BGX */
#ifdef JOBS
extern int job_terminate(struct process*,int);
extern int job_switch(struct process*,int);
extern int job_reap(int);
#else
# define job_close(s) (0)
# define job_fork(p)
#endif /* JOBS */
#endif /* !JOB_NFLAG */