1231200Smm/* $NetBSD: fstat.h,v 1.11 2022/06/19 11:31:19 simonb Exp $ */ 2231200Smm/*- 3231200Smm * Copyright (c) 1988, 1993 4231200Smm * The Regents of the University of California. All rights reserved. 5231200Smm * 6231200Smm * Redistribution and use in source and binary forms, with or without 7231200Smm * modification, are permitted provided that the following conditions 8231200Smm * are met: 9231200Smm * 1. Redistributions of source code must retain the above copyright 10231200Smm * notice, this list of conditions and the following disclaimer. 11231200Smm * 2. Redistributions in binary form must reproduce the above copyright 12231200Smm * notice, this list of conditions and the following disclaimer in the 13231200Smm * documentation and/or other materials provided with the distribution. 14231200Smm * 3. Neither the name of the University nor the names of its contributors 15231200Smm * may be used to endorse or promote products derived from this software 16231200Smm * without specific prior written permission. 17231200Smm * 18231200Smm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19231200Smm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20231200Smm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21231200Smm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22231200Smm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23231200Smm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24231200Smm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25231200Smm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26231200Smm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27231200Smm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28231200Smm * SUCH DAMAGE. 29231200Smm */ 30231200Smm 31231200Smmstruct filestat { 32231200Smm long fsid; 33231200Smm ino_t fileid; 34231200Smm mode_t mode; 35231200Smm off_t size; 36231200Smm dev_t rdev; 37231200Smm}; 38231200Smm 39231200Smm/* 40231200Smm * a kvm_read that returns true if everything is read 41231200Smm */ 42231200Smm#define KVM_READ(kaddr, paddr, len) \ 43231200Smm ((size_t)kvm_read(kd, (u_long)(kaddr), (void *)(paddr), (len)) \ 44231200Smm == (size_t)(len)) 45231200Smm#define KVM_NLIST(nl) \ 46231200Smm kvm_nlist(kd, (nl)) 47231200Smm#define KVM_GETERR() \ 48231200Smm kvm_geterr(kd) 49231200Smm 50231200Smmextern kvm_t *kd; 51231200Smmextern int vflg; 52231200Smmextern pid_t Pid; 53231200Smm 54231200Smm#define dprintf if (vflg) warnx 55231200Smm 56231200Smmmode_t getftype(enum vtype); 57231200Smmstruct file; 58231200Smmint pmisc(struct file *, const char *); 59231200Smmint isofs_filestat(struct vnode *, struct filestat *); 60248616Smmint ntfs_filestat(struct vnode *, struct filestat *); 61231200Smmint ptyfs_filestat(struct vnode *, struct filestat *); 62231200Smmint tmpfs_filestat(struct vnode *, struct filestat *); 63231200Smmint zfs_filestat(struct vnode *, struct filestat *); 64231200Smmvoid oprint(struct file *, const char *); 65231200Smm