This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What should be in <sys/param.h>?


What should be in <sys/param.h>? These 2 tests are OK on ia32, but
failed on ia64 and x86_64.


H.J.
---
2005-07-16  H.J. Lu  <hongjiu.lu@intel.com>

	* posix/Makefile (tests): Add tst-param1 and tst-param2.

	* posix/tst-param1.c: New file.
	* posix/tst-param2.c: Likewise.

--- posix/Makefile.param	2005-04-22 09:55:14.000000000 -0700
+++ posix/Makefile	2005-07-16 11:35:56.179605902 -0700
@@ -87,7 +87,7 @@ tests		:= tstgetopt testfnm runtests run
 		   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
 		   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
 		   tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
-		   tst-execvp3
+		   tst-execvp3 tst-param1 tst-param2
 xtests		:= bug-ga2
 ifeq (yes,$(build-shared))
 test-srcs	:= globtest
--- posix/tst-param1.c.param	2005-07-16 10:58:23.997195931 -0700
+++ posix/tst-param1.c	2005-07-16 11:36:46.649271930 -0700
@@ -0,0 +1,72 @@
+/* Tests for <sys/param.h>.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#include <sys/param.h>
+#ifdef CHECK_VALUE
+#include <unistd.h>
+#endif
+
+int
+do_test (void)
+{
+  int hz = HZ;
+  int pagesize = EXEC_PAGESIZE;
+  int ngroups = NGROUPS;
+#ifdef CHECK_VALUE
+  int status = 0;
+
+  if (hz != sysconf(_SC_CLK_TCK))
+    {
+      status++;
+      printf ("HZ: %d != sysconf(_SC_CLK_TCK): %ld\n",
+	      hz, sysconf(_SC_CLK_TCK));
+    }
+  else
+    printf ("HZ == sysconf(_SC_CLK_TCK): %d\n", hz);
+
+  if (pagesize != sysconf(_SC_PAGESIZE))
+    {
+      status++;
+      printf ("EXEC_PAGESIZE: %d != sysconf(_SC_PAGESIZE): %ld\n",
+	      pagesize, sysconf(_SC_PAGESIZE));
+    }
+  else
+    printf ("EXEC_PAGESIZE == sysconf(_SC_PAGESIZE): %d\n", pagesize);
+
+  if (ngroups != sysconf(_SC_NGROUPS_MAX))
+    {
+      status++;
+      printf ("NGROUPS: %d != sysconf(_SC_NGROUPS_MAX): %ld\n",
+	      ngroups, sysconf(_SC_NGROUPS_MAX));
+    }
+  else
+    printf ("NGROUPS == sysconf(_SC_NGROUPS_MAX): %d\n", ngroups);
+
+  return status;
+#else
+  printf ("HZ: %d\n", hz);
+  printf ("PAGESIZE: %d\n", pagesize);
+  printf ("NGROUPS: %d\n", ngroups);
+  return 0;
+#endif
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- posix/tst-param2.c.param	2005-07-16 11:35:23.360025344 -0700
+++ posix/tst-param2.c	2005-07-16 11:35:46.931133087 -0700
@@ -0,0 +1,2 @@
+#define CHECK_VALUE
+#include "tst-param1.c"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]