Module Name: src
Committed By: njoly
Date: Fri Dec 27 14:17:11 UTC 2013
Modified Files:
src/sys/compat/linux/arch/alpha: linux_types.h syscalls.master
src/sys/compat/linux/common: linux_file64.c
Log Message:
Add struct linux_stat64 definition for alpha, and enable syscalls that
use it.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/arch/alpha/linux_types.h
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/linux/common/linux_file64.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/arch/alpha/linux_types.h
diff -u src/sys/compat/linux/arch/alpha/linux_types.h:1.6 src/sys/compat/linux/arch/alpha/linux_types.h:1.7
--- src/sys/compat/linux/arch/alpha/linux_types.h:1.6 Sun Jan 11 02:45:48 2009
+++ src/sys/compat/linux/arch/alpha/linux_types.h Fri Dec 27 14:17:11 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_types.h,v 1.6 2009/01/11 02:45:48 christos Exp $ */
+/* $NetBSD: linux_types.h,v 1.7 2013/12/27 14:17:11 njoly Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,4 +67,30 @@ struct linux_stat {
unsigned int lst_gen; /* unused */
};
+/* The stat64 structure increases the size of dev_t, blkcnt_t, adds
+ nanosecond resolution times, and padding for expansion. */
+#define LINUX_STAT64_HAS_NSEC 1
+struct linux_stat64 {
+ unsigned long lst_dev;
+ unsigned long lst_ino;
+ unsigned long lst_rdev;
+ long lst_size;
+ unsigned long lst_blocks;
+
+ unsigned int lst_mode;
+ unsigned int lst_uid;
+ unsigned int lst_gid;
+ unsigned int lst_blksize;
+ unsigned int lst_nlink;
+ unsigned int __pad0;
+
+ unsigned long lst_atime;
+ unsigned long lst_atime_nsec;
+ unsigned long lst_mtime;
+ unsigned long lst_mtime_nsec;
+ unsigned long lst_ctime;
+ unsigned long lst_ctime_nsec;
+ long __pad1[3];
+};
+
#endif /* !_ALPHA_LINUX_TYPES_H */
Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.81 src/sys/compat/linux/arch/alpha/syscalls.master:1.82
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.81 Sun Dec 8 15:55:10 2013
+++ src/sys/compat/linux/arch/alpha/syscalls.master Fri Dec 27 14:17:11 2013
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.81 2013/12/08 15:55:10 njoly Exp $
+ $NetBSD: syscalls.master,v 1.82 2013/12/27 14:17:11 njoly Exp $
;
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -675,9 +675,12 @@
struct linux_timespec *rmtp); }
423 UNIMPL semtimedop
424 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-425 UNIMPL stat64
-426 UNIMPL lstat64
-427 UNIMPL fstat64
+425 STD { int|linux_sys||stat64(const char *path, \
+ struct linux_stat64 *sp); }
+426 STD { int|linux_sys||lstat64(const char *path, \
+ struct linux_stat64 *sp); }
+427 STD { int|linux_sys||fstat64(int fd, \
+ struct linux_stat64 *sp); }
428 UNIMPL vserver
429 UNIMPL mbind
430 UNIMPL get_mempolicy
@@ -709,7 +712,7 @@
453 STD { int|linux_sys||fchownat(int fd, const char *path, \
uid_t owner, gid_t group, int flag); }
454 UNIMPL futimesat
-455 UNIMPL { int|linux_sys||fstatat64(int fd, const char *path, \
+455 STD { int|linux_sys||fstatat64(int fd, const char *path, \
struct linux_stat64 *sp, int flag); }
456 STD { int|linux_sys||unlinkat(int fd, const char *path, \
int flag); }
Index: src/sys/compat/linux/common/linux_file64.c
diff -u src/sys/compat/linux/common/linux_file64.c:1.54 src/sys/compat/linux/common/linux_file64.c:1.55
--- src/sys/compat/linux/common/linux_file64.c:1.54 Mon Nov 18 01:32:52 2013
+++ src/sys/compat/linux/common/linux_file64.c Fri Dec 27 14:17:11 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file64.c,v 1.54 2013/11/18 01:32:52 chs Exp $ */
+/* $NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.54 2013/11/18 01:32:52 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -67,8 +67,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_file64
#include <compat/linux/linux_syscallargs.h>
-#ifndef alpha
-
static void bsd_to_linux_stat(struct stat *, struct linux_stat64 *);
/*
@@ -197,6 +195,7 @@ linux_sys_fstatat64(struct lwp *l, const
return copyout(&tmplst, SCARG(uap, sp), sizeof tmplst);
}
+#ifndef __alpha__
int
linux_sys_truncate64(struct lwp *l, const struct linux_sys_truncate64_args *uap, register_t *retval)
{
@@ -230,7 +229,7 @@ linux_sys_ftruncate64(struct lwp *l, con
return sys_ftruncate(l, &ta, retval);
}
-#endif /* !alpha */
+#endif /* __alpha__ */
/*
* Linux 'readdir' call. This code is mostly taken from the