DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T r

⟦c27c4ea0a⟧ TextFile

    Length: 4779 (0x12ab)
    Types: TextFile
    Notes: @(#)run.h 13.1 (RC International) 91/02/02 */
    Names: »run.h«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/include/sys/run.h« 

TextFile

/*	@(#)run.h	13.1 (RC International) 91/02/02	*/

/*
 * Current run information structure version number
 */

#define RI_VERSNO	3

/*
 * Structure to descibe file to be newly opened in the child
 */

struct chldopn
{
    char	*cho_path;	/* path name to open */
    int		cho_flags;	/* flags to open */
    int		cho_mode;	/* modes to open */
};

/*
 * The run() information structure
 */

struct runinfo
{
    char	ri_version;	/* run info version # */
    short	ri_sflags;	/* start up flags */
    int		ri_dbgfd;	/* out: debug file desc of child process */
    int		ri_result;	/* out: additional error codes */

    /* Process site selection information */

    enum ri_runsite		/* which criteria */
    {
	RI_DEFAULT = 0,		/* System selected criteria */
	RI_THISPU,		/* PU of calling process */
	RI_PUID,		/* PU id, 0 == this PU */
	RI_PUNAME,		/* PU name */
	RI_LOADAV,		/* Minimum load average */
	RI_FREEMEM,		/* Maximum free memory */
	RI_RANDOM,		/* Randomly chosen */
	RI_PATH,		/* Node of file named by path */
	RI_FD,			/* Node of file open on descriptor */
	RI_PID,			/* Node on which process pid exists */
    } ri_which;
    union 			/* criteria dependent info */
    {
	int	rips_puid;	/* if RI_PUID */
	char	*rips_puname;	/* if RI_PUNAME */
	char	*rips_path;	/* if RI_PATH */
	int	rips_fd;	/* if RI_FD */
	int	rips_pid;	/* if RI_ID */
    } rips_un;

    /* Processes and protection information */

    short	ri_ruid;		/* real user id */
    short	ri_euid;		/* effective user id */
    short	ri_rgid;		/* real group id */
    short	ri_egid;		/* effective group id */
    int		ri_ngroups;		/* # entries in ri_gidset */
    int		ri_gidset[NGROUPS];	/* group ids for access list */
    int		ri_pgrp;		/* make psession leader */

    /* Signal management information */

    int		ri_dflmask;	/* mask of signals to set to SIG_DFL */
    int		ri_ignmask;	/* mask of signals to set to SIG_IGN */
    int		ri_blkmask;	/* mask of signals to be blocked */

    /* Descriptor management information */

    int			ri_nfds;	/* # file descriptors to remap */
    int			*ri_fdmap;	/* file descriptor remap array */
    int			ri_newcnt;	/* # elements in newfds struct array */
    struct chldopn	*ri_newfds;	/* descibes files to open in child */
    int			ri_fdttypgrp;	/* file descriptor on which to
					 * perform TIOCSPGRP ioctl to 
					 * process group of new process
					 */

    /* Resource controls information */

    int			ri_prio;		/* process priority */
    struct rlimit	ri_rlimit[RLIM_NLIMITS];/* rlimit structures */

    /* Miscellaneous */
    UID_T	ri_subpu;		/* uid of associated subpu */

    /* Spares */
    int		ri_spare[4];
};

/*
 * Definitions for easy reference of criteria dependent info
 */

#define ri_puid		rips_un.rips_puid
#define ri_puname	rips_un.rips_puname
#define ri_path		rips_un.rips_path
#define ri_fd		rips_un.rips_fd
#define ri_pid		rips_un.rips_pid

/*
 * Definitions of start up flags in ri_sflags,
 * macro to determine if child inherits parents fd's not in remap array,
 * and mask of all valid user settable bits in ri_sflags
 */

#define RI_DBGWT	0x0001	/* stop and wait for debugger */
#define RI_RDBGFD	0x0002	/* return debug file desc of child process */
#define	RI_CNOTTY	0x0004	/* CNOTTY ioctl after all file (re-)opens */
#define	RI_NOINHERIT	0x0008	/* only open files in fd array in the child */
#define	RI_VHUP		0x0010	/* vhangup equivilant on control terminal */
#define	RI_SIGMSK	0x0020	/* user can set 0 p_sigmask via ri_blkmask */
#define RI_SUBPU	0x0040	/* user specifies subpu, inherit otherwise */

#define	RI_PARENT	0x4000	/* parent using the runinfo structure */
#define	RI_CHILD	0x8000	/* child using the runinfo structure */

#define	RI_SFVAL	(RI_DBGWT | RI_RDBGFD | RI_CNOTTY | RI_NOINHERIT \
					| RI_VHUP | RI_SIGMSK | RI_SUBPU )
#define	RI_NINH(r)	(r->ri_sflags & RI_NOINHERIT ? TRUE : FALSE)

/*
 * Definition(s) of file ops flag(s) in ri_fdmap,
 * and a macro to extract the index portion only
 */

#define	RI_CLOSE	0x00010000	/* close file in parent */
#define	RI_NODUP	0x00020000	/* do not "dup" the fd */
#define	RI_OPEN		0x00040000	/* new file open in child */
#define	RI_CHLDDUP	0x00100000	/* share with parent */

#define RI_INDEX(fdmp)	(fdmp & 0xffff)

/*
 * Definitions for selecting default process attributes
 */

#define	RI_PROC_DEF	-1	/* for all but following special cases */
#define	RI_SIGMASK_SAME	0	/* ri_dflmask/ri_ignmask/ri_blkmask */
#define RI_PRIO_SAME	(1<<31)	/* ri_prio */

/*
 * Definition(s) for making special process attribute selections
 */

#define RI_SESS_CPID  0            /* make new process session leader and
				      group leader */
#define RI_PGRP_CPID  RI_SESS_CPID /* old BSD name; 
                                      set new process' pgrp = new process' pid */