pioctl.h revision 31898
138465Smsmith/*
238465Smsmith * Copryight 1997 Sean Eric Fagan
338465Smsmith *
438465Smsmith * Redistribution and use in source and binary forms, with or without
538465Smsmith * modification, are permitted provided that the following conditions
638465Smsmith * are met:
738465Smsmith * 1. Redistributions of source code must retain the above copyright
838465Smsmith *    notice, this list of conditions and the following disclaimer.
938465Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1038465Smsmith *    notice, this list of conditions and the following disclaimer in the
1138465Smsmith *    documentation and/or other materials provided with the distribution.
1238465Smsmith * 3. All advertising materials mentioning features or use of this software
1338465Smsmith *    must display the following acknowledgement:
1438465Smsmith *	This product includes software developed by Sean Eric Fagan
1538465Smsmith * 4. Neither the name of the author may be used to endorse or promote
1638465Smsmith *    products derived from this software without specific prior written
1738465Smsmith *    permission.
1838465Smsmith *
1938465Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2038465Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2138465Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2238465Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2338465Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2438465Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2538465Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2640393Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2738465Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2838465Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2939902Smsmith * SUCH DAMAGE.
3039902Smsmith *
3138465Smsmith */
3240146Speter
3339902Smsmith/*
3438465Smsmith * procfs ioctl definitions.
3539902Smsmith *
3639902Smsmith * $Id: pioctl.h,v 1.6 1997/12/20 03:05:35 sef Exp $
3738465Smsmith */
3839902Smsmith
3938465Smsmith#ifndef _SYS_PIOCTL_H
4038465Smsmith# define _SYS_PIOCTL_H
4138465Smsmith
4238465Smsmith# include <sys/ioccom.h>
4338465Smsmith
4438465Smsmithstruct procfs_status {
4538465Smsmith	int	state;	/* Running, stopped, something else? */
4638465Smsmith	int	flags;	/* Any flags */
4738465Smsmith	unsigned long	events;	/* Events to stop on */
4838465Smsmith	int	why;	/* What event, if any, proc stopped on */
4938465Smsmith	unsigned long	val;	/* Any extra data */
5038465Smsmith};
5138465Smsmith
5238465Smsmith# define	PIOCBIS	_IOC(IOC_IN, 'p', 1, 0)	/* Set event flag */
5338465Smsmith# define	PIOCBIC	_IOC(IOC_IN, 'p', 2, 0)	/* Clear event flag */
5438465Smsmith# define	PIOCSFL	_IOC(IOC_IN, 'p', 3, 0)	/* Set flags */
5538465Smsmith			/* wait for proc to stop */
5638465Smsmith# define	PIOCWAIT	_IOR('p', 4, struct procfs_status)
5738465Smsmith# define	PIOCCONT	_IOC(IOC_IN, 'p', 5, 0)	/* Continue a process */
5838465Smsmith			/* Get proc status */
5938465Smsmith# define	PIOCSTATUS	_IOR('p', 6, struct procfs_status)
6038465Smsmith# define	PIOCGFL	_IOR('p', 7, unsigned int)	/* Get flags */
6138465Smsmith
6238465Smsmith# define S_EXEC	0x00000001	/* stop-on-exec */
6338465Smsmith# define	S_SIG	0x00000002	/* stop-on-signal */
6438465Smsmith# define	S_SCE	0x00000004	/* stop on syscall entry */
6538465Smsmith# define	S_SCX	0x00000008	/* stop on syscall exit */
6639178Smsmith# define	S_CORE	0x00000010	/* stop on coredump */
6738465Smsmith# define	S_EXIT	0x00000020	/* stop on exit */
6838465Smsmith
6938465Smsmith/*
7038465Smsmith * If PF_LINGER is set in procp->p_pfsflags, then the last close
7138465Smsmith * of a /proc/<pid>/mem file will nto clear out the stops and continue
7238465Smsmith * the process.
7338465Smsmith */
7438465Smsmith
7538465Smsmith# define PF_LINGER	0x01	/* Keep stops around after last close */
7638465Smsmith# define PF_ISUGID	0x02	/* Ignore UID/GID changes */
7738465Smsmith#endif
7838465Smsmith