1/* 2 * dstore.c -- Darwin global storage for libproc-based lsof 3 */ 4 5 6/* 7 * Portions Copyright 2005 Apple Computer, Inc. All rights reserved. 8 * 9 * Copyright 2005 Purdue Research Foundation, West Lafayette, Indiana 10 * 47907. All rights reserved. 11 * 12 * Written by Allan Nathanson, Apple Computer, Inc., and Victor A. 13 * Abell, Purdue University. 14 * 15 * This software is not subject to any license of the American Telephone 16 * and Telegraph Company or the Regents of the University of California. 17 * 18 * Permission is granted to anyone to use this software for any purpose on 19 * any computer system, and to alter it and redistribute it freely, subject 20 * to the following restrictions: 21 * 22 * 1. Neither the authors, nor Apple Computer, Inc. nor Purdue University 23 * are responsible for any consequences of the use of this software. 24 * 25 * 2. The origin of this software must not be misrepresented, either 26 * by explicit claim or by omission. Credit to the authors, Apple 27 * Computer, Inc. and Purdue University must appear in documentation 28 * and sources. 29 * 30 * 3. Altered versions must be plainly marked as such, and must not be 31 * misrepresented as being the original software. 32 * 33 * 4. This notice may not be removed or altered. 34 */ 35 36 37#ifndef lint 38static char copyright[] = 39"@(#) Copyright 2005 Apple Computer, Inc. and Purdue Research Foundation.\nAll rights reserved.\n"; 40static char *rcsid = "$Id: dstore.c,v 1.4 2008/10/21 16:15:16 abe Exp $"; 41#endif 42 43 44#include "lsof.h" 45 46 47#if defined(HASFSTRUCT) 48/* 49 * Pff_tab[] - table for printing file flags 50 */ 51 52struct pff_tab Pff_tab[] = { 53 { (long)FREAD, FF_READ }, 54 { (long)FWRITE, FF_WRITE }, 55 { (long)FNONBLOCK, FF_NBLOCK }, 56 { (long)FNDELAY, FF_NDELAY }, 57 { (long)FAPPEND, FF_APPEND }, 58 { (long)FASYNC, FF_ASYNC }, 59 { (long)FFSYNC, FF_FSYNC }, 60 61# if defined(FHASLOCK) 62 { (long)FHASLOCK, FF_HASLOCK }, 63# endif /* defined(FHASLOCK) */ 64 65 { (long)O_NOCTTY, FF_NOCTTY }, 66 { (long)O_EVTONLY, FF_EVTONLY }, 67 { (long)0, NULL } 68}; 69 70 71/* 72 * Pof_tab[] - table for print process open file flags 73 */ 74 75struct pff_tab Pof_tab[] = { 76 77# if defined(PROC_FP_SHARED) 78 { (long)PROC_FP_SHARED, "SH" }, 79# endif /* defined(PROC_FP_SHARED) */ 80 81# if defined(PROC_FP_CLEXEC) 82 { (long)PROC_FP_CLEXEC, POF_CLOEXEC }, 83# endif /* defined(PROC_FP_CLEXEC) */ 84 85# if defined(PROC_FP_GUARDED) 86 { (long)PROC_FP_GUARDED,"GRD" }, 87# endif /* defined(PROC_FP_GUARDED) */ 88 89 { (long)0, NULL } 90}; 91 92 93/* 94 * Pgf_tab[] - table for print process open file guard flags 95 */ 96 97# if defined(PROC_FP_GUARDED) 98struct pff_tab Pgf_tab[] = { 99 { (long)PROC_FI_GUARD_CLOSE, "CLOSE" }, 100 { (long)PROC_FI_GUARD_DUP, "DUP" }, 101 { (long)PROC_FI_GUARD_SOCKET_IPC, "SOCKET" }, 102 { (long)PROC_FI_GUARD_FILEPORT, "FILEPORT" }, 103 104 { (long)0, NULL } 105}; 106# endif /* defined(PROC_FP_GUARDED) */ 107 108#endif /* defined(HASFSTRUCT) */ 109