1*11be35a1SLionel Sambuc /* $NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $ */
2*11be35a1SLionel Sambuc
3*11be35a1SLionel Sambuc /*-
4*11be35a1SLionel Sambuc * Copyright (c) 2011 The NetBSD Foundation, Inc.
5*11be35a1SLionel Sambuc * All rights reserved.
6*11be35a1SLionel Sambuc *
7*11be35a1SLionel Sambuc * This code is derived from software contributed to The NetBSD Foundation
8*11be35a1SLionel Sambuc * by Jukka Ruohonen.
9*11be35a1SLionel Sambuc *
10*11be35a1SLionel Sambuc * Redistribution and use in source and binary forms, with or without
11*11be35a1SLionel Sambuc * modification, are permitted provided that the following conditions
12*11be35a1SLionel Sambuc * are met:
13*11be35a1SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
14*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer.
15*11be35a1SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
16*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer in the
17*11be35a1SLionel Sambuc * documentation and/or other materials provided with the distribution.
18*11be35a1SLionel Sambuc *
19*11be35a1SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*11be35a1SLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*11be35a1SLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*11be35a1SLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*11be35a1SLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*11be35a1SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*11be35a1SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*11be35a1SLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*11be35a1SLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*11be35a1SLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*11be35a1SLionel Sambuc * POSSIBILITY OF SUCH DAMAGE.
30*11be35a1SLionel Sambuc */
31*11be35a1SLionel Sambuc
32*11be35a1SLionel Sambuc /*-
33*11be35a1SLionel Sambuc * Copyright (c) 1999 The NetBSD Foundation, Inc.
34*11be35a1SLionel Sambuc * All rights reserved.
35*11be35a1SLionel Sambuc *
36*11be35a1SLionel Sambuc * This code is derived from software contributed to The NetBSD Foundation
37*11be35a1SLionel Sambuc * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
38*11be35a1SLionel Sambuc * NASA Ames Research Center.
39*11be35a1SLionel Sambuc *
40*11be35a1SLionel Sambuc * Redistribution and use in source and binary forms, with or without
41*11be35a1SLionel Sambuc * modification, are permitted provided that the following conditions
42*11be35a1SLionel Sambuc * are met:
43*11be35a1SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
44*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer.
45*11be35a1SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
46*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer in the
47*11be35a1SLionel Sambuc * documentation and/or other materials provided with the distribution.
48*11be35a1SLionel Sambuc *
49*11be35a1SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
50*11be35a1SLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
51*11be35a1SLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
52*11be35a1SLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
53*11be35a1SLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
54*11be35a1SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
55*11be35a1SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
56*11be35a1SLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
57*11be35a1SLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
58*11be35a1SLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59*11be35a1SLionel Sambuc * POSSIBILITY OF SUCH DAMAGE.
60*11be35a1SLionel Sambuc */
61*11be35a1SLionel Sambuc #include <sys/cdefs.h>
62*11be35a1SLionel Sambuc __RCSID("$NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $");
63*11be35a1SLionel Sambuc
64*11be35a1SLionel Sambuc #include <sys/mman.h>
65*11be35a1SLionel Sambuc #include <sys/shm.h>
66*11be35a1SLionel Sambuc
67*11be35a1SLionel Sambuc #include <atf-c.h>
68*11be35a1SLionel Sambuc #include <errno.h>
69*11be35a1SLionel Sambuc #include <fcntl.h>
70*11be35a1SLionel Sambuc #include <kvm.h>
71*11be35a1SLionel Sambuc #include <stdio.h>
72*11be35a1SLionel Sambuc #include <stdlib.h>
73*11be35a1SLionel Sambuc #include <string.h>
74*11be35a1SLionel Sambuc #include <unistd.h>
75*11be35a1SLionel Sambuc #include <sys/resource.h>
76*11be35a1SLionel Sambuc
77*11be35a1SLionel Sambuc static long page = 0;
78*11be35a1SLionel Sambuc static const char path[] = "mincore";
79*11be35a1SLionel Sambuc static size_t check_residency(void *, size_t);
80*11be35a1SLionel Sambuc
81*11be35a1SLionel Sambuc static size_t
check_residency(void * addr,size_t npgs)82*11be35a1SLionel Sambuc check_residency(void *addr, size_t npgs)
83*11be35a1SLionel Sambuc {
84*11be35a1SLionel Sambuc size_t i, resident;
85*11be35a1SLionel Sambuc char *vec;
86*11be35a1SLionel Sambuc
87*11be35a1SLionel Sambuc vec = malloc(npgs);
88*11be35a1SLionel Sambuc
89*11be35a1SLionel Sambuc ATF_REQUIRE(vec != NULL);
90*11be35a1SLionel Sambuc ATF_REQUIRE(mincore(addr, npgs * page, vec) == 0);
91*11be35a1SLionel Sambuc
92*11be35a1SLionel Sambuc for (i = resident = 0; i < npgs; i++) {
93*11be35a1SLionel Sambuc
94*11be35a1SLionel Sambuc if (vec[i] != 0)
95*11be35a1SLionel Sambuc resident++;
96*11be35a1SLionel Sambuc
97*11be35a1SLionel Sambuc #if 0
98*11be35a1SLionel Sambuc (void)fprintf(stderr, "page 0x%p is %sresident\n",
99*11be35a1SLionel Sambuc (char *)addr + (i * page), vec[i] ? "" : "not ");
100*11be35a1SLionel Sambuc #endif
101*11be35a1SLionel Sambuc }
102*11be35a1SLionel Sambuc
103*11be35a1SLionel Sambuc free(vec);
104*11be35a1SLionel Sambuc
105*11be35a1SLionel Sambuc return resident;
106*11be35a1SLionel Sambuc }
107*11be35a1SLionel Sambuc
108*11be35a1SLionel Sambuc ATF_TC(mincore_err);
ATF_TC_HEAD(mincore_err,tc)109*11be35a1SLionel Sambuc ATF_TC_HEAD(mincore_err, tc)
110*11be35a1SLionel Sambuc {
111*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test errors from mincore(2)");
112*11be35a1SLionel Sambuc }
113*11be35a1SLionel Sambuc
ATF_TC_BODY(mincore_err,tc)114*11be35a1SLionel Sambuc ATF_TC_BODY(mincore_err, tc)
115*11be35a1SLionel Sambuc {
116*11be35a1SLionel Sambuc char *map, *vec;
117*11be35a1SLionel Sambuc
118*11be35a1SLionel Sambuc map = mmap(NULL, page, PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
119*11be35a1SLionel Sambuc vec = malloc(page);
120*11be35a1SLionel Sambuc
121*11be35a1SLionel Sambuc ATF_REQUIRE(vec != NULL);
122*11be35a1SLionel Sambuc ATF_REQUIRE(map != MAP_FAILED);
123*11be35a1SLionel Sambuc
124*11be35a1SLionel Sambuc errno = 0;
125*11be35a1SLionel Sambuc ATF_REQUIRE_ERRNO(EINVAL, mincore(map, 0, vec) == -1);
126*11be35a1SLionel Sambuc
127*11be35a1SLionel Sambuc errno = 0;
128*11be35a1SLionel Sambuc ATF_REQUIRE_ERRNO(ENOMEM, mincore(0, page, vec) == -1);
129*11be35a1SLionel Sambuc
130*11be35a1SLionel Sambuc errno = 0;
131*11be35a1SLionel Sambuc ATF_REQUIRE_ERRNO(EFAULT, mincore(map, page, (void *)-1) == -1);
132*11be35a1SLionel Sambuc
133*11be35a1SLionel Sambuc free(vec);
134*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(map, page) == 0);
135*11be35a1SLionel Sambuc }
136*11be35a1SLionel Sambuc
137*11be35a1SLionel Sambuc ATF_TC_WITH_CLEANUP(mincore_resid);
ATF_TC_HEAD(mincore_resid,tc)138*11be35a1SLionel Sambuc ATF_TC_HEAD(mincore_resid, tc)
139*11be35a1SLionel Sambuc {
140*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)");
141*11be35a1SLionel Sambuc }
142*11be35a1SLionel Sambuc
ATF_TC_BODY(mincore_resid,tc)143*11be35a1SLionel Sambuc ATF_TC_BODY(mincore_resid, tc)
144*11be35a1SLionel Sambuc {
145*11be35a1SLionel Sambuc void *addr, *addr2, *addr3, *buf;
146*11be35a1SLionel Sambuc size_t npgs = 0, resident;
147*11be35a1SLionel Sambuc struct stat st;
148*11be35a1SLionel Sambuc int fd, rv;
149*11be35a1SLionel Sambuc struct rlimit rlim;
150*11be35a1SLionel Sambuc
151*11be35a1SLionel Sambuc ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
152*11be35a1SLionel Sambuc rlim.rlim_cur = rlim.rlim_max;
153*11be35a1SLionel Sambuc ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
154*11be35a1SLionel Sambuc
155*11be35a1SLionel Sambuc (void)memset(&st, 0, sizeof(struct stat));
156*11be35a1SLionel Sambuc
157*11be35a1SLionel Sambuc fd = open(path, O_RDWR | O_CREAT, 0700);
158*11be35a1SLionel Sambuc buf = malloc(page * 5);
159*11be35a1SLionel Sambuc
160*11be35a1SLionel Sambuc ATF_REQUIRE(fd >= 0);
161*11be35a1SLionel Sambuc ATF_REQUIRE(buf != NULL);
162*11be35a1SLionel Sambuc
163*11be35a1SLionel Sambuc rv = write(fd, buf, page * 5);
164*11be35a1SLionel Sambuc ATF_REQUIRE(rv >= 0);
165*11be35a1SLionel Sambuc
166*11be35a1SLionel Sambuc ATF_REQUIRE(fd >= 0);
167*11be35a1SLionel Sambuc ATF_REQUIRE(fstat(fd, &st) == 0);
168*11be35a1SLionel Sambuc
169*11be35a1SLionel Sambuc addr = mmap(NULL, (size_t)st.st_size, PROT_READ,
170*11be35a1SLionel Sambuc MAP_FILE | MAP_SHARED, fd, (off_t) 0);
171*11be35a1SLionel Sambuc
172*11be35a1SLionel Sambuc ATF_REQUIRE(addr != MAP_FAILED);
173*11be35a1SLionel Sambuc
174*11be35a1SLionel Sambuc (void)close(fd);
175*11be35a1SLionel Sambuc
176*11be35a1SLionel Sambuc npgs = st.st_size / page;
177*11be35a1SLionel Sambuc
178*11be35a1SLionel Sambuc if (st.st_size % page != 0)
179*11be35a1SLionel Sambuc npgs++;
180*11be35a1SLionel Sambuc
181*11be35a1SLionel Sambuc (void)check_residency(addr, npgs);
182*11be35a1SLionel Sambuc
183*11be35a1SLionel Sambuc rv = mlock(addr, npgs * page);
184*11be35a1SLionel Sambuc if (rv == -1 && errno == EAGAIN)
185*11be35a1SLionel Sambuc atf_tc_skip("hit process resource limits");
186*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(addr, st.st_size) == 0);
187*11be35a1SLionel Sambuc
188*11be35a1SLionel Sambuc npgs = 128;
189*11be35a1SLionel Sambuc
190*11be35a1SLionel Sambuc addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE,
191*11be35a1SLionel Sambuc MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0);
192*11be35a1SLionel Sambuc
193*11be35a1SLionel Sambuc if (addr == MAP_FAILED)
194*11be35a1SLionel Sambuc atf_tc_skip("could not mmap wired anonymous test area, system "
195*11be35a1SLionel Sambuc "might be low on memory");
196*11be35a1SLionel Sambuc
197*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == npgs);
198*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(addr, npgs * page) == 0);
199*11be35a1SLionel Sambuc
200*11be35a1SLionel Sambuc npgs = 128;
201*11be35a1SLionel Sambuc
202*11be35a1SLionel Sambuc addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE,
203*11be35a1SLionel Sambuc MAP_ANON | MAP_PRIVATE, -1, (off_t)0);
204*11be35a1SLionel Sambuc
205*11be35a1SLionel Sambuc ATF_REQUIRE(addr != MAP_FAILED);
206*11be35a1SLionel Sambuc
207*11be35a1SLionel Sambuc /*
208*11be35a1SLionel Sambuc * Check that the in-core pages match the locked pages.
209*11be35a1SLionel Sambuc */
210*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == 0);
211*11be35a1SLionel Sambuc
212*11be35a1SLionel Sambuc errno = 0;
213*11be35a1SLionel Sambuc if (mlockall(MCL_CURRENT|MCL_FUTURE) != 0 && errno != ENOMEM)
214*11be35a1SLionel Sambuc atf_tc_fail("mlockall(2) failed");
215*11be35a1SLionel Sambuc if (errno == ENOMEM)
216*11be35a1SLionel Sambuc atf_tc_skip("mlockall() exceeded process resource limits");
217*11be35a1SLionel Sambuc
218*11be35a1SLionel Sambuc resident = check_residency(addr, npgs);
219*11be35a1SLionel Sambuc if (resident < npgs)
220*11be35a1SLionel Sambuc atf_tc_fail("mlockall(MCL_FUTURE) succeeded, still only "
221*11be35a1SLionel Sambuc "%zu pages of the newly mapped %zu pages are resident",
222*11be35a1SLionel Sambuc resident, npgs);
223*11be35a1SLionel Sambuc
224*11be35a1SLionel Sambuc addr2 = mmap(NULL, npgs * page, PROT_READ, MAP_ANON, -1, (off_t)0);
225*11be35a1SLionel Sambuc addr3 = mmap(NULL, npgs * page, PROT_NONE, MAP_ANON, -1, (off_t)0);
226*11be35a1SLionel Sambuc
227*11be35a1SLionel Sambuc if (addr2 == MAP_FAILED || addr3 == MAP_FAILED)
228*11be35a1SLionel Sambuc atf_tc_skip("could not mmap more anonymous test pages with "
229*11be35a1SLionel Sambuc "mlockall(MCL_FUTURE) in effect, system "
230*11be35a1SLionel Sambuc "might be low on memory");
231*11be35a1SLionel Sambuc
232*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr2, npgs) == npgs);
233*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr3, npgs) == 0);
234*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect(addr3, npgs * page, PROT_READ) == 0);
235*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == npgs);
236*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr2, npgs) == npgs);
237*11be35a1SLionel Sambuc
238*11be35a1SLionel Sambuc (void)munlockall();
239*11be35a1SLionel Sambuc
240*11be35a1SLionel Sambuc ATF_REQUIRE(madvise(addr2, npgs * page, MADV_FREE) == 0);
241*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr2, npgs) == 0);
242*11be35a1SLionel Sambuc
243*11be35a1SLionel Sambuc (void)memset(addr, 0, npgs * page);
244*11be35a1SLionel Sambuc
245*11be35a1SLionel Sambuc ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0);
246*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == 0);
247*11be35a1SLionel Sambuc
248*11be35a1SLionel Sambuc (void)munmap(addr, npgs * page);
249*11be35a1SLionel Sambuc (void)munmap(addr2, npgs * page);
250*11be35a1SLionel Sambuc (void)munmap(addr3, npgs * page);
251*11be35a1SLionel Sambuc (void)unlink(path);
252*11be35a1SLionel Sambuc }
253*11be35a1SLionel Sambuc
ATF_TC_CLEANUP(mincore_resid,tc)254*11be35a1SLionel Sambuc ATF_TC_CLEANUP(mincore_resid, tc)
255*11be35a1SLionel Sambuc {
256*11be35a1SLionel Sambuc (void)unlink(path);
257*11be35a1SLionel Sambuc }
258*11be35a1SLionel Sambuc
259*11be35a1SLionel Sambuc ATF_TC(mincore_shmseg);
ATF_TC_HEAD(mincore_shmseg,tc)260*11be35a1SLionel Sambuc ATF_TC_HEAD(mincore_shmseg, tc)
261*11be35a1SLionel Sambuc {
262*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "residency of shared memory");
263*11be35a1SLionel Sambuc }
264*11be35a1SLionel Sambuc
ATF_TC_BODY(mincore_shmseg,tc)265*11be35a1SLionel Sambuc ATF_TC_BODY(mincore_shmseg, tc)
266*11be35a1SLionel Sambuc {
267*11be35a1SLionel Sambuc size_t npgs = 128;
268*11be35a1SLionel Sambuc void *addr = NULL;
269*11be35a1SLionel Sambuc int shmid;
270*11be35a1SLionel Sambuc
271*11be35a1SLionel Sambuc shmid = shmget(IPC_PRIVATE, npgs * page,
272*11be35a1SLionel Sambuc IPC_CREAT | S_IRUSR | S_IWUSR);
273*11be35a1SLionel Sambuc
274*11be35a1SLionel Sambuc ATF_REQUIRE(shmid != -1);
275*11be35a1SLionel Sambuc
276*11be35a1SLionel Sambuc addr = shmat(shmid, NULL, 0);
277*11be35a1SLionel Sambuc
278*11be35a1SLionel Sambuc ATF_REQUIRE(addr != NULL);
279*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == 0);
280*11be35a1SLionel Sambuc
281*11be35a1SLionel Sambuc (void)memset(addr, 0xff, npgs * page);
282*11be35a1SLionel Sambuc
283*11be35a1SLionel Sambuc ATF_REQUIRE(check_residency(addr, npgs) == npgs);
284*11be35a1SLionel Sambuc ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0);
285*11be35a1SLionel Sambuc
286*11be35a1SLionel Sambuc /*
287*11be35a1SLionel Sambuc * NOTE! Even though we have MADV_FREE'd the range,
288*11be35a1SLionel Sambuc * there is another reference (the kernel's) to the
289*11be35a1SLionel Sambuc * object which owns the pages. In this case, the
290*11be35a1SLionel Sambuc * kernel does not simply free the pages, as haphazardly
291*11be35a1SLionel Sambuc * freeing pages when there are still references to
292*11be35a1SLionel Sambuc * an object can cause data corruption (say, the other
293*11be35a1SLionel Sambuc * referencer doesn't expect the pages to be freed,
294*11be35a1SLionel Sambuc * and is surprised by the subsequent ZFOD).
295*11be35a1SLionel Sambuc *
296*11be35a1SLionel Sambuc * Because of this, we simply report the number of
297*11be35a1SLionel Sambuc * pages still resident, for information only.
298*11be35a1SLionel Sambuc */
299*11be35a1SLionel Sambuc npgs = check_residency(addr, npgs);
300*11be35a1SLionel Sambuc
301*11be35a1SLionel Sambuc (void)fprintf(stderr, "%zu pages still resident\n", npgs);
302*11be35a1SLionel Sambuc
303*11be35a1SLionel Sambuc ATF_REQUIRE(shmdt(addr) == 0);
304*11be35a1SLionel Sambuc ATF_REQUIRE(shmctl(shmid, IPC_RMID, NULL) == 0);
305*11be35a1SLionel Sambuc }
306*11be35a1SLionel Sambuc
ATF_TP_ADD_TCS(tp)307*11be35a1SLionel Sambuc ATF_TP_ADD_TCS(tp)
308*11be35a1SLionel Sambuc {
309*11be35a1SLionel Sambuc
310*11be35a1SLionel Sambuc page = sysconf(_SC_PAGESIZE);
311*11be35a1SLionel Sambuc ATF_REQUIRE(page >= 0);
312*11be35a1SLionel Sambuc
313*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mincore_err);
314*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mincore_resid);
315*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mincore_shmseg);
316*11be35a1SLionel Sambuc
317*11be35a1SLionel Sambuc return atf_no_error();
318*11be35a1SLionel Sambuc }
319