pioctl.h revision 217747
1301256Sdelphij/*- 2258945Sroberto * Copyright 1997 Sean Eric Fagan 3275970Scy * 4301256Sdelphij * Redistribution and use in source and binary forms, with or without 5301256Sdelphij * modification, are permitted provided that the following conditions 6301256Sdelphij * are met: 7258945Sroberto * 1. Redistributions of source code must retain the above copyright 8258945Sroberto * notice, this list of conditions and the following disclaimer. 9258945Sroberto * 2. Redistributions in binary form must reproduce the above copyright 10258945Sroberto * notice, this list of conditions and the following disclaimer in the 11301256Sdelphij * documentation and/or other materials provided with the distribution. 12258945Sroberto * 3. All advertising materials mentioning features or use of this software 13258945Sroberto * must display the following acknowledgement: 14258945Sroberto * This product includes software developed by Sean Eric Fagan 15258945Sroberto * 4. Neither the name of the author may be used to endorse or promote 16301256Sdelphij * products derived from this software without specific prior written 17258945Sroberto * permission. 18258945Sroberto * 19258945Sroberto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20258945Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21258945Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22258945Sroberto * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23258945Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24258945Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25258945Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26258945Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27258945Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28258945Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29301256Sdelphij * SUCH DAMAGE. 30258945Sroberto * 31258945Sroberto */ 32258945Sroberto 33301256Sdelphij/* 34301256Sdelphij * procfs ioctl definitions. 35301256Sdelphij * 36275970Scy * $FreeBSD: head/sys/sys/pioctl.h 217747 2011-01-23 12:44:17Z kib $ 37275970Scy */ 38275970Scy 39275970Scy#ifndef _SYS_PIOCTL_H 40275970Scy# define _SYS_PIOCTL_H 41275970Scy 42258945Sroberto# include <sys/ioccom.h> 43301256Sdelphij 44258945Srobertostruct procfs_status { 45258945Sroberto int state; /* Running, stopped, something else? */ 46301256Sdelphij int flags; /* Any flags */ 47301256Sdelphij unsigned long events; /* Events to stop on */ 48301256Sdelphij int why; /* What event, if any, proc stopped on */ 49301256Sdelphij unsigned long val; /* Any extra data */ 50301256Sdelphij}; 51301256Sdelphij 52301256Sdelphij# define PIOCBIS _IOWINT('p', 1) /* Set event flag */ 53301256Sdelphij# define PIOCBIC _IOWINT('p', 2) /* Clear event flag */ 54301256Sdelphij# define PIOCSFL _IOWINT('p', 3) /* Set flags */ 55301256Sdelphij /* wait for proc to stop */ 56301256Sdelphij# define PIOCWAIT _IOR('p', 4, struct procfs_status) 57301256Sdelphij# define PIOCCONT _IOWINT('p', 5) /* Continue a process */ 58301256Sdelphij /* Get proc status */ 59301256Sdelphij# define PIOCSTATUS _IOR('p', 6, struct procfs_status) 60301256Sdelphij# define PIOCGFL _IOR('p', 7, unsigned int) /* Get flags */ 61301256Sdelphij 62301256Sdelphij# define S_EXEC 0x00000001 /* stop-on-exec */ 63301256Sdelphij# define S_SIG 0x00000002 /* stop-on-signal */ 64301256Sdelphij# define S_SCE 0x00000004 /* stop on syscall entry */ 65301256Sdelphij# define S_SCX 0x00000008 /* stop on syscall exit */ 66301256Sdelphij# define S_CORE 0x00000010 /* stop on coredump */ 67301256Sdelphij# define S_EXIT 0x00000020 /* stop on exit */ 68301256Sdelphij# define S_ALLSTOPS 0x003f /* stop on all events */ 69301256Sdelphij 70301256Sdelphij/* 71301256Sdelphij * If PF_LINGER is set in procp->p_pfsflags, then the last close 72301256Sdelphij * of a /proc/<pid>/mem file will not clear out the stops and continue 73301256Sdelphij * the process. 74301256Sdelphij */ 75301256Sdelphij 76301256Sdelphij# define PF_LINGER 0x01 /* Keep stops around after last close */ 77301256Sdelphij# define PF_ISUGID 0x02 /* Ignore UID/GID changes */ 78301256Sdelphij# define PF_FORK 0x04 /* Retain settings on fork() */ 79301256Sdelphij#endif 80301256Sdelphij