From de5d2aed228b369a9376232eb04089d856fcf9f7 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 21 Oct 2014 18:10:05 +0000 Subject: Port t_chroot to FreeBSD - Add missing #include sys/stat.h for mkdir(2) - Omit the fchroot(2) tests because the support is not present on FreeBSD Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/sys/t_chroot.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc') diff --git a/contrib/netbsd-tests/lib/libc/sys/t_chroot.c b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c index ce71708..651dc10 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_chroot.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c @@ -42,6 +42,10 @@ __RCSID("$NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $"); #include #include +#ifdef __FreeBSD__ +#include +#endif + ATF_TC(chroot_basic); ATF_TC_HEAD(chroot_basic, tc) { @@ -167,6 +171,7 @@ ATF_TC_BODY(chroot_perm, tc) atf_tc_fail("chroot(2) succeeded as unprivileged user"); } +#ifdef __NetBSD__ ATF_TC(fchroot_basic); ATF_TC_HEAD(fchroot_basic, tc) { @@ -298,6 +303,7 @@ ATF_TC_BODY(fchroot_perm, tc) if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) atf_tc_fail("fchroot(2) succeeded as unprivileged user"); } +#endif ATF_TP_ADD_TCS(tp) { @@ -305,9 +311,11 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, chroot_basic); ATF_TP_ADD_TC(tp, chroot_err); ATF_TP_ADD_TC(tp, chroot_perm); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, fchroot_basic); ATF_TP_ADD_TC(tp, fchroot_err); ATF_TP_ADD_TC(tp, fchroot_perm); +#endif return atf_no_error(); } -- cgit v1.1