Avoid creating test files oustide atf-run temporary tree.diff -r1.3 -r1.4 src/tests/syscall/t_access.c
(njoly)
--- src/tests/syscall/Attic/t_access.c 2011/04/04 07:16:29 1.3
+++ src/tests/syscall/Attic/t_access.c 2011/04/25 22:29:35 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_access.c,v 1.3 2011/04/04 07:16:29 jruoho Exp $ */ | 1 | /* $NetBSD: t_access.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,38 +19,38 @@ | @@ -19,38 +19,38 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_access.c,v 1.3 2011/04/04 07:16:29 jruoho Exp $"); | 32 | __RCSID("$NetBSD: t_access.c,v 1.4 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <errno.h> | 34 | #include <errno.h> | |
35 | #include <fcntl.h> | 35 | #include <fcntl.h> | |
36 | #include <limits.h> | 36 | #include <limits.h> | |
37 | #include <stdint.h> | 37 | #include <stdint.h> | |
38 | #include <stdlib.h> | 38 | #include <stdlib.h> | |
39 | #include <unistd.h> | 39 | #include <unistd.h> | |
40 | 40 | |||
41 | #include <atf-c.h> | 41 | #include <atf-c.h> | |
42 | 42 | |||
43 | static const char path[] = "/tmp/access"; | 43 | static const char path[] = "access"; | |
44 | static const int mode[4] = { R_OK, W_OK, X_OK, F_OK }; | 44 | static const int mode[4] = { R_OK, W_OK, X_OK, F_OK }; | |
45 | 45 | |||
46 | ATF_TC_WITH_CLEANUP(access_access); | 46 | ATF_TC_WITH_CLEANUP(access_access); | |
47 | ATF_TC_HEAD(access_access, tc) | 47 | ATF_TC_HEAD(access_access, tc) | |
48 | { | 48 | { | |
49 | atf_tc_set_md_var(tc, "descr", "Test access(2) for EACCES"); | 49 | atf_tc_set_md_var(tc, "descr", "Test access(2) for EACCES"); | |
50 | atf_tc_set_md_var(tc, "require.user", "unprivileged"); | 50 | atf_tc_set_md_var(tc, "require.user", "unprivileged"); | |
51 | } | 51 | } | |
52 | 52 | |||
53 | ATF_TC_BODY(access_access, tc) | 53 | ATF_TC_BODY(access_access, tc) | |
54 | { | 54 | { | |
55 | const int perm[3] = { 0200, 0400, 0000 }; | 55 | const int perm[3] = { 0200, 0400, 0000 }; | |
56 | size_t i; | 56 | size_t i; |
--- src/tests/syscall/Attic/t_dup.c 2011/04/08 15:35:49 1.3
+++ src/tests/syscall/Attic/t_dup.c 2011/04/25 22:29:35 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_dup.c,v 1.3 2011/04/08 15:35:49 jruoho Exp $ */ | 1 | /* $NetBSD: t_dup.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,40 +19,40 @@ | @@ -19,40 +19,40 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_dup.c,v 1.3 2011/04/08 15:35:49 jruoho Exp $"); | 32 | __RCSID("$NetBSD: t_dup.c,v 1.4 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/resource.h> | 34 | #include <sys/resource.h> | |
35 | #include <sys/stat.h> | 35 | #include <sys/stat.h> | |
36 | 36 | |||
37 | #include <errno.h> | 37 | #include <errno.h> | |
38 | #include <fcntl.h> | 38 | #include <fcntl.h> | |
39 | #include <stdlib.h> | 39 | #include <stdlib.h> | |
40 | #include <string.h> | 40 | #include <string.h> | |
41 | #include <unistd.h> | 41 | #include <unistd.h> | |
42 | 42 | |||
43 | #include <atf-c.h> | 43 | #include <atf-c.h> | |
44 | 44 | |||
45 | static char path[] = "/tmp/dup"; | 45 | static char path[] = "dup"; | |
46 | 46 | |||
47 | ATF_TC(dup_err); | 47 | ATF_TC(dup_err); | |
48 | ATF_TC_HEAD(dup_err, tc) | 48 | ATF_TC_HEAD(dup_err, tc) | |
49 | { | 49 | { | |
50 | atf_tc_set_md_var(tc, "descr", "Test error conditions of dup(2)"); | 50 | atf_tc_set_md_var(tc, "descr", "Test error conditions of dup(2)"); | |
51 | } | 51 | } | |
52 | 52 | |||
53 | ATF_TC_BODY(dup_err, tc) | 53 | ATF_TC_BODY(dup_err, tc) | |
54 | { | 54 | { | |
55 | ATF_REQUIRE(dup(-1) != 0); | 55 | ATF_REQUIRE(dup(-1) != 0); | |
56 | } | 56 | } | |
57 | 57 | |||
58 | ATF_TC_WITH_CLEANUP(dup_max); | 58 | ATF_TC_WITH_CLEANUP(dup_max); |
--- src/tests/syscall/Attic/t_mmap.c 2011/04/19 10:21:51 1.3
+++ src/tests/syscall/Attic/t_mmap.c 2011/04/25 22:29:35 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_mmap.c,v 1.3 2011/04/19 10:21:51 martin Exp $ */ | 1 | /* $NetBSD: t_mmap.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,44 +19,44 @@ | @@ -19,44 +19,44 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_mmap.c,v 1.3 2011/04/19 10:21:51 martin Exp $"); | 32 | __RCSID("$NetBSD: t_mmap.c,v 1.4 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <sys/sysctl.h> | 36 | #include <sys/sysctl.h> | |
37 | #include <sys/wait.h> | 37 | #include <sys/wait.h> | |
38 | 38 | |||
39 | #include <errno.h> | 39 | #include <errno.h> | |
40 | #include <fcntl.h> | 40 | #include <fcntl.h> | |
41 | #include <signal.h> | 41 | #include <signal.h> | |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> | |
43 | #include <string.h> | 43 | #include <string.h> | |
44 | #include <unistd.h> | 44 | #include <unistd.h> | |
45 | 45 | |||
46 | #include <atf-c.h> | 46 | #include <atf-c.h> | |
47 | 47 | |||
48 | static long page = 0; | 48 | static long page = 0; | |
49 | static char path[] = "/tmp/mmap"; | 49 | static char path[] = "mmap"; | |
50 | static void map_check(void *, int); | 50 | static void map_check(void *, int); | |
51 | static void map_sighandler(int); | 51 | static void map_sighandler(int); | |
52 | 52 | |||
53 | static void | 53 | static void | |
54 | map_check(void *map, int flag) | 54 | map_check(void *map, int flag) | |
55 | { | 55 | { | |
56 | 56 | |||
57 | if (flag != 0) { | 57 | if (flag != 0) { | |
58 | ATF_REQUIRE(map == MAP_FAILED); | 58 | ATF_REQUIRE(map == MAP_FAILED); | |
59 | return; | 59 | return; | |
60 | } | 60 | } | |
61 | 61 | |||
62 | ATF_REQUIRE(map != MAP_FAILED); | 62 | ATF_REQUIRE(map != MAP_FAILED); |
--- src/tests/syscall/Attic/t_mprotect.c 2011/04/04 10:30:29 1.3
+++ src/tests/syscall/Attic/t_mprotect.c 2011/04/25 22:29:35 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_mprotect.c,v 1.3 2011/04/04 10:30:29 jruoho Exp $ */ | 1 | /* $NetBSD: t_mprotect.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,45 +19,45 @@ | @@ -19,45 +19,45 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_mprotect.c,v 1.3 2011/04/04 10:30:29 jruoho Exp $"); | 32 | __RCSID("$NetBSD: t_mprotect.c,v 1.4 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <sys/sysctl.h> | 36 | #include <sys/sysctl.h> | |
37 | #include <sys/wait.h> | 37 | #include <sys/wait.h> | |
38 | 38 | |||
39 | #include <errno.h> | 39 | #include <errno.h> | |
40 | #include <fcntl.h> | 40 | #include <fcntl.h> | |
41 | #include <stdlib.h> | 41 | #include <stdlib.h> | |
42 | #include <string.h> | 42 | #include <string.h> | |
43 | #include <unistd.h> | 43 | #include <unistd.h> | |
44 | 44 | |||
45 | #include <atf-c.h> | 45 | #include <atf-c.h> | |
46 | 46 | |||
47 | static long page = 0; | 47 | static long page = 0; | |
48 | static int pax_global = -1; | 48 | static int pax_global = -1; | |
49 | static int pax_enabled = -1; | 49 | static int pax_enabled = -1; | |
50 | static char path[] = "/tmp/mmap"; | 50 | static char path[] = "mmap"; | |
51 | 51 | |||
52 | static void sighandler(int); | 52 | static void sighandler(int); | |
53 | static bool paxinit(void); | 53 | static bool paxinit(void); | |
54 | static bool paxset(int, int); | 54 | static bool paxset(int, int); | |
55 | 55 | |||
56 | static void | 56 | static void | |
57 | sighandler(int signo) | 57 | sighandler(int signo) | |
58 | { | 58 | { | |
59 | _exit(signo); | 59 | _exit(signo); | |
60 | } | 60 | } | |
61 | 61 | |||
62 | static bool | 62 | static bool | |
63 | paxinit(void) | 63 | paxinit(void) |
--- src/tests/syscall/Attic/t_setrlimit.c 2011/04/06 03:47:14 1.3
+++ src/tests/syscall/Attic/t_setrlimit.c 2011/04/25 22:29:35 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_setrlimit.c,v 1.3 2011/04/06 03:47:14 jruoho Exp $ */ | 1 | /* $NetBSD: t_setrlimit.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,43 +19,43 @@ | @@ -19,43 +19,43 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_setrlimit.c,v 1.3 2011/04/06 03:47:14 jruoho Exp $"); | 32 | __RCSID("$NetBSD: t_setrlimit.c,v 1.4 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/resource.h> | 34 | #include <sys/resource.h> | |
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <sys/wait.h> | 36 | #include <sys/wait.h> | |
37 | 37 | |||
38 | #include <atf-c.h> | 38 | #include <atf-c.h> | |
39 | #include <errno.h> | 39 | #include <errno.h> | |
40 | #include <fcntl.h> | 40 | #include <fcntl.h> | |
41 | #include <limits.h> | 41 | #include <limits.h> | |
42 | #include <signal.h> | 42 | #include <signal.h> | |
43 | #include <stdlib.h> | 43 | #include <stdlib.h> | |
44 | #include <string.h> | 44 | #include <string.h> | |
45 | #include <unistd.h> | 45 | #include <unistd.h> | |
46 | 46 | |||
47 | static void sighandler(int); | 47 | static void sighandler(int); | |
48 | static const char path[] = "/tmp/setrlimit"; | 48 | static const char path[] = "setrlimit"; | |
49 | 49 | |||
50 | static const int rlimit[] = { | 50 | static const int rlimit[] = { | |
51 | RLIMIT_AS, | 51 | RLIMIT_AS, | |
52 | RLIMIT_CORE, | 52 | RLIMIT_CORE, | |
53 | RLIMIT_CPU, | 53 | RLIMIT_CPU, | |
54 | RLIMIT_DATA, | 54 | RLIMIT_DATA, | |
55 | RLIMIT_FSIZE, | 55 | RLIMIT_FSIZE, | |
56 | RLIMIT_MEMLOCK, | 56 | RLIMIT_MEMLOCK, | |
57 | RLIMIT_NOFILE, | 57 | RLIMIT_NOFILE, | |
58 | RLIMIT_NPROC, | 58 | RLIMIT_NPROC, | |
59 | RLIMIT_RSS, | 59 | RLIMIT_RSS, | |
60 | RLIMIT_SBSIZE, | 60 | RLIMIT_SBSIZE, | |
61 | RLIMIT_STACK | 61 | RLIMIT_STACK |
--- src/tests/syscall/Attic/t_msync.c 2011/04/19 10:21:51 1.2
+++ src/tests/syscall/Attic/t_msync.c 2011/04/25 22:29:35 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_msync.c,v 1.2 2011/04/19 10:21:51 martin Exp $ */ | 1 | /* $NetBSD: t_msync.c,v 1.3 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,41 +19,41 @@ | @@ -19,41 +19,41 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_msync.c,v 1.2 2011/04/19 10:21:51 martin Exp $"); | 32 | __RCSID("$NetBSD: t_msync.c,v 1.3 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/mman.h> | 34 | #include <sys/mman.h> | |
35 | 35 | |||
36 | #include <atf-c.h> | 36 | #include <atf-c.h> | |
37 | #include <errno.h> | 37 | #include <errno.h> | |
38 | #include <fcntl.h> | 38 | #include <fcntl.h> | |
39 | #include <limits.h> | 39 | #include <limits.h> | |
40 | #include <stdlib.h> | 40 | #include <stdlib.h> | |
41 | #include <string.h> | 41 | #include <string.h> | |
42 | #include <unistd.h> | 42 | #include <unistd.h> | |
43 | 43 | |||
44 | static long page = 0; | 44 | static long page = 0; | |
45 | static const off_t off = 512; | 45 | static const off_t off = 512; | |
46 | static const char path[] = "/tmp/msync"; | 46 | static const char path[] = "msync"; | |
47 | 47 | |||
48 | static const char *msync_sync(const char *, int); | 48 | static const char *msync_sync(const char *, int); | |
49 | 49 | |||
50 | static const char * | 50 | static const char * | |
51 | msync_sync(const char *garbage, int flags) | 51 | msync_sync(const char *garbage, int flags) | |
52 | { | 52 | { | |
53 | char *buf, *map = MAP_FAILED; | 53 | char *buf, *map = MAP_FAILED; | |
54 | const char *str = NULL; | 54 | const char *str = NULL; | |
55 | size_t i, len; | 55 | size_t i, len; | |
56 | ssize_t tot; | 56 | ssize_t tot; | |
57 | int fd, rv; | 57 | int fd, rv; | |
58 | 58 | |||
59 | /* | 59 | /* |
--- src/tests/syscall/Attic/t_umask.c 2011/04/04 16:32:41 1.1
+++ src/tests/syscall/Attic/t_umask.c 2011/04/25 22:29:35 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: t_umask.c,v 1.1 2011/04/04 16:32:41 jruoho Exp $ */ | 1 | /* $NetBSD: t_umask.c,v 1.2 2011/04/25 22:29:35 njoly Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jukka Ruohonen. | 8 | * by Jukka Ruohonen. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,38 +19,38 @@ | @@ -19,38 +19,38 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_umask.c,v 1.1 2011/04/04 16:32:41 jruoho Exp $"); | 32 | __RCSID("$NetBSD: t_umask.c,v 1.2 2011/04/25 22:29:35 njoly Exp $"); | |
33 | 33 | |||
34 | #include <sys/stat.h> | 34 | #include <sys/stat.h> | |
35 | #include <sys/wait.h> | 35 | #include <sys/wait.h> | |
36 | 36 | |||
37 | #include <atf-c.h> | 37 | #include <atf-c.h> | |
38 | #include <fcntl.h> | 38 | #include <fcntl.h> | |
39 | #include <stdlib.h> | 39 | #include <stdlib.h> | |
40 | #include <string.h> | 40 | #include <string.h> | |
41 | #include <unistd.h> | 41 | #include <unistd.h> | |
42 | 42 | |||
43 | static const char path[] = "/tmp/umask"; | 43 | static const char path[] = "umask"; | |
44 | static const mode_t mask[] = { | 44 | static const mode_t mask[] = { | |
45 | S_IRWXU, | 45 | S_IRWXU, | |
46 | S_IRUSR, | 46 | S_IRUSR, | |
47 | S_IWUSR, | 47 | S_IWUSR, | |
48 | S_IXUSR, | 48 | S_IXUSR, | |
49 | S_IRWXG, | 49 | S_IRWXG, | |
50 | S_IRGRP, | 50 | S_IRGRP, | |
51 | S_IWGRP, | 51 | S_IWGRP, | |
52 | S_IXGRP, | 52 | S_IXGRP, | |
53 | S_IRWXO, | 53 | S_IRWXO, | |
54 | S_IROTH, | 54 | S_IROTH, | |
55 | S_IWOTH, | 55 | S_IWOTH, | |
56 | S_IXOTH | 56 | S_IXOTH |