[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1200 - in trunk/glibc-2.3-head: . sysdeps/kfreebsd



Author: ps-guest
Date: 2006-02-14 17:21:27 +0000 (Tue, 14 Feb 2006)
New Revision: 1200

Added:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/munmap.c
Modified:
   trunk/glibc-2.3-head/NOTES
   trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list
Log:
* let munmap() on page unaligned address return EINVAL (as on Linux)
* it hides glibc bug in libio ;-) (libio bug submitted upstream as #2337)


Modified: trunk/glibc-2.3-head/NOTES
===================================================================
--- trunk/glibc-2.3-head/NOTES	2006-02-14 13:50:11 UTC (rev 1199)
+++ trunk/glibc-2.3-head/NOTES	2006-02-14 17:21:27 UTC (rev 1200)
@@ -84,7 +84,6 @@
 		i686-kfreebsd-gnu (with -march=i686 -mtune=i686)
 	examine why for each case
 
-make[2]: *** [/build/glibc-2.3-head/build/libio/tst_wprintf2.out] Error 134 [not a regression]
 make[2]: *** [/build/glibc-2.3-head/build/posix/tst-waitid.out] Error 1
 make[2]: *** [/build/glibc-2.3-head/build/rt/tst-aio.out] Error 1
 make[2]: *** [/build/glibc-2.3-head/build/rt/tst-aio64.out] Error 1
@@ -98,46 +97,6 @@
 make[2]: *** [/build/glibc-2.3-head/build/rt/tst-timer4.o] Error 1
 make[2]: *** [/build/glibc-2.3-head/build/rt/tst-timer5.o] Error 1
 
-
-simplified tst_wprintf2:
---------------------------------------------------------
-/* gcc -O2 -std=gnu99 -Wall x.c */
-
-#include <errno.h>
-#include <error.h>
-#include <fcntl.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <wchar.h>
-
-int
-main (int argc, char *argv[])
-{
-  FILE *fp;
-
-  setlocale (LC_ALL, "");
-  perror("Here 1");
-  
-  fp = fdopen (dup (STDOUT_FILENO), "a");
-  if (fp == NULL)
-    error (EXIT_FAILURE, errno, "fdopen(,\"a\")");
-    
-  setvbuf (fp, NULL, _IONBF, 0);
-  perror("Here 2");
-  /* fwprintf to unbuffered stream.   */
-  fwprintf (fp, L"hello.\n");
-  perror("Here 3");
-  fclose (fp);
-  perror("Here 4");
-  return 0;
-}
---------------------------------------------------------
-
-
-
 * directly executing dynamic libraries (same problem with 2.3.0 too)
 
   libraries (as is also dynamic loader) are loaded at base addr 0

Added: trunk/glibc-2.3-head/sysdeps/kfreebsd/munmap.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/munmap.c	2006-02-14 13:50:11 UTC (rev 1199)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/munmap.c	2006-02-14 17:21:27 UTC (rev 1200)
@@ -0,0 +1,40 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   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 <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sysdep.h>
+
+extern void *__syscall_munmap (void *__addr, size_t __len) __THROW;
+
+int
+__munmap (void *addr, size_t len)
+{
+    int pagesize = __getpagesize ();
+    if ((unsigned long) addr & (pagesize - 1))
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+  return INLINE_SYSCALL (munmap, 2, addr, len);
+}
+
+weak_alias (__munmap, munmap)

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list	2006-02-14 13:50:11 UTC (rev 1199)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list	2006-02-14 17:21:27 UTC (rev 1200)
@@ -68,6 +68,7 @@
 mkfifo		-	mkfifo			i:si	__mkfifo	mkfifo
 sys_mknod	-	mknod			i:sii	__syscall_mknod
 sys_mmap	-	mmap			b:aniiiii __syscall_mmap
+sys_munmap	munmap	munmap			i:pi	__syscall_munmap
 modfind		-	modfind			i:s	modfind
 modfnext	-	modfnext		i:i	modfnext
 modnext		-	modnext			i:i	modnext



Reply to: