xref: /illumos-gate/usr/src/cmd/backup/dump/dumpusg.h (revision fe0e7ec4)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * Translate from BSD to System V, where possible.
33  */
34 /*
35  * System-V specific header files
36  */
37 #include <netdb.h>
38 #include <stdlib.h>
39 #include <unistd.h>
40 #include <sys/utsname.h>
41 #include <sys/statvfs.h>
42 #include <sys/systeminfo.h>
43 #include <sys/vfstab.h>
44 #include <sys/fs/ufs_inode.h>
45 #include <sys/fs/ufs_fs.h>
46 #include <sys/fs/ufs_fsdir.h>
47 #include <sys/fs/ufs_acl.h>
48 
49 #include <sys/mnttab.h>
50 #include <sys/vfstab.h>
51 
52 #ifdef	__cplusplus
53 extern "C" {
54 #endif
55 
56 /*
57  * make mnttab look like mtab
58  */
59 #define	MOUNTED		MNTTAB
60 #define	mntent		mnttab
61 #define	mnt_fsname	mnt_special
62 #define	mnt_dir		mnt_mountp
63 #define	mnt_type	mnt_fstype
64 #define	mnt_opts	mnt_mntopts
65 #define	MNTTYPE_42	"ufs"
66 #define	MNTINFO_DEV	"dev"
67 
68 #define	setmntent	fopen
69 #define	endmntent	fclose
70 
71 /*
72  * Function translations
73  */
74 #define	gethostname(name, len)	\
75 	    ((sysinfo(SI_HOSTNAME, (name), (len)) < 0) ? -1 : 0)
76 #define	signal			nsignal		/* defined in dumpmain.c */
77 #define	sigvec			sigaction	/* both struct and func */
78 #define	sv_flags		sa_flags
79 #define	sv_handler		sa_handler
80 #define	sv_mask			sa_mask
81 #define	sigmask(x)		x
82 #define	setreuid(r, e)		seteuid(e)
83 #define	statfs			statvfs		/* both struct and func */
84 #undef	setjmp
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