Module Name: src Committed By: martin Date: Sat Sep 8 12:25:06 UTC 2012
Modified Files: src/tests/lib/libc/sys: t_mlock.c Log Message: Make this compile on archs where VM_MIN_ADDRESS is not defined (or not exported to userland) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_mlock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/sys/t_mlock.c diff -u src/tests/lib/libc/sys/t_mlock.c:1.3 src/tests/lib/libc/sys/t_mlock.c:1.4 --- src/tests/lib/libc/sys/t_mlock.c:1.3 Fri Sep 7 20:27:12 2012 +++ src/tests/lib/libc/sys/t_mlock.c Sat Sep 8 12:25:05 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: t_mlock.c,v 1.3 2012/09/07 20:27:12 martin Exp $ */ +/* $NetBSD: t_mlock.c,v 1.4 2012/09/08 12:25:05 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_mlock.c,v 1.3 2012/09/07 20:27:12 martin Exp $"); +__RCSID("$NetBSD: t_mlock.c,v 1.4 2012/09/08 12:25:05 martin Exp $"); #include <sys/mman.h> #include <sys/resource.h> @@ -83,8 +83,10 @@ ATF_TC_BODY(mlock_err, tc) void *invalid_ptr; int null_errno = ENOMEM; /* error expected for NULL */ +#ifdef VM_MIN_ADDRESS if ((uintptr_t)VM_MIN_ADDRESS > 0) null_errno = EINVAL; /* NULL is not inside user VM */ +#endif errno = 0; ATF_REQUIRE_ERRNO(null_errno, mlock(NULL, page) == -1);