summaryrefslogtreecommitdiff
path: root/sys/compat/linux32
diff options
context:
space:
mode:
authorchs <chs@NetBSD.org>2010-09-11 20:53:04 +0000
committerchs <chs@NetBSD.org>2010-09-11 20:53:04 +0000
commite0ef945ceeb539dbcab5075a742dc92df2c5fb8e (patch)
treed49e8b33ec82780956406c5958d6af91367a9c02 /sys/compat/linux32
parent590b90699b95d6d966d45fec0bd6cb91432b239a (diff)
recent versions of linux (which we now claim to be) supply a BSD-style
d_type value in getdents() results, after the d_name field. make our emulation do the same. fixes part of PR 43695.
Diffstat (limited to 'sys/compat/linux32')
-rw-r--r--sys/compat/linux32/common/linux32_dirent.c5
-rw-r--r--sys/compat/linux32/common/linux32_types.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/compat/linux32/common/linux32_dirent.c b/sys/compat/linux32/common/linux32_dirent.c
index 7a921ea2b92..730e234f8be 100644
--- a/sys/compat/linux32/common/linux32_dirent.c
+++ b/sys/compat/linux32/common/linux32_dirent.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_dirent.c,v 1.11 2010/06/24 13:03:07 hannken Exp $ */
+/* $NetBSD: linux32_dirent.c,v 1.12 2010/09/11 20:53:04 chs Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.11 2010/06/24 13:03:07 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.12 2010/09/11 20:53:04 chs Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -213,6 +213,7 @@ again:
idb.d_reclen = (u_short)linux32_reclen;
}
strcpy(idb.d_name, bdp->d_name);
+ idb.d_name[strlen(idb.d_name) + 1] = bdp->d_type;
if ((error = copyout((void *)&idb, outp, linux32_reclen)))
goto out;
/* advance past this real entry */
diff --git a/sys/compat/linux32/common/linux32_types.h b/sys/compat/linux32/common/linux32_types.h
index 72f6e2da7c8..289fe4b76c9 100644
--- a/sys/compat/linux32/common/linux32_types.h
+++ b/sys/compat/linux32/common/linux32_types.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_types.h,v 1.12 2010/07/07 01:30:36 chs Exp $ */
+/* $NetBSD: linux32_types.h,v 1.13 2010/09/11 20:53:04 chs Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -120,7 +120,7 @@ struct linux32_dirent {
linux32_ino_t d_ino;
linux32_off_t d_off;
u_short d_reclen;
- char d_name[LINUX32_MAXNAMLEN + 1];
+ char d_name[LINUX32_MAXNAMLEN + 2];
};
#endif /* !_LINUX32_TYPES_H */