exec.h revision 12251
11541Srgrimes/*-
21541Srgrimes * Copyright (c) 1992, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes * (c) UNIX System Laboratories, Inc.
51541Srgrimes * All or some portions of this file are derived from material licensed
61541Srgrimes * to the University of California by American Telephone and Telegraph
71541Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with
81541Srgrimes * the permission of UNIX System Laboratories, Inc.
91541Srgrimes *
101541Srgrimes * Redistribution and use in source and binary forms, with or without
111541Srgrimes * modification, are permitted provided that the following conditions
121541Srgrimes * are met:
131541Srgrimes * 1. Redistributions of source code must retain the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer.
151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
161541Srgrimes *    notice, this list of conditions and the following disclaimer in the
171541Srgrimes *    documentation and/or other materials provided with the distribution.
181541Srgrimes * 3. All advertising materials mentioning features or use of this software
191541Srgrimes *    must display the following acknowledgement:
201541Srgrimes *	This product includes software developed by the University of
211541Srgrimes *	California, Berkeley and its contributors.
221541Srgrimes * 4. Neither the name of the University nor the names of its contributors
231541Srgrimes *    may be used to endorse or promote products derived from this software
241541Srgrimes *    without specific prior written permission.
251541Srgrimes *
261541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361541Srgrimes * SUCH DAMAGE.
371541Srgrimes *
381541Srgrimes *	@(#)exec.h	8.3 (Berkeley) 1/21/94
3912251Sbde * $Id: exec.h,v 1.10 1995/03/16 18:16:15 bde Exp $
401541Srgrimes */
411541Srgrimes
422165Spaul#ifndef _SYS_EXEC_H_
432165Spaul#define _SYS_EXEC_H_
442165Spaul
451541Srgrimes/*
461541Srgrimes * The following structure is found at the top of the user stack of each
471541Srgrimes * user process. The ps program uses it to locate argv and environment
481541Srgrimes * strings. Programs that wish ps to display other information may modify
491541Srgrimes * it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr
501541Srgrimes * is the same as the program's argc. The fields ps_envstr and ps_nenvstr
511541Srgrimes * are the equivalent for the environment.
521541Srgrimes */
531541Srgrimesstruct ps_strings {
541541Srgrimes	char	*ps_argvstr;	/* first of 0 or more argument strings */
551541Srgrimes	int	ps_nargvstr;	/* the number of argument strings */
561541Srgrimes	char	*ps_envstr;	/* first of 0 or more environment strings */
571541Srgrimes	int	ps_nenvstr;	/* the number of environment strings */
581541Srgrimes};
591541Srgrimes
601541Srgrimes/*
611541Srgrimes * Address of ps_strings structure (in user space).
621541Srgrimes */
633471Ssos#define SPARE_USRSPACE	256
643471Ssos#define	PS_STRINGS ((struct ps_strings *) \
653471Ssos		(USRSTACK - sizeof(struct ps_strings) - SPARE_USRSPACE))
661541Srgrimes
6712251Sbdestruct image_params;
6812251Sbde
692124Sdgstruct execsw {
7012251Sbde	int (*ex_imgact)(struct image_params *);
712124Sdg	const char *ex_name;
722124Sdg};
732124Sdg
742124Sdg#ifdef KERNEL
752124Sdgextern const struct execsw **execsw;
762124Sdg
772124Sdg#endif
782124Sdg
793058Sdg#include <machine/exec.h>
803058Sdg
812165Spaul#endif
82