xref: /illumos-gate/usr/src/cmd/backup/dump/dumpusg.h (revision fe0e7ec4)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*fe0e7ec4Smaheshvs  * Common Development and Distribution License (the "License").
6*fe0e7ec4Smaheshvs  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*fe0e7ec4Smaheshvs  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
23*fe0e7ec4Smaheshvs  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_DUMPUSG_H
277c478bd9Sstevel@tonic-gate #define	_DUMPUSG_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate /*
327c478bd9Sstevel@tonic-gate  * Translate from BSD to System V, where possible.
337c478bd9Sstevel@tonic-gate  */
347c478bd9Sstevel@tonic-gate /*
357c478bd9Sstevel@tonic-gate  * System-V specific header files
367c478bd9Sstevel@tonic-gate  */
377c478bd9Sstevel@tonic-gate #include <netdb.h>
387c478bd9Sstevel@tonic-gate #include <stdlib.h>
397c478bd9Sstevel@tonic-gate #include <unistd.h>
407c478bd9Sstevel@tonic-gate #include <sys/utsname.h>
417c478bd9Sstevel@tonic-gate #include <sys/statvfs.h>
427c478bd9Sstevel@tonic-gate #include <sys/systeminfo.h>
437c478bd9Sstevel@tonic-gate #include <sys/vfstab.h>
447c478bd9Sstevel@tonic-gate #include <sys/fs/ufs_inode.h>
457c478bd9Sstevel@tonic-gate #include <sys/fs/ufs_fs.h>
467c478bd9Sstevel@tonic-gate #include <sys/fs/ufs_fsdir.h>
477c478bd9Sstevel@tonic-gate #include <sys/fs/ufs_acl.h>
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #include <sys/mnttab.h>
507c478bd9Sstevel@tonic-gate #include <sys/vfstab.h>
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
537c478bd9Sstevel@tonic-gate extern "C" {
547c478bd9Sstevel@tonic-gate #endif
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate /*
577c478bd9Sstevel@tonic-gate  * make mnttab look like mtab
587c478bd9Sstevel@tonic-gate  */
597c478bd9Sstevel@tonic-gate #define	MOUNTED		MNTTAB
607c478bd9Sstevel@tonic-gate #define	mntent		mnttab
617c478bd9Sstevel@tonic-gate #define	mnt_fsname	mnt_special
627c478bd9Sstevel@tonic-gate #define	mnt_dir		mnt_mountp
637c478bd9Sstevel@tonic-gate #define	mnt_type	mnt_fstype
647c478bd9Sstevel@tonic-gate #define	mnt_opts	mnt_mntopts
657c478bd9Sstevel@tonic-gate #define	MNTTYPE_42	"ufs"
667c478bd9Sstevel@tonic-gate #define	MNTINFO_DEV	"dev"
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #define	setmntent	fopen
697c478bd9Sstevel@tonic-gate #define	endmntent	fclose
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate /*
727c478bd9Sstevel@tonic-gate  * Function translations
737c478bd9Sstevel@tonic-gate  */
747c478bd9Sstevel@tonic-gate #define	gethostname(name, len)	\
757c478bd9Sstevel@tonic-gate 	    ((sysinfo(SI_HOSTNAME, (name), (len)) < 0) ? -1 : 0)
767c478bd9Sstevel@tonic-gate #define	signal			nsignal		/* defined in dumpmain.c */
777c478bd9Sstevel@tonic-gate #define	sigvec			sigaction	/* both struct and func */
787c478bd9Sstevel@tonic-gate #define	sv_flags		sa_flags
797c478bd9Sstevel@tonic-gate #define	sv_handler		sa_handler
807c478bd9Sstevel@tonic-gate #define	sv_mask			sa_mask
817c478bd9Sstevel@tonic-gate #define	sigmask(x)		x
827c478bd9Sstevel@tonic-gate #define	setreuid(r, e)		seteuid(e)
837c478bd9Sstevel@tonic-gate #define	statfs			statvfs		/* both struct and func */
84*fe0e7ec4Smaheshvs #undef	setjmp
857c478bd9Sstevel@tonic-gate #define	setjmp(b)		sigsetjmp((b), 1)
867c478bd9Sstevel@tonic-gate #define	longjmp			siglongjmp
877c478bd9Sstevel@tonic-gate #define	jmp_buf			sigjmp_buf
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate #if !__STDC__
907c478bd9Sstevel@tonic-gate extern int seteuid();
917c478bd9Sstevel@tonic-gate #endif
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate /*
947c478bd9Sstevel@tonic-gate  * Inode related translations
957c478bd9Sstevel@tonic-gate  */
967c478bd9Sstevel@tonic-gate #define	ROOTINO		UFSROOTINO
977c478bd9Sstevel@tonic-gate #define	di_rdev		di_ordev
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate /*
1007c478bd9Sstevel@tonic-gate  * For stat-inode translation.
1017c478bd9Sstevel@tonic-gate  * Don't forget the translation from
1027c478bd9Sstevel@tonic-gate  * nanosecs to usecs (or vica versa)
1037c478bd9Sstevel@tonic-gate  */
1047c478bd9Sstevel@tonic-gate #define	st_spare1	st_atim.tv_nsec
1057c478bd9Sstevel@tonic-gate #define	st_spare2	st_mtim.tv_nsec
1067c478bd9Sstevel@tonic-gate #define	st_spare3	st_ctim.tv_nsec
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate #define	TMCONV	1000
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1117c478bd9Sstevel@tonic-gate }
1127c478bd9Sstevel@tonic-gate #endif
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #endif /* _DUMPUSG_H */
115