summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2005-03-10 14:12:27 +0000
committerchristos <christos@NetBSD.org>2005-03-10 14:12:27 +0000
commit47e40fce3a28bef84be109b3fd84164a658a4eaf (patch)
tree20028cfdecf8f87b658cac92ae1501ca6d3dc8a7 /sys/compat/linux
parent62d47f2703c23c87e0bbc36f70ad9804e7f00cd6 (diff)
Add nanosecond handling on the stat and stat64 code for the i386.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/arch/i386/linux_types.h23
-rw-r--r--sys/compat/linux/common/linux_file.c9
-rw-r--r--sys/compat/linux/common/linux_file64.c9
3 files changed, 27 insertions, 14 deletions
diff --git a/sys/compat/linux/arch/i386/linux_types.h b/sys/compat/linux/arch/i386/linux_types.h
index 86302c61631..0d765abaec3 100644
--- a/sys/compat/linux/arch/i386/linux_types.h
+++ b/sys/compat/linux/arch/i386/linux_types.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_types.h,v 1.12 2004/09/20 18:51:55 jdolecek Exp $ */
+/* $NetBSD: linux_types.h,v 1.13 2005/03/10 14:12:27 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -55,6 +55,7 @@ typedef unsigned char linux_cc_t;
typedef unsigned long linux_speed_t;
typedef unsigned long linux_tcflag_t;
+#define LINUX_STAT_HAS_NSEC 1
struct linux_stat {
linux_dev_t lst_dev;
unsigned short pad1;
@@ -69,11 +70,11 @@ struct linux_stat {
unsigned long lst_blksize;
unsigned long lst_blocks;
linux_time_t lst_atime;
- unsigned long unused1;
+ unsigned long lst_atime_nsec;
linux_time_t lst_mtime;
- unsigned long unused2;
+ unsigned long lst_mtime_nsec;
linux_time_t lst_ctime;
- unsigned long unused3;
+ unsigned long lst_ctime_nsec;
unsigned long unused4;
unsigned long unused5;
};
@@ -81,9 +82,10 @@ struct linux_stat {
/* This matches struct stat64 in glibc2.1, hence the absolutely
* insane amounts of padding around dev_t's.
*/
+#define LINUX_STAT64_HAS_NSEC 1
struct linux_stat64 {
unsigned long long lst_dev;
- unsigned int __pad1;
+ unsigned int __pad0;
#define LINUX_STAT64_HAS_BROKEN_ST_INO 1
unsigned int __lst_ino;
@@ -94,21 +96,22 @@ struct linux_stat64 {
unsigned int lst_gid;
unsigned long long lst_rdev;
- unsigned int __pad2;
+ unsigned int __pad1;
long long lst_size;
unsigned int lst_blksize;
- unsigned long long lst_blocks; /* Number 512-byte blocks allocated. */
+ unsigned int lst_blocks; /* Number 512-byte blocks allocated. */
+ unsigned int __pad2;
unsigned int lst_atime;
- unsigned int __unused1;
+ unsigned int lst_atime_nsec;
unsigned int lst_mtime;
- unsigned int __unused2;
+ unsigned int lst_mtime_nsec;
unsigned int lst_ctime;
- unsigned int __unused3; /* will be high 32 bits of ctime someday */
+ unsigned int lst_ctime_nsec; /* will be high 32 bits of ctime someday */
unsigned long long lst_ino;
};
diff --git a/sys/compat/linux/common/linux_file.c b/sys/compat/linux/common/linux_file.c
index 536e00c73ef..5807e8ac7b8 100644
--- a/sys/compat/linux/common/linux_file.c
+++ b/sys/compat/linux/common/linux_file.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file.c,v 1.65 2005/02/26 23:10:19 perry Exp $ */
+/* $NetBSD: linux_file.c,v 1.66 2005/03/10 14:12:28 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.65 2005/02/26 23:10:19 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.66 2005/03/10 14:12:28 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -515,6 +515,11 @@ bsd_to_linux_stat(bsp, lsp)
lsp->lst_atime = bsp->st_atime;
lsp->lst_mtime = bsp->st_mtime;
lsp->lst_ctime = bsp->st_ctime;
+#ifdef LINUX_STAT_HAS_NSEC
+ lsp->lst_atime_nsec = bsp->st_atimensec;
+ lsp->lst_mtime_nsec = bsp->st_mtimensec;
+ lsp->lst_ctime_nsec = bsp->st_ctimensec;
+#endif
}
/*
diff --git a/sys/compat/linux/common/linux_file64.c b/sys/compat/linux/common/linux_file64.c
index 3771dd0e1e1..4cf67633183 100644
--- a/sys/compat/linux/common/linux_file64.c
+++ b/sys/compat/linux/common/linux_file64.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file64.c,v 1.24 2005/02/26 23:10:19 perry Exp $ */
+/* $NetBSD: linux_file64.c,v 1.25 2005/03/10 14:12:28 christos Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.24 2005/02/26 23:10:19 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.25 2005/03/10 14:12:28 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -105,6 +105,11 @@ bsd_to_linux_stat(bsp, lsp)
lsp->lst_atime = bsp->st_atime;
lsp->lst_mtime = bsp->st_mtime;
lsp->lst_ctime = bsp->st_ctime;
+#ifdef LINUX_STAT64_HAS_NSEC
+ lsp->lst_atime_nsec = bsp->st_atimensec;
+ lsp->lst_mtime_nsec = bsp->st_mtimensec;
+ lsp->lst_ctime_nsec = bsp->st_ctimensec;
+#endif
#if LINUX_STAT64_HAS_BROKEN_ST_INO
lsp->__lst_ino = (linux_ino_t) bsp->st_ino;
#endif