FreeBSD/contrib/netbsd-tests/fs/vfs/t_union.c
/*
 * Mount a unionfs for testing.  Before calling, "mp" contains
 * the upper layer.  Lowerpath is constructed so that the directory
 * contains rumpfs.
 */
Mount a unionfs for testing.  Before calling, "mp" contains
the upper layer.  Lowerpath is constructed so that the directory
contains rumpfs.
Mount a unionfs for testing . Before calling " mp " contains the upper layer . Lowerpath is constructed so that the directory contains rumpfs .
static void
mountunion(const char *mp, char *lowerpath)
{
	struct union_args unionargs;
	sprintf(lowerpath, "/lower");
	rump_sys_mkdir(lowerpath, 0777);
	memset(&unionargs, 0, sizeof(unionargs));
	unionargs.target = lowerpath;
	unionargs.mntflags = UNMNT_BELOW;
	if (rump_sys_mount(MOUNT_UNION, mp, 0,
	    &unionargs, sizeof(unionargs)) == -1) {
		if (errno == EOPNOTSUPP) {
			atf_tc_skip("fs does not support VOP_WHITEOUT");
		} else {
			atf_tc_fail_errno("union mount");
		}
	}
}
static void mountunion ( const char * mp , char * lowerpath ) { struct union_args unionargs ; sprintf ( lowerpath , " " ) ; rump_sys_mkdir ( lowerpath , 0777 ) ; memset ( & unionargs , 0 , sizeof ( unionargs ) ) ; unionargs . target = lowerpath ; unionargs . mntflags = UNMNT_BELOW ; if ( rump_sys_mount ( MOUNT_UNION , mp , 0 , & unionargs , sizeof ( unionargs ) ) == -1 ) { if ( errno == EOPNOTSUPP ) { atf_tc_skip ( " " ) ; } else { atf_tc_fail_errno ( " " ) ; } } }
Mount a unionfs for testing.
Mount a unionfs for testing .
/* mount the union with our testfs as the upper layer */