xref: /illumos-gate/usr/src/cmd/backup/dump/dumpusg.h (revision 7c478bd9)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_DUMPUSG_H
28 #define	_DUMPUSG_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Translate from BSD to System V, where possible.
34  */
35 /*
36  * System-V specific header files
37  */
38 #include <netdb.h>
39 #include <stdlib.h>
40 #include <unistd.h>
41 #include <sys/utsname.h>
42 #include <sys/statvfs.h>
43 #include <sys/systeminfo.h>
44 #include <sys/vfstab.h>
45 #include <sys/fs/ufs_inode.h>
46 #include <sys/fs/ufs_fs.h>
47 #include <sys/fs/ufs_fsdir.h>
48 #include <sys/fs/ufs_acl.h>
49 
50 #include <sys/mnttab.h>
51 #include <sys/vfstab.h>
52 
53 #ifdef	__cplusplus
54 extern "C" {
55 #endif
56 
57 /*
58  * make mnttab look like mtab
59  */
60 #define	MOUNTED		MNTTAB
61 #define	mntent		mnttab
62 #define	mnt_fsname	mnt_special
63 #define	mnt_dir		mnt_mountp
64 #define	mnt_type	mnt_fstype
65 #define	mnt_opts	mnt_mntopts
66 #define	MNTTYPE_42	"ufs"
67 #define	MNTINFO_DEV	"dev"
68 
69 #define	setmntent	fopen
70 #define	endmntent	fclose
71 
72 /*
73  * Function translations
74  */
75 #define	gethostname(name, len)	\
76 	    ((sysinfo(SI_HOSTNAME, (name), (len)) < 0) ? -1 : 0)
77 #define	signal			nsignal		/* defined in dumpmain.c */
78 #define	sigvec			sigaction	/* both struct and func */
79 #define	sv_flags		sa_flags
80 #define	sv_handler		sa_handler
81 #define	sv_mask			sa_mask
82 #define	sigmask(x)		x
83 #define	setreuid(r, e)		seteuid(e)
84 #define	statfs			statvfs		/* both struct and func */
85 #define	setjmp(b)		sigsetjmp((b), 1)
86 #define	longjmp			siglongjmp
87 #define	jmp_buf			sigjmp_buf
88 
89 #if !__STDC__
90 extern int seteuid();
91 #endif
92 
93 /*
94  * Inode related translations
95  */
96 #define	ROOTINO		UFSROOTINO
97 #define	di_rdev		di_ordev
98 
99 /*
100  * For stat-inode translation.
101  * Don't forget the translation from
102  * nanosecs to usecs (or vica versa)
103  */
104 #define	st_spare1	st_atim.tv_nsec
105 #define	st_spare2	st_mtim.tv_nsec
106 #define	st_spare3	st_ctim.tv_nsec
107 
108 #define	TMCONV	1000
109 
110 #ifdef	__cplusplus
111 }
112 #endif
113 
114 #endif /* _DUMPUSG_H */
115