Mon Apr 25 22:29:35 2011 UTC ()
Avoid creating test files oustide atf-run temporary tree.


(njoly)
diff -r1.3 -r1.4 src/tests/syscall/t_access.c
diff -r1.3 -r1.4 src/tests/syscall/t_dup.c
diff -r1.3 -r1.4 src/tests/syscall/t_mmap.c
diff -r1.3 -r1.4 src/tests/syscall/t_mprotect.c
diff -r1.3 -r1.4 src/tests/syscall/t_setrlimit.c
diff -r1.2 -r1.3 src/tests/syscall/t_msync.c
diff -r1.1 -r1.2 src/tests/syscall/t_umask.c

cvs diff -r1.3 -r1.4 src/tests/syscall/Attic/t_access.c (expand / switch to unified diff)

--- 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
43static const char path[] = "/tmp/access"; 43static const char path[] = "access";
44static const int mode[4] = { R_OK, W_OK, X_OK, F_OK }; 44static const int mode[4] = { R_OK, W_OK, X_OK, F_OK };
45 45
46ATF_TC_WITH_CLEANUP(access_access); 46ATF_TC_WITH_CLEANUP(access_access);
47ATF_TC_HEAD(access_access, tc) 47ATF_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
53ATF_TC_BODY(access_access, tc) 53ATF_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;

cvs diff -r1.3 -r1.4 src/tests/syscall/Attic/t_dup.c (expand / switch to unified diff)

--- 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
45static char path[] = "/tmp/dup"; 45static char path[] = "dup";
46 46
47ATF_TC(dup_err); 47ATF_TC(dup_err);
48ATF_TC_HEAD(dup_err, tc) 48ATF_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
53ATF_TC_BODY(dup_err, tc) 53ATF_TC_BODY(dup_err, tc)
54{ 54{
55 ATF_REQUIRE(dup(-1) != 0); 55 ATF_REQUIRE(dup(-1) != 0);
56} 56}
57 57
58ATF_TC_WITH_CLEANUP(dup_max); 58ATF_TC_WITH_CLEANUP(dup_max);

cvs diff -r1.3 -r1.4 src/tests/syscall/Attic/t_mmap.c (expand / switch to unified diff)

--- 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
48static long page = 0; 48static long page = 0;
49static char path[] = "/tmp/mmap"; 49static char path[] = "mmap";
50static void map_check(void *, int); 50static void map_check(void *, int);
51static void map_sighandler(int); 51static void map_sighandler(int);
52 52
53static void 53static void
54map_check(void *map, int flag) 54map_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);

cvs diff -r1.3 -r1.4 src/tests/syscall/Attic/t_mprotect.c (expand / switch to unified diff)

--- 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
47static long page = 0; 47static long page = 0;
48static int pax_global = -1; 48static int pax_global = -1;
49static int pax_enabled = -1; 49static int pax_enabled = -1;
50static char path[] = "/tmp/mmap"; 50static char path[] = "mmap";
51 51
52static void sighandler(int); 52static void sighandler(int);
53static bool paxinit(void); 53static bool paxinit(void);
54static bool paxset(int, int); 54static bool paxset(int, int);
55 55
56static void 56static void
57sighandler(int signo) 57sighandler(int signo)
58{ 58{
59 _exit(signo); 59 _exit(signo);
60} 60}
61 61
62static bool 62static bool
63paxinit(void) 63paxinit(void)

cvs diff -r1.3 -r1.4 src/tests/syscall/Attic/t_setrlimit.c (expand / switch to unified diff)

--- 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
47static void sighandler(int); 47static void sighandler(int);
48static const char path[] = "/tmp/setrlimit"; 48static const char path[] = "setrlimit";
49 49
50static const int rlimit[] = { 50static 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

cvs diff -r1.2 -r1.3 src/tests/syscall/Attic/t_msync.c (expand / switch to unified diff)

--- 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
44static long page = 0; 44static long page = 0;
45static const off_t off = 512; 45static const off_t off = 512;
46static const char path[] = "/tmp/msync"; 46static const char path[] = "msync";
47 47
48static const char *msync_sync(const char *, int); 48static const char *msync_sync(const char *, int);
49 49
50static const char * 50static const char *
51msync_sync(const char *garbage, int flags) 51msync_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 /*

cvs diff -r1.1 -r1.2 src/tests/syscall/Attic/t_umask.c (expand / switch to unified diff)

--- 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
43static const char path[] = "/tmp/umask"; 43static const char path[] = "umask";
44static const mode_t mask[] = { 44static 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