Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen Make sure the kernel doesn't pass back 0 for pa...
details: https://anonhg.NetBSD.org/src/rev/fe6716b739d3
branches: trunk
changeset: 749994:fe6716b739d3
user: matt <matt%NetBSD.org@localhost>
date: Mon Dec 14 01:04:46 2009 +0000
description:
Make sure the kernel doesn't pass back 0 for pagesize.
diffstat:
lib/libc/gen/getpagesize.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (33 lines):
diff -r ca98eeb82bb4 -r fe6716b739d3 lib/libc/gen/getpagesize.c
--- a/lib/libc/gen/getpagesize.c Mon Dec 14 01:00:46 2009 +0000
+++ b/lib/libc/gen/getpagesize.c Mon Dec 14 01:04:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getpagesize.c,v 1.9 2003/08/07 16:42:50 agc Exp $ */
+/* $NetBSD: getpagesize.c,v 1.10 2009/12/14 01:04:46 matt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -34,13 +34,14 @@
#if 0
static char sccsid[] = "@(#)getpagesize.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: getpagesize.c,v 1.9 2003/08/07 16:42:50 agc Exp $");
+__RCSID("$NetBSD: getpagesize.c,v 1.10 2009/12/14 01:04:46 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/param.h>
#include <sys/sysctl.h>
+#include <assert.h>
#include <unistd.h>
#ifdef __weak_alias
@@ -61,6 +62,7 @@
size = sizeof pagsz;
if (sysctl(mib, 2, &pagsz, &size, NULL, 0) == -1)
return (-1);
+ _DIAGASSERT(pagsz);
}
return (pagsz);
}
Home |
Main Index |
Thread Index |
Old Index