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