Annotation of src/usr.bin/rdistd/filesys.h, Revision 1.4
1.4 ! millert 1: /* $OpenBSD$ */
! 2:
1.1 dm 3: /*
4: * Copyright (c) 1983 Regents of the University of California.
5: * All rights reserved.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
15: * 3. All advertising materials mentioning features or use of this software
16: * must display the following acknowledgement:
17: * This product includes software developed by the University of
18: * California, Berkeley and its contributors.
19: * 4. Neither the name of the University nor the names of its contributors
20: * may be used to endorse or promote products derived from this software
21: * without specific prior written permission.
22: *
23: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: * SUCH DAMAGE.
34: */
35:
36: /*
1.4 ! millert 37: * $From: filesys.h,v 6.19 1995/12/12 00:46:46 mcooper Exp $
1.1 dm 38: * @(#)filesys.h
39: */
40:
41: #ifndef __filesys_h__
42: #define __filesys_h__
43:
44: /*
45: * File System information
46: */
47:
48: /*
49: * Mount information
50: */
51: #if FSI_TYPE == FSI_GETMNT
52: # include <sys/types.h>
53: # include <sys/param.h>
54: # include <sys/mount.h>
55: # define MOUNTED_FILE "<none>"
56: #endif
57:
58: #if FSI_TYPE == FSI_GETFSSTAT
59: # include <sys/types.h>
60: # include <sys/mount.h>
61: # define MOUNTED_FILE "<none>"
62: #endif
63:
64: #if FSI_TYPE == FSI_MNTCTL
65: # include <sys/mntctl.h>
66: # define MOUNTED_FILE "<none>"
67: #endif
68:
69: #if FSI_TYPE == FSI_GETMNTENT
70: # include <mntent.h>
71: # define MOUNTED_FILE MOUNTED
72: #endif
73:
74: #if FSI_TYPE == FSI_GETMNTENT2
75: #if defined(MNTTAB_H)
76: # include MNTTAB_H
77: #endif /* MNTTAB_H */
78: #if defined(MNTENT_H)
79: # include MNTENT_H
80: #endif /* MNTENT_H */
81: # define MOUNTED_FILE MNTTAB
82: #endif /* FSI_GETMNTENT2 */
83:
84: #if !defined(MOUNTED_FILE) && defined(MNT_MNTTAB) /* HPUX */
85: # define MOUNTED_FILE MNT_MNTTAB
86: #endif /* MNT_MNTTAB */
87:
88: /*
89: * NCR OS defines bcopy and bzero
90: */
91: #if defined(NCR)
92: #undef bcopy
93: #undef bzero
94: #endif /* NCR */
95:
96: /*
97: * Stat Filesystem
98: */
99: #if defined(STATFS_TYPE)
100: #if defined(ultrix)
101: typedef struct fs_data statfs_t;
102: # define f_bavail fd_req.bfreen
103: # define f_bsize fd_req.bsize
104: # define f_ffree fd_req.gfree
105: #else
106: #if defined(_AIX) || STATFS_TYPE == STATFS_SYSV
107: # include <sys/statfs.h>
108: typedef struct statfs statfs_t;
109: # define f_bavail f_bfree
110: #else
111: #if defined(SVR4)
112: # include <sys/statvfs.h>
113: typedef struct statvfs statfs_t;
114: # define statfs(mp,sb) statvfs(mp,sb)
115: #else
1.4 ! millert 116: #if defined(BSD386) || defined(__bsdi__) || defined(__OpenBSD__) || defined(FREEBSD) || STATFS_TYPE == STATFS_OSF1
1.1 dm 117: typedef struct statfs statfs_t;
118: #else
119: # include <sys/vfs.h>
120: typedef struct statfs statfs_t;
121: #endif /* BSD386 */
122: #endif /* SVR4 */
123: #endif /* _AIX */
124: #endif /* ultrix */
125: #endif /* STATFS_TYPE */
126:
127: /*
128: * Mount Entry definetions
129: */
130: #ifndef METYPE_OTHER
131: #define METYPE_OTHER "other"
132: #endif
133: #ifndef METYPE_NFS
134: #define METYPE_NFS "nfs"
135: #endif
136: #ifndef MEFLAG_READONLY
137: #define MEFLAG_READONLY 0x01
138: #endif
139: #ifndef MEFLAG_IGNORE
140: #define MEFLAG_IGNORE 0x02
141: #endif
142:
143: /*
144: * Our internal mount entry type
145: */
146: struct _mntent {
147: char *me_path; /* Mounted path */
148: char *me_type; /* Type of mount */
149: int me_flags; /* Mount flags */
150: };
151: typedef struct _mntent mntent_t;
152:
153: /*
154: * Internal mount information type
155: */
156: struct mntinfo {
157: mntent_t *mi_mnt;
158: struct stat *mi_statb;
159: struct mntinfo *mi_nxt;
160: };
161:
162: /*
163: * Declarations
164: */
165: FILE *setmountent();
166: mntent_t *getmountent();
167: mntent_t *newmountent();
168: void endmountent();
169:
170: #endif /* __filesys_h__ */