summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2014-09-24 16:05:25 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2014-09-24 16:05:25 +0000
commitd4deba385f81ee4da156448f5e42b881e84c783f (patch)
tree4c70708b3334bd659e5d4b8effadde45767d1b8b
parent4a9da502c2dd984c7f3593a576e32f89d9e38d8b (diff)
downloadillumos-joyent-d4deba385f81ee4da156448f5e42b881e84c783f.tar.gz
OS-3377 lxbrand incorrect 64-bit stat conversion
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/stat.c2
-rw-r--r--usr/src/lib/brand/lx/lx_brand/sys/lx_stat.h25
2 files changed, 25 insertions, 2 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/stat.c b/usr/src/lib/brand/lx/lx_brand/common/stat.c
index f78aa2b61a..b1c9b18722 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/stat.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/stat.c
@@ -365,7 +365,9 @@ stat64_convert(uintptr_t lx_statp, struct stat64 *s, int fd)
bzero(&buf, sizeof (buf));
buf.st_dev = st_dev;
buf.st_rdev = st_rdev;
+#if defined(_ILP32)
buf.st_small_ino = (lx_ino_t)(s->st_ino & UINT_MAX);
+#endif
buf.st_ino = (lx_ino64_t)s->st_ino;
buf.st_mode = s->st_mode;
buf.st_nlink = s->st_nlink;
diff --git a/usr/src/lib/brand/lx/lx_brand/sys/lx_stat.h b/usr/src/lib/brand/lx/lx_brand/sys/lx_stat.h
index 67aa86bb1c..731555ec74 100644
--- a/usr/src/lib/brand/lx/lx_brand/sys/lx_stat.h
+++ b/usr/src/lib/brand/lx/lx_brand/sys/lx_stat.h
@@ -21,13 +21,12 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2014 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_LX_STAT_H
#define _SYS_LX_STAT_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -67,6 +66,27 @@ struct lx_stat {
uint32_t st_pad4;
};
+#if defined(_LP64)
+struct lx_stat64 {
+ ulong_t st_dev;
+ ulong_t st_ino;
+ ulong_t st_nlink; /* yes, the order really is */
+ uint_t st_mode; /* different for these two */
+ uint_t st_uid;
+ uint_t st_gid;
+ uint_t st_pad0;
+ ulong_t st_rdev;
+ long st_size;
+ long st_blksize;
+ long st_blocks;
+ struct lx_timespec st_atime;
+ struct lx_timespec st_mtime;
+ struct lx_timespec st_ctime;
+ long st_unused[3];
+};
+
+#else /* is 32-bit */
+
struct lx_stat64 {
lx_dev_t st_dev;
uint32_t st_pad1;
@@ -85,6 +105,7 @@ struct lx_stat64 {
struct lx_timespec st_ctime;
lx_ino64_t st_ino;
};
+#endif
extern int lx_stat_init(void);