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

r1112 - in trunk/glibc-2.3-head/sysdeps/kfreebsd: . bits



Author: ps-guest
Date: 2006-01-26 21:10:49 +0000 (Thu, 26 Jan 2006)
New Revision: 1112

Removed:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat32.h
   trunk/glibc-2.3-head/sysdeps/kfreebsd/stat32conv.c
Modified:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat.h
   trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat16.h
   trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat64.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat64.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat64.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/stat16conv.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat.c
   trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat64.c
Log:
* do not use nstat() syscalls family
  the "n" doesn't stand for "new" but for "NetBSD"
  they are slower
  they are not supported in freebsd32 emulation


Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat.h
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat.h	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat.h	2006-01-26 21:10:49 UTC (rev 1112)
@@ -30,8 +30,7 @@
 #define _STAT_VER_stat	1	/* 'struct stat' in /usr/src/sys/sys/stat.h */
 #define _STAT_VER_nstat	2	/* 'struct nstat' in /usr/src/sys/sys/stat.h */
 #define _STAT_VER_gstat 3	/* glibc's 'struct stat' without LFS */
-/* By default we use _STAT_VER_gstat, but we support also _STAT_VER_stat and
-   _STAT_VER_nstat.  */
+/* By default we use _STAT_VER_gstat, but we support also _STAT_VER_stat */
 #define _STAT_VER	_STAT_VER_gstat
 
 /* Structure describing file characteristics.  */

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat16.h
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat16.h	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat16.h	2006-01-26 21:10:49 UTC (rev 1112)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2006 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
@@ -16,8 +16,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* This structure corresponds to the original FreeBSD 'struct stat'
-   (i.e. _STAT_VER_stat), and is used by the fhstat() system call.  */
+/* This structure corresponds to the standard FreeBSD 'struct stat'
+   (i.e. _STAT_VER_stat), and is used by the stat() system call family. */
+   
 struct stat16
   {
     __dev_t st_dev;		/* Device containing the file.  */
@@ -49,5 +50,10 @@
     __uint32_t st_gen;		/* Generation number.  */
 
     __uint32_t __unused1;
-    __quad_t __unused2[2];
+    
+    long int st_birthtime;	/* Time of file creation.  */
+    long int st_birthtimensec;	/* Nanoseconds of file creation.  */
+
+#define _BIRTH_PADSIZE     (2*(8 - sizeof (long)))
+    char __birth_padding[_BIRTH_PADSIZE];
   };

Deleted: trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat32.h
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat32.h	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/stat32.h	2006-01-26 21:10:49 UTC (rev 1112)
@@ -1,52 +0,0 @@
-/* Copyright (C) 2002 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.  */
-
-/* This structure corresponds to the newer FreeBSD 'struct nstat'
-   (i.e. _STAT_VER_nstat).  */
-struct stat32
-  {
-    __dev_t st_dev;		/* Device containing the file.  */
-    __ino_t st_ino;		/* File serial number.  */
-
-    __uint32_t st_mode;		/* File mode.  */
-    __uint32_t st_nlink;	/* Link count.  */
-
-    __uid_t st_uid;		/* User ID of the file's owner.  */
-    __gid_t st_gid;		/* Group ID of the file's group.  */
-
-    __dev_t st_rdev;		/* Device number, if device.  */
-
-    long int st_atime;		/* Time of last access.  */
-    long int st_atimensec;	/* Nanoseconds of last access.  */
-    long int st_mtime;		/* Time of last modification.  */
-    long int st_mtimensec;	/* Nanoseconds of last modification.  */
-    long int st_ctime;		/* Time of last status change.  */
-    long int st_ctimensec;	/* Nanoseconds of last status change.  */
-
-    __off_t st_size;		/* Size of file, in bytes.  */
-
-    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
-
-    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
-
-    __uint32_t st_flags;	/* User defined flags.  */
-
-    __uint32_t st_gen;		/* Generation number.  */
-
-    __quad_t __unused1[2];
-  };

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -19,13 +19,10 @@
 
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <bits/stat16.h>
 #include <sysdep.h>
 
 #include "stat16conv.c"
 
-extern int __syscall_fhstat (const fhandle_t *fhp, struct stat16 *buf);
-
 int
 __fhstat (const fhandle_t *fhp, struct stat *buf)
 {

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat64.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat64.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/fhstat64.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -19,13 +19,10 @@
 
 #include <sys/mount.h>
 #include <sys/stat.h>
-#include <bits/stat16.h>
 #include <sysdep.h>
 
 #include "stat16conv.c"
 
-extern int __syscall_fhstat (const fhandle_t *fhp, struct stat16 *buf);
-
 int
 fhstat64 (const fhandle_t *fhp, struct stat64 *buf)
 {

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,28 +20,21 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat16.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_fstat (int, struct stat16 *__unbounded);
-extern int __syscall_nfstat (int, struct stat32 *__unbounded);
-
 int
 __fxstat (int vers, int fd, struct stat *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nfstat (fd, __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_fstat (fd, __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat (&buf32, buf);
+	stat16_to_stat (&buf16, buf);
       return result;
     }
-  else if (__builtin_expect (vers == _STAT_VER_nstat, 1))
-    return __syscall_nfstat (fd, CHECK_1 ((struct stat32 *) buf));
   else if (__builtin_expect (vers == _STAT_VER_stat, 1))
     return __syscall_fstat (fd, CHECK_1 ((struct stat16 *) buf));
   else

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat64.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat64.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/fxstat64.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,22 +20,19 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_nfstat (int, struct stat32 *__unbounded);
-
 int
 __fxstat64 (int vers, int fd, struct stat64 *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nfstat (fd, __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_fstat (fd, __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat64 (&buf32, buf);
+	stat16_to_stat64 (&buf16, buf);
       return result;
     }
   else

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,29 +20,21 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat16.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_lstat (const char *__unbounded, struct stat16 *__unbounded);
-extern int __syscall_nlstat (const char *__unbounded, struct stat32 *__unbounded);
-
 int
 __lxstat (int vers, const char *file, struct stat *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nlstat (CHECK_STRING (file), __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_lstat (CHECK_STRING (file), __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat (&buf32, buf);
+	stat16_to_stat (&buf16, buf);
       return result;
     }
-  else if (__builtin_expect (vers == _STAT_VER_nstat, 1))
-    return __syscall_nlstat (CHECK_STRING (file),
-			     CHECK_1 ((struct stat32 *) buf));
   else if (__builtin_expect (vers == _STAT_VER_stat, 1))
     return __syscall_lstat (CHECK_STRING (file),
 			    CHECK_1 ((struct stat16 *) buf));

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat64.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat64.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/lxstat64.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,22 +20,19 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_nlstat (const char *__unbounded, struct stat32 *__unbounded);
-
 int
 __lxstat64 (int vers, const char *file, struct stat64 *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nlstat (CHECK_STRING (file), __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_lstat (CHECK_STRING (file), __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat64 (&buf32, buf);
+	stat16_to_stat64 (&buf16, buf);
       return result;
     }
   else

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/stat16conv.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/stat16conv.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/stat16conv.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -19,7 +19,15 @@
    02111-1307 USA.  */
 
 #include <string.h>
+#include <sys/mount.h>
+#include <bits/stat16.h>
 
+extern int __syscall_fhstat (const fhandle_t *fhp, struct stat16 *buf);
+extern int __syscall_fstat (int, struct stat16 *__unbounded);
+extern int __syscall_lstat (const char *__unbounded, struct stat16 *__unbounded);
+extern int __syscall_stat (const char *__unbounded, struct stat16 *__unbounded);
+
+
 /* Convert a 'struct stat16' to 'struct stat'.  */
 static inline void
 stat16_to_stat (const struct stat16 *p16, struct stat *q)
@@ -42,7 +50,9 @@
   q->st_blksize = p16->st_blksize;
   q->st_flags = p16->st_flags;
   q->st_gen = p16->st_gen;
+#if 0  
   memcpy (q->__unused1, p16->__unused2, sizeof (p16->__unused2));
+#endif  
 }
 
 /* Convert a 'struct stat16' to 'struct stat64'.  */
@@ -67,5 +77,7 @@
   q->st_blksize = p16->st_blksize;
   q->st_flags = p16->st_flags;
   q->st_gen = p16->st_gen;
+#if 0  
   memcpy (q->__unused1, p16->__unused2, sizeof (p16->__unused2));
+#endif  
 }

Deleted: trunk/glibc-2.3-head/sysdeps/kfreebsd/stat32conv.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/stat32conv.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/stat32conv.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -1,71 +0,0 @@
-/* Convert between different 'struct stat' formats.
-   Copyright (C) 2002 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-
-   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 <string.h>
-
-/* Convert a 'struct stat32' to 'struct stat'.  */
-static inline void
-stat32_to_stat (const struct stat32 *p32, struct stat *q)
-{
-  q->st_dev = p32->st_dev;
-  q->st_ino = p32->st_ino;
-  q->st_mode = p32->st_mode;
-  q->st_nlink = p32->st_nlink;
-  q->st_uid = p32->st_uid;
-  q->st_gid = p32->st_gid;
-  q->st_rdev = p32->st_rdev;
-  q->st_atime = p32->st_atime;
-  q->st_atimensec = p32->st_atimensec;
-  q->st_mtime = p32->st_mtime;
-  q->st_mtimensec = p32->st_mtimensec;
-  q->st_ctime = p32->st_ctime;
-  q->st_ctimensec = p32->st_ctimensec;
-  q->st_size = p32->st_size;
-  q->st_blocks = p32->st_blocks;
-  q->st_blksize = p32->st_blksize;
-  q->st_flags = p32->st_flags;
-  q->st_gen = p32->st_gen;
-  memcpy (q->__unused1, p32->__unused1, sizeof (p32->__unused1));
-}
-
-/* Convert a 'struct stat32' to 'struct stat64'.  */
-static inline void
-stat32_to_stat64 (const struct stat32 *p32, struct stat64 *q)
-{
-  q->st_dev = p32->st_dev;
-  q->st_ino = p32->st_ino;
-  q->st_mode = p32->st_mode;
-  q->st_nlink = p32->st_nlink;
-  q->st_uid = p32->st_uid;
-  q->st_gid = p32->st_gid;
-  q->st_rdev = p32->st_rdev;
-  q->st_atime = p32->st_atime;
-  q->st_atimensec = p32->st_atimensec;
-  q->st_mtime = p32->st_mtime;
-  q->st_mtimensec = p32->st_mtimensec;
-  q->st_ctime = p32->st_ctime;
-  q->st_ctimensec = p32->st_ctimensec;
-  q->st_size = p32->st_size;
-  q->st_blocks = p32->st_blocks;
-  q->st_blksize = p32->st_blksize;
-  q->st_flags = p32->st_flags;
-  q->st_gen = p32->st_gen;
-  memcpy (q->__unused1, p32->__unused1, sizeof (p32->__unused1));
-}

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,29 +20,21 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat16.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_stat (const char *__unbounded, struct stat16 *__unbounded);
-extern int __syscall_nstat (const char *__unbounded, struct stat32 *__unbounded);
-
 int
 __xstat (int vers, const char *file, struct stat *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nstat (CHECK_STRING (file), __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_stat (CHECK_STRING (file), __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat (&buf32, buf);
+	stat16_to_stat (&buf16, buf);
       return result;
     }
-  else if (__builtin_expect (vers == _STAT_VER_nstat, 1))
-    return __syscall_nstat (CHECK_STRING (file),
-			    CHECK_1 ((struct stat32 *) buf));
   else if (__builtin_expect (vers == _STAT_VER_stat, 1))
     return __syscall_stat (CHECK_STRING (file),
 			   CHECK_1 ((struct stat16 *) buf));

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat64.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat64.c	2006-01-26 16:58:24 UTC (rev 1111)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/xstat64.c	2006-01-26 21:10:49 UTC (rev 1112)
@@ -20,22 +20,19 @@
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
-#include <bits/stat32.h>
 #include <bp-checks.h>
 
-#include "stat32conv.c"
+#include "stat16conv.c"
 
-extern int __syscall_nstat (const char *__unbounded, struct stat32 *__unbounded);
-
 int
 __xstat64 (int vers, const char *file, struct stat64 *buf)
 {
   if (__builtin_expect (vers == _STAT_VER, 1))
     {
-      struct stat32 buf32;
-      int result = __syscall_nstat (CHECK_STRING (file), __ptrvalue (&buf32));
+      struct stat16 buf16;
+      int result = __syscall_stat (CHECK_STRING (file), __ptrvalue (&buf16));
       if (result == 0)
-	stat32_to_stat64 (&buf32, buf);
+	stat16_to_stat64 (&buf16, buf);
       return result;
     }
   else



Reply to: