changeset 20513:ed3fe7a13b27

Merge branch 'stat'
author Lauri Tirkkonen <lotheac@iki.fi>
date Tue, 16 Apr 2019 14:35:21 +0300
parents 9c9d6c2f2812 (current diff) 3fb48390baeb (diff)
children 196dde7a7729
files arch/x86/include/sys/stat_impl.h
diffstat 126 files changed, 698 insertions(+), 1119 deletions(-) [+]
line wrap: on
line diff
--- a/arch/x86/include/sys/Makefile	Sat Apr 13 09:03:04 2019 -0400
+++ b/arch/x86/include/sys/Makefile	Tue Apr 16 14:35:21 2019 +0300
@@ -46,7 +46,6 @@
 	segments.h \
 	spl.h \
 	stack.h \
-	stat_impl.h \
 	synch32.h \
 	sysconfig_impl.h \
 	sysi86.h \
--- a/arch/x86/include/sys/stat_impl.h	Sat Apr 13 09:03:04 2019 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_STAT_IMPL_H
-#define	_SYS_STAT_IMPL_H
-
-#include <sys/feature_tests.h>
-#include <sys/types.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * The implementation specific header for <sys/stat.h>
- */
-
-#if !defined(_KERNEL)
-
-#if defined(__STDC__)
-
-extern int fstat(int, struct stat *);
-extern int stat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
-
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
-	defined(_ATFILE_SOURCE)
-extern int fstatat(int, const char *, struct stat *, int);
-#endif	/* defined (_ATFILE_SOURCE) */
-
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int lstat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
-extern int mknod(const char *, mode_t, dev_t);
-#endif	/* !defined(__XOPEN_OR_POSIX) ... */
-
-#else	/* defined(__STDC__) */
-
-extern int fstat();
-extern int stat();
-
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) || \
-	defined(_ATFILE_SOURCE)
-extern int fstatat();
-#endif
-
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int lstat();
-extern int mknod();
-#endif	/* !defined(__XOPEN_OR_POSIX) ... */
-
-#endif	/* defined(__STDC__) */
-
-#if defined(__i386) && _FILE_OFFSET_BITS == 32 && \
-	(!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
-
-/*
- * Obsolete SVR3 compatibility functions.
- * Application software should NOT program to the _xstat interface.
- */
-#if defined(__STDC__)
-
-extern int _fxstat(const int, int, struct stat *);
-extern int _xstat(const int, const char *, struct stat *);
-extern int _lxstat(const int, const char *, struct stat *);
-extern int _xmknod(const int, const char *, mode_t, dev_t);
-
-#else	/* __STDC__ */
-
-extern int _fxstat();
-extern int _xstat();
-extern int _lxstat();
-extern int _xmknod();
-
-#endif	/* __STDC__ */
-
-#endif	/* defined(__i386) ... */
-
-#endif	/* !defined(_KERNEL) */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_STAT_IMPL_H */
--- a/include/stdlib.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/include/stdlib.h	Tue Apr 16 14:35:21 2019 +0300
@@ -37,6 +37,7 @@
 #include <iso/stdlib_iso.h>
 #include <iso/stdlib_c99.h>
 #include <iso/stdlib_c11.h>
+#include <inttypes.h>
 
 /*
  * Allow global visibility for symbols defined in
@@ -94,7 +95,7 @@
 
 #ifndef _UID_T
 #define	_UID_T
-typedef	unsigned int	uid_t;		/* UID type		*/
+typedef	uint32_t	uid_t;		/* UID type		*/
 #endif	/* !_UID_T */
 
 extern int rand_r(unsigned int *);
@@ -232,7 +233,6 @@
 /* OpenBSD compatibility functions */
 #if __UNLEASHED_VISIBLE
 
-#include <inttypes.h>
 extern uint32_t arc4random(void);
 extern void arc4random_buf(void *, size_t);
 extern uint32_t arc4random_uniform(uint32_t);
--- a/include/sys/fs/zut.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/include/sys/fs/zut.h	Tue Apr 16 14:35:21 2019 +0300
@@ -64,7 +64,7 @@
 	char	zl_xfile[MAXNAMELEN];
 	char	zl_real[MAXPATHLEN];	/* output */
 	uint64_t zl_xvattrs;		/* output */
-	struct stat64 zl_statbuf;	/* output */
+	struct stat zl_statbuf;	/* output */
 } zut_lookup_t;
 
 typedef struct zut_readdir {
--- a/include/sys/stat.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/include/sys/stat.h	Tue Apr 16 14:35:21 2019 +0300
@@ -33,41 +33,27 @@
 
 #include <sys/feature_tests.h>
 #include <sys/types.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * The implementation specific header <sys/time_impl.h> includes a
- * definition for timestruc_t needed by the stat structure.  However,
- * including either <time.h>, which includes <sys/time_impl.h>, or
- * including <sys/time_impl.h> directly will break both X/Open and
- * POSIX namespace. Preceeding tag, structure, and structure member
- * names with underscores eliminates the namespace breakage and at the
- * same time, with unique type names, eliminates the possibility of
- * timespec_t or timestruct_t naming conflicts that could otherwise
- * result based on the order of inclusion of <sys/stat.h> and
- * <sys/time.h>.  The header <sys/time_std_impl.h> contains the
- * standards namespace safe versions of these definitions.
- */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 #include <sys/time_impl.h>
-#else
-#include <sys/time_std_impl.h>
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 
 #define	_ST_FSTYPSZ 16		/* array size for file system type name */
 
+#if !defined(_LP64)
 /*
- * stat structure, used by stat(2) and fstat(2)
+ * temporary additional symbols to provide ABI compat for 32-bit stat.
+ * libc performs translation from the new struct (returned by the kernel) to
+ * the old one expected by userland apps.
+ *
+ * newly compiled 32-bit binaries will use the '_new' symbols through these
+ * redefine_extnames - until we can recompile old binaries that depend on the
+ * old abi that is.
  */
-
-#if defined(_KERNEL)
-
-	/* Expanded stat structure */
-
-#if defined(_LP64)
+#ifndef _LIBC_STAT_C
+#pragma redefine_extname	fstatat	fstatat_new
+#pragma redefine_extname	fstat	fstat_new
+#pragma redefine_extname	lstat	lstat_new
+#pragma redefine_extname	stat	stat_new
+#endif
+#endif
 
 struct stat {
 	dev_t		st_dev;
@@ -78,221 +64,46 @@
 	gid_t		st_gid;
 	dev_t		st_rdev;
 	off_t		st_size;
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-	blksize_t	st_blksize;
-	blkcnt_t	st_blocks;
-	char		st_fstype[_ST_FSTYPSZ];
-};
-
-struct stat64 {
-	dev_t		st_dev;
-	ino_t		st_ino;
-	mode_t		st_mode;
-	nlink_t		st_nlink;
-	uid_t		st_uid;
-	gid_t		st_gid;
-	dev_t		st_rdev;
-	off_t		st_size;
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-	blksize_t	st_blksize;
-	blkcnt_t	st_blocks;
-	char		st_fstype[_ST_FSTYPSZ];
-};
-
-#else	/* _LP64 */
-
-struct	stat {
-	dev_t		st_dev;
-	long		st_pad1[3];	/* reserve for dev expansion, */
-					/* sysid definition */
-	ino_t		st_ino;
-	mode_t		st_mode;
-	nlink_t		st_nlink;
-	uid_t		st_uid;
-	gid_t		st_gid;
-	dev_t		st_rdev;
-	long		st_pad2[2];
-	off_t		st_size;
-	long		st_pad3;	/* pad for future off_t expansion */
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-	blksize_t	st_blksize;
-	blkcnt_t	st_blocks;
-	char		st_fstype[_ST_FSTYPSZ];
-	long		st_pad4[8];	/* expansion area */
-};
-
-struct  stat64 {
-	dev_t		st_dev;
-	long		st_pad1[3];	/* reserve for dev expansion, */
-				/* sysid definition */
-	ino64_t		st_ino;
-	mode_t		st_mode;
-	nlink_t		st_nlink;
-	uid_t		st_uid;
-	gid_t		st_gid;
-	dev_t		st_rdev;
-	long		st_pad2[2];
-	off64_t		st_size;	/* large file support */
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-	blksize_t	st_blksize;
-	blkcnt64_t	st_blocks;	/* large file support */
-	char		st_fstype[_ST_FSTYPSZ];
-	long		st_pad4[8];	/* expansion area */
-};
-
-#endif	/* _LP64 */
-
-#else /* !defined(_KERNEL) */
-
-/*
- * User level stat structure definitions.
- */
-
-#if defined(_LP64)
-
-struct stat {
-	dev_t		st_dev;
-	ino_t		st_ino;
-	mode_t		st_mode;
-	nlink_t		st_nlink;
-	uid_t		st_uid;
-	gid_t		st_gid;
-	dev_t		st_rdev;
-	off_t		st_size;
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-#else
-	_timestruc_t	st_atim;
-	_timestruc_t	st_mtim;
-	_timestruc_t	st_ctim;
-#endif
+	struct timespec	st_atim;
+	struct timespec	st_mtim;
+	struct timespec	st_ctim;
 	blksize_t	st_blksize;
 	blkcnt_t	st_blocks;
 	char		st_fstype[_ST_FSTYPSZ];
 };
 
-#else	/* _LP64 */
-
-struct	stat {
-	dev_t		st_dev;
-	long		st_pad1[3];	/* reserved for network id */
+#if defined(_KERNEL) && defined(_SYSCALL32_IMPL)
+/*
+ * 32-bit process' stat struct, as viewed by the kernel.
+ *
+ * this is almost exactly same as above, with 3 differences:
+ *  - dev_t (ulong_t) vs. dev32_t (uint32_t)
+ *  - struct timespec vs. struct timespec32
+ *  - member alignment (struct packing)
+ * if the first two differences were fixed, we could swap this around by always
+ * using the same struct, *but* with aligned(8) for 32-bit user processes.
+ */
+struct stat32 {
+	dev32_t		st_dev;
 	ino_t		st_ino;
 	mode_t		st_mode;
 	nlink_t		st_nlink;
 	uid_t		st_uid;
 	gid_t		st_gid;
-	dev_t		st_rdev;
-	long		st_pad2[2];
+	dev32_t		st_rdev;
 	off_t		st_size;
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-	timestruc_t	st_atim;
-	timestruc_t	st_mtim;
-	timestruc_t	st_ctim;
-#else
-	_timestruc_t	st_atim;
-	_timestruc_t	st_mtim;
-	_timestruc_t	st_ctim;
-#endif
+	struct timespec32	st_atim;
+	struct timespec32	st_mtim;
+	struct timespec32	st_ctim;
 	blksize_t	st_blksize;
 	blkcnt_t	st_blocks;
 	char		st_fstype[_ST_FSTYPSZ];
-	long		st_pad4[8];	/* expansion area */
-};
-
-#endif	/* _LP64 */
+} __attribute__((packed));
+#endif /* defined(_KERNEL) && defined(_SYSCALL32_IMPL) */
 
-#ifndef _KERNEL
-/*
- * FIXME: source compat: *stat64 syms are aliased to non-64 ones in libc, but
- * because one of the args is a "struct stat *" and the *64 versions use
- * "struct stat64 *", we have to use a #define here for stat. the other
- * functions can use a normal decl here. NOTE: the actual decls live in
- * sys/stat_impl.h for some reason.
- */
-#define stat64 stat
-int fstat64(int, struct stat *);
-int fstatat64(int, const char *, struct stat *, int);
-int lstat64(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
-#endif
-
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 #define	st_atime	st_atim.tv_sec
 #define	st_mtime	st_mtim.tv_sec
 #define	st_ctime	st_ctim.tv_sec
-#else
-#define	st_atime	st_atim.__tv_sec
-#define	st_mtime	st_mtim.__tv_sec
-#define	st_ctime	st_ctim.__tv_sec
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-
-#endif /* end defined(_KERNEL) */
-
-#if defined(_SYSCALL32)
-
-/*
- * Kernel's view of user ILP32 stat and stat64 structures
- */
-
-struct stat32 {
-	dev32_t		st_dev;
-	int32_t		st_pad1[3];
-	ino_t		st_ino;
-	mode32_t	st_mode;
-	nlink32_t	st_nlink;
-	uid32_t		st_uid;
-	gid32_t		st_gid;
-	dev32_t		st_rdev;
-	int32_t		st_pad2[2];
-	off_t		st_size;
-	int32_t		st_pad3;
-	timestruc32_t	st_atim;
-	timestruc32_t	st_mtim;
-	timestruc32_t	st_ctim;
-	int32_t		st_blksize;
-	blkcnt32_t	st_blocks;
-	char		st_fstype[_ST_FSTYPSZ];
-	int32_t		st_pad4[8];
-};
-
-#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
-#pragma pack(4)
-#endif
-
-struct stat64_32 {
-	dev32_t		st_dev;
-	int32_t		st_pad1[3];
-	ino64_t		st_ino;
-	mode32_t	st_mode;
-	nlink32_t	st_nlink;
-	uid32_t		st_uid;
-	gid32_t		st_gid;
-	dev32_t		st_rdev;
-	int32_t		st_pad2[2];
-	off64_t		st_size;
-	timestruc32_t	st_atim;
-	timestruc32_t	st_mtim;
-	timestruc32_t	st_ctim;
-	int32_t		st_blksize;
-	blkcnt64_t	st_blocks;
-	char		st_fstype[_ST_FSTYPSZ];
-	int32_t		st_pad4[8];
-};
-
-#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
-#pragma pack()
-#endif
-
-#endif	/* _SYSCALL32 */
 
 /* MODE MASKS */
 
@@ -336,7 +147,6 @@
 #define	S_IWOTH		00002	/* write permission: other */
 #define	S_IXOTH		00001	/* execute permission: other */
 
-
 #define	S_ISFIFO(mode)	(((mode)&0xF000) == 0x1000)
 #define	S_ISCHR(mode)	(((mode)&0xF000) == 0x2000)
 #define	S_ISDIR(mode)	(((mode)&0xF000) == 0x4000)
@@ -352,58 +162,41 @@
 #define	S_TYPEISSEM(_buf)	(0)
 #define	S_TYPEISSHM(_buf)	(0)
 
-#if defined(__i386) || (defined(__i386_COMPAT) && defined(_KERNEL))
-
-/*
- * A version number is included in the x86 SVR4 stat and mknod interfaces
- * so that SVR4 binaries can be supported.  An LP64 kernel that supports
- * the i386 ABI need to be aware of this too.
- */
+#if __POSIX_VISIBLE >= 200809 || defined(_KERNEL)
+#define UTIME_NOW	-1L
+#define UTIME_OMIT	-2L
+#endif
 
-#define	_R3_MKNOD_VER	1	/* SVR3.0 mknod */
-#define	_MKNOD_VER	2	/* current version of mknod */
-#define	_R3_STAT_VER	1	/* SVR3.0 stat */
-#define	_STAT_VER	2	/* current version of stat */
-
-#endif	/* __i386 || (__i386_COMPAT && _KERNEL) */
+#if !defined(_KERNEL)
 
-#if defined(__EXTENSIONS__) || \
-	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
-	/* || defined(_XPG7) */
-/* for use with futimens() and utimensat() */
-#define	UTIME_NOW	-1L
-#define	UTIME_OMIT	-2L
-#endif	/* defined(__EXTENSIONS__) ... */
-
-#if !defined(_KERNEL) || defined(_BOOT)
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
-	defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int fchmod(int, mode_t);
-#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
-
-extern int chmod(const char *, mode_t);
-extern int mkdir(const char *, mode_t);
-extern int mkfifo(const char *, mode_t);
-extern mode_t umask(mode_t);
-
-#if defined(__EXTENSIONS__) || defined(_ATFILE_SOURCE) || \
-	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
-	/* || defined(_XPG7) */
-extern int mkdirat(int, const char *, mode_t);
-extern int mkfifoat(int, const char *, mode_t);
-extern int mknodat(int, const char *, mode_t, dev_t);
-extern int fchmodat(int, const char *, mode_t, int);
-extern int futimens(int, const struct timespec[2]);
-extern int utimensat(int, const char *, const struct timespec[2], int);
-#endif	/* defined(__EXTENSIONS__) ... */
-
-#include <sys/stat_impl.h>
-
-#endif /* !defined(_KERNEL) */
+int chmod(const char *, mode_t);
+int fstat(int, struct stat *);
+int mkdir(const char *, mode_t);
+int mkfifo(const char *, mode_t);
+int stat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
+mode_t umask(mode_t);
+#if __XPG_VISIBLE >= 420
+int fchmod(int, mode_t);
+int lstat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
+int mknod(const char *, mode_t, dev_t);
+#endif
+#if __POSIX_VISIBLE >= 200809
+int fstatat(int, const char *, struct stat *, int);
+int fchmodat(int, const char *, mode_t, int);
+int futimens(int, const struct timespec[2]);
+int mkdirat(int, const char *, mode_t);
+int mkfifoat(int, const char *, mode_t);
+int mknodat(int, const char *, mode_t, dev_t);
+int utimensat(int, const char *, const struct timespec[2], int);
+#endif
 
 #ifdef	__cplusplus
 }
 #endif
 
-#endif	/* _SYS_STAT_H */
+#endif /* !defined(_KERNEL) */
+#endif /* _SYS_STAT_H */
--- a/include/sys/types.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/include/sys/types.h	Tue Apr 16 14:35:21 2019 +0300
@@ -285,11 +285,11 @@
  * POSIX and XOPEN Declarations
  */
 typedef	int		key_t;		/* IPC key type		*/
-typedef	unsigned int	mode_t;		/* file attribute type	*/
+typedef	uint32_t	mode_t;		/* file attribute type	*/
 
 #ifndef	_UID_T
 #define	_UID_T
-typedef	unsigned int uid_t;		/* UID type		*/
+typedef	uint32_t uid_t;			/* UID type		*/
 #endif	/* _UID_T */
 
 typedef	uid_t	gid_t;			/* GID type		*/
@@ -419,7 +419,7 @@
 
 typedef ulong_t	dev_t;			/* expanded device type */
 
-typedef	unsigned int nlink_t;		/* file link type	*/
+typedef	uint32_t nlink_t;		/* file link type	*/
 typedef	int pid_t;			/* process id type	*/
 
 #if !defined(_SIZE_T) || __cplusplus >= 199711L
--- a/kernel/os/sysent.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/kernel/os/sysent.c	Tue Apr 16 14:35:21 2019 +0300
@@ -233,7 +233,7 @@
 int	signotify(int, siginfo_t *, signotify_id_t *);
 
 int	getdents64(int, void *, size_t);
-int	fstatat64(int, char *, struct stat64 *, int);
+int	fstatat64(int, char *, struct stat *, int);
 int	statvfs64(char *, struct statvfs64 *);
 int	fstatvfs64(int, struct statvfs64 *);
 int	setrlimit(int, struct rlimit *);
@@ -667,7 +667,7 @@
 extern ssize_t readv32(int32_t, caddr32_t, int32_t);
 extern ssize_t writev32(int32_t, caddr32_t, int32_t);
 extern ssize_t readlinkat32(int, caddr32_t, caddr32_t, size32_t);
-extern int fstatat64_32(int, char *, struct stat64_32 *, int);
+extern int fstatat_user32(int, char *, struct stat32 *, int);
 extern int getmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *);
 extern int putmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *);
 extern int getpmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *,
@@ -770,7 +770,7 @@
 	/* 63 */ SYSENT_CI("ulimit",		ulimit32,	2),
 	/* 64 */ SYSENT_CI("renameat",		renameat,	4),
 	/* 65 */ SYSENT_CI("unlinkat",		unlinkat,	3),
-	/* 66 */ SYSENT_CI("fstatat",		fstatat64_32,	4),
+	/* 66 */ SYSENT_CI("fstatat",		fstatat_user32,	4),
 	/* 67 */ SYSENT_NOSYS(),
 	/* 68 */ SYSENT_CI("openat",		openat64,	4),
 	/* 69 */ SYSENT_NOSYS(),
--- a/kernel/syscall/stat.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/kernel/syscall/stat.c	Tue Apr 16 14:35:21 2019 +0300
@@ -83,10 +83,10 @@
 		char startchar;
 
 		if (copyin(name, &startchar, sizeof (char)))
-			return (EFAULT);
+			return EFAULT;
 		if (startchar != '/') {
 			if ((fp = getf(fd)) == NULL) {
-				return (EBADF);
+				return EBADF;
 			}
 			startvp = fp->f_vnode;
 			cr = fp->f_cred;
@@ -110,107 +110,48 @@
 		if (startvp != NULL)
 			VN_RELE(startvp);
 		crfree(cr);
-		return (error);
+		return error;
 	}
 	if (startvp != NULL)
 		VN_RELE(startvp);
 
-	return (0);
+	return 0;
 }
 
-/*
- * Native syscall interfaces:
- *
- * N-bit kernel, N-bit applications, N-bit file offsets
- */
-
-static int cstatat(int, char *, struct stat *, int, int);
-static int cstat(vnode_t *vp, struct stat *, int, cred_t *);
-
-/*
- * fstat can and should be fast, do an inline implementation here.
- */
-#define	FSTAT_BODY(fd, sb, statfn)				\
-	{							\
-		file_t *fp;					\
-		int error;					\
-								\
-		if (fd == AT_FDCWD)				\
-			return (set_errno(EFAULT));		\
-		if ((fp = getf(fd)) == NULL)			\
-			return (set_errno(EBADF));		\
-		error = statfn(fp->f_vnode, sb, 0, fp->f_cred);	\
-		releasef(fd);					\
-		if (error)					\
-			return (set_errno(error));		\
-		return (0);					\
-	}
-
-static inline int
-fstat(int fd, struct stat *sb)
-{
-	FSTAT_BODY(fd, sb, cstat)
-}
-
-int
-fstatat(int fd, char *name, struct stat *sb, int flags)
-{
-	int followflag;
-	int csflags;
-
-	if (name == NULL)
-		return (fstat(fd, sb));
-
-	followflag = (flags & AT_SYMLINK_NOFOLLOW);
-	csflags = (flags & _AT_TRIGGER ? ATTR_TRIGGER : 0);
-	if (followflag == 0)
-		csflags |= ATTR_REAL;	/* flag for procfs lookups */
-
-	return (cstatat(fd, name, sb, followflag, csflags));
-}
-
-/*
- * Common code for stat(), lstat(), and fstat().
- * (32-bit kernel, 32-bit applications, 32-bit files)
- * (64-bit kernel, 64-bit applications, 64-bit files)
- */
 static int
-cstat(vnode_t *vp, struct stat *ubp, int flag, cred_t *cr)
+cstat(vnode_t *vp, struct stat *sb, int flag, cred_t *cr)
 {
 	struct vfssw *vswp;
-	struct stat sb;
 	vattr_t vattr;
 	int error;
 
 	vattr.va_mask = VATTR_STAT | VATTR_NBLOCKS | VATTR_BLKSIZE | VATTR_SIZE;
 	if ((error = fop_getattr(vp, &vattr, flag, cr, NULL)) != 0)
-		return (error);
+		return error;
 	if (vattr.va_size > MAXOFF_T || vattr.va_nblocks > LONG_MAX ||
 	    vattr.va_nodeid > ULONG_MAX)
-		return (EOVERFLOW);
+		return EOVERFLOW;
 
-	bzero(&sb, sizeof (sb));
-	sb.st_dev = vattr.va_fsid;
-	sb.st_ino = (ino_t)vattr.va_nodeid;
-	sb.st_mode = VTTOIF(vattr.va_type) | vattr.va_mode;
-	sb.st_nlink = vattr.va_nlink;
-	sb.st_uid = vattr.va_uid;
-	sb.st_gid = vattr.va_gid;
-	sb.st_rdev = vattr.va_rdev;
-	sb.st_size = (off_t)vattr.va_size;
-	sb.st_atim = vattr.va_atime;
-	sb.st_mtim = vattr.va_mtime;
-	sb.st_ctim = vattr.va_ctime;
-	sb.st_blksize = vattr.va_blksize;
-	sb.st_blocks = (blkcnt_t)vattr.va_nblocks;
+	bzero(sb, sizeof (struct stat));
+	sb->st_dev = vattr.va_fsid;
+	sb->st_ino = (ino_t)vattr.va_nodeid;
+	sb->st_mode = VTTOIF(vattr.va_type) | vattr.va_mode;
+	sb->st_nlink = vattr.va_nlink;
+	sb->st_uid = vattr.va_uid;
+	sb->st_gid = vattr.va_gid;
+	sb->st_rdev = vattr.va_rdev;
+	sb->st_size = (off_t)vattr.va_size;
+	sb->st_atim = vattr.va_atime;
+	sb->st_mtim = vattr.va_mtime;
+	sb->st_ctim = vattr.va_ctime;
+	sb->st_blksize = vattr.va_blksize;
+	sb->st_blocks = (blkcnt_t)vattr.va_nblocks;
 	if (vp->v_vfsp != NULL) {
 		vswp = &vfssw[vp->v_vfsp->vfs_fstype];
 		if (vswp->vsw_name && *vswp->vsw_name)
-			(void) strcpy(sb.st_fstype, vswp->vsw_name);
+			(void) strcpy(sb->st_fstype, vswp->vsw_name);
 	}
-	if (copyout(&sb, ubp, sizeof (sb)))
-		return (EFAULT);
-	return (0);
+	return 0;
 }
 
 static int
@@ -225,7 +166,7 @@
 	link_follow = (follow == AT_SYMLINK_NOFOLLOW) ? NO_FOLLOW : FOLLOW;
 lookup:
 	if (error = cstatat_getvp(fd, name, link_follow, &vp, &cred))
-		return (set_errno(error));
+		return error;
 	error = cstat(vp, sb, flags, cred);
 	crfree(cred);
 	VN_RELE(vp);
@@ -233,210 +174,87 @@
 		if (error == ESTALE &&
 		    fs_need_estale_retry(estale_retry++))
 			goto lookup;
-		return (set_errno(error));
+		return error;
 	}
-	return (0);
-}
-
-#if defined(_ILP32)
-
-/*
- * 32-bit kernel, 32-bit applications, 64-bit file offsets.
- *
- * These routines are implemented differently on 64-bit kernels.
- */
-static int cstatat64(int, char *, struct stat64 *, int, int);
-static int cstat64(vnode_t *, struct stat64 *, int, cred_t *);
-
-static inline int
-fstat64(int fd, struct stat64 *sb)
-{
-	FSTAT_BODY(fd, sb, cstat64)
-}
-
-int
-fstatat64(int fd, char *name, struct stat64 *sb, int flags)
-{
-	int followflag;
-	int csflags;
-
-	if (name == NULL)
-		return (fstat64(fd, sb));
-
-	followflag = (flags & AT_SYMLINK_NOFOLLOW);
-	csflags = (flags & _AT_TRIGGER ? ATTR_TRIGGER : 0);
-	if (followflag == 0)
-		csflags |= ATTR_REAL;	/* flag for procfs lookups */
-
-	return (cstatat64(fd, name, sb, followflag, csflags));
-}
-
-static int
-cstat64(vnode_t *vp, struct stat64 *ubp, int flag, cred_t *cr)
-{
-	struct vfssw *vswp;
-	struct stat64 lsb;
-	vattr_t vattr;
-	int error;
-
-	vattr.va_mask = VATTR_STAT | VATTR_NBLOCKS | VATTR_BLKSIZE | VATTR_SIZE;
-	if (error = fop_getattr(vp, &vattr, flag, cr, NULL))
-		return (error);
-
-	bzero(&lsb, sizeof (lsb));
-	lsb.st_dev = vattr.va_fsid;
-	lsb.st_ino = vattr.va_nodeid;
-	lsb.st_mode = VTTOIF(vattr.va_type) | vattr.va_mode;
-	lsb.st_nlink = vattr.va_nlink;
-	lsb.st_uid = vattr.va_uid;
-	lsb.st_gid = vattr.va_gid;
-	lsb.st_rdev = vattr.va_rdev;
-	lsb.st_size = vattr.va_size;
-	lsb.st_atim = vattr.va_atime;
-	lsb.st_mtim = vattr.va_mtime;
-	lsb.st_ctim = vattr.va_ctime;
-	lsb.st_blksize = vattr.va_blksize;
-	lsb.st_blocks = vattr.va_nblocks;
-	if (vp->v_vfsp != NULL) {
-		vswp = &vfssw[vp->v_vfsp->vfs_fstype];
-		if (vswp->vsw_name && *vswp->vsw_name)
-			(void) strcpy(lsb.st_fstype, vswp->vsw_name);
-	}
-	if (copyout(&lsb, ubp, sizeof (lsb)))
-		return (EFAULT);
-	return (0);
+	return 0;
 }
 
 static int
-cstatat64(int fd, char *name, struct stat64 *sb, int follow, int flags)
+fstatat_nocopy(int fd, char *name, struct stat *sb, int flags)
 {
-	vnode_t *vp;
-	int error;
-	cred_t *cred;
-	int link_follow;
-	int estale_retry = 0;
+	int ret;
+
+	if (name == NULL) {
+		file_t *fp;
 
-	link_follow = (follow == AT_SYMLINK_NOFOLLOW) ? NO_FOLLOW : FOLLOW;
-lookup:
-	if (error = cstatat_getvp(fd, name, link_follow, &vp, &cred))
-		return (set_errno(error));
-	error = cstat64(vp, sb, flags, cred);
-	crfree(cred);
-	VN_RELE(vp);
-	if (error != 0) {
-		if (error == ESTALE &&
-		    fs_need_estale_retry(estale_retry++))
-			goto lookup;
-		return (set_errno(error));
+		if (fd == AT_FDCWD)
+			return EFAULT;
+		if ((fp = getf(fd)) == NULL)
+			return EBADF;
+		ret = cstat(fp->f_vnode, sb, 0, fp->f_cred);
+		releasef(fd);
+	} else {
+		int followflag = (flags & AT_SYMLINK_NOFOLLOW);
+		int csflags = (flags & _AT_TRIGGER ? ATTR_TRIGGER : 0);
+
+		if (followflag == 0)
+			csflags |= ATTR_REAL;	/* flag for procfs lookups */
+		ret = cstatat(fd, name, sb, followflag, csflags);
 	}
-	return (0);
-}
 
-#endif	/* _ILP32 */
-
-#if defined(_SYSCALL32_IMPL)
-
-/*
- * 64-bit kernel, 32-bit applications, 64-bit file offsets.
- *
- * We'd really like to call the "native" stat calls for these ones,
- * but the problem is that the 64-bit ABI defines the 'stat64' structure
- * differently from the way the 32-bit ABI defines it.
- */
-
-static int cstatat64_32(int, char *, struct stat64_32 *, int, int);
-static int cstat64_32(vnode_t *, struct stat64_32 *, int, cred_t *);
-
-static inline int
-fstat64_32(int fd, struct stat64_32 *sb)
-{
-	FSTAT_BODY(fd, sb, cstat64_32)
+	return ret;
 }
 
 int
-fstatat64_32(int fd, char *name, struct stat64_32 *sb, int flags)
+fstatat(int fd, char *name, struct stat *usb, int flags)
 {
-	int followflag;
-	int csflags;
+	int ret;
+	struct stat sb;
 
-	if (name == NULL)
-		return (fstat64_32(fd, sb));
-
-	followflag = (flags & AT_SYMLINK_NOFOLLOW);
-	csflags = (flags & _AT_TRIGGER ? ATTR_TRIGGER : 0);
-	if (followflag == 0)
-		csflags |= ATTR_REAL;	/* flag for procfs lookups */
-
-	return (cstatat64_32(fd, name, sb, followflag, csflags));
+	ret = fstatat_nocopy(fd, name, &sb, flags);
+	if (ret != 0)
+		return set_errno(ret);
+	if (copyout(&sb, usb, sizeof (sb)))
+		return EFAULT;
+	return 0;
 }
 
-static int
-cstat64_32(vnode_t *vp, struct stat64_32 *ubp, int flag, cred_t *cr)
+#ifdef _SYSCALL32_IMPL
+int
+fstatat_user32(int fd, char *name, struct stat32 *usb, int flags)
 {
-	struct vfssw *vswp;
-	struct stat64_32 lsb;
-	vattr_t vattr;
-	int error;
-	dev32_t st_dev, st_rdev;
+	int ret;
+	struct stat nsb;
+	struct stat32 sb;
 
-	vattr.va_mask = VATTR_STAT | VATTR_NBLOCKS | VATTR_BLKSIZE | VATTR_SIZE;
-	if (error = fop_getattr(vp, &vattr, flag, cr, NULL))
-		return (error);
+	ret = fstatat_nocopy(fd, name, &nsb, flags);
+	if (ret != 0)
+		return set_errno(ret);
 
-	if (!cmpldev(&st_dev, vattr.va_fsid) ||
-	    !cmpldev(&st_rdev, vattr.va_rdev) ||
-	    TIMESPEC_OVERFLOW(&(vattr.va_atime)) ||
-	    TIMESPEC_OVERFLOW(&(vattr.va_mtime)) ||
-	    TIMESPEC_OVERFLOW(&(vattr.va_ctime)))
-		return (EOVERFLOW);
+	if (TIMESPEC_OVERFLOW(&(sb.st_atim)) ||
+	    TIMESPEC_OVERFLOW(&(sb.st_mtim)) ||
+	    TIMESPEC_OVERFLOW(&(sb.st_ctim)))
+		return set_errno(EOVERFLOW);
 
-	bzero(&lsb, sizeof (lsb));
-	lsb.st_dev = st_dev;
-	lsb.st_ino = vattr.va_nodeid;
-	lsb.st_mode = VTTOIF(vattr.va_type) | vattr.va_mode;
-	lsb.st_nlink = vattr.va_nlink;
-	lsb.st_uid = vattr.va_uid;
-	lsb.st_gid = vattr.va_gid;
-	lsb.st_rdev = st_rdev;
-	lsb.st_size = vattr.va_size;
-	TIMESPEC_TO_TIMESPEC32(&(lsb.st_atim), &(vattr.va_atime));
-	TIMESPEC_TO_TIMESPEC32(&(lsb.st_mtim), &(vattr.va_mtime));
-	TIMESPEC_TO_TIMESPEC32(&(lsb.st_ctim), &(vattr.va_ctime));
-	lsb.st_blksize = vattr.va_blksize;
-	lsb.st_blocks = vattr.va_nblocks;
-	if (vp->v_vfsp != NULL) {
-		vswp = &vfssw[vp->v_vfsp->vfs_fstype];
-		if (vswp->vsw_name && *vswp->vsw_name)
-			(void) strcpy(lsb.st_fstype, vswp->vsw_name);
-	}
-	if (copyout(&lsb, ubp, sizeof (lsb)))
-		return (EFAULT);
-	return (0);
-}
+	bzero(&sb, sizeof(struct stat32));
+	if (!cmpldev(&(sb.st_dev), nsb.st_dev) ||
+	    !cmpldev(&(sb.st_rdev), nsb.st_rdev))
+		return set_errno(EOVERFLOW);
+	sb.st_ino = nsb.st_ino;
+	sb.st_mode = nsb.st_mode;
+	sb.st_nlink = nsb.st_nlink;
+	sb.st_uid = nsb.st_uid;
+	sb.st_gid = nsb.st_gid;
+	sb.st_size = nsb.st_size;
+	TIMESPEC_TO_TIMESPEC32(&(sb.st_atim), &(nsb.st_atim));
+	TIMESPEC_TO_TIMESPEC32(&(sb.st_mtim), &(nsb.st_mtim));
+	TIMESPEC_TO_TIMESPEC32(&(sb.st_ctim), &(nsb.st_ctim));
+	sb.st_blksize = nsb.st_blksize;
+	sb.st_blocks = nsb.st_blocks;
+	strlcpy(sb.st_fstype, nsb.st_fstype, sizeof(sb.st_fstype));
 
-static int
-cstatat64_32(int fd, char *name, struct stat64_32 *sb, int follow, int flags)
-{
-	vnode_t  *vp;
-	int error;
-	cred_t *cred;
-	int link_follow;
-	int estale_retry = 0;
-
-	link_follow = (follow == AT_SYMLINK_NOFOLLOW) ? NO_FOLLOW : FOLLOW;
-lookup:
-	if (error = cstatat_getvp(fd, name, link_follow, &vp, &cred))
-		return (set_errno(error));
-	error = cstat64_32(vp, sb, flags, cred);
-	crfree(cred);
-	VN_RELE(vp);
-	if (error != 0) {
-		if (error == ESTALE &&
-		    fs_need_estale_retry(estale_retry++))
-			goto lookup;
-		return (set_errno(error));
-	}
-	return (0);
+	if (copyout(&sb, usb, sizeof (sb)))
+		return EFAULT;
+	return 0;
 }
-
-#endif /* _SYSCALL32_IMPL */
+#endif
--- a/usr/src/cmd/backup/dump/dump.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/dump.h	Tue Apr 16 14:35:21 2019 +0300
@@ -354,7 +354,7 @@
 extern int lftw(const char *,
 	int (*)(const char *, const struct stat *, int), int);
 extern int lf_lftw(const char *,
-	int (*)(const char *, const struct stat64 *, int), int);
+	int (*)(const char *, const struct stat *, int), int);
 /*
  * partial.c
  */
--- a/usr/src/cmd/backup/dump/dumpmain.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/dumpmain.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1191,11 +1191,11 @@
 char *
 rawname(char *cp)
 {
-	struct stat64 st;
+	struct stat st;
 	char *dp;
 	extern char *getfullrawname();
 
-	if (stat64(cp, &st) < 0 || (st.st_mode & S_IFMT) != S_IFBLK)
+	if (stat(cp, &st) < 0 || (st.st_mode & S_IFMT) != S_IFBLK)
 		return (cp);
 
 	dp = getfullrawname(cp);
@@ -1206,7 +1206,7 @@
 		return (0);
 	}
 
-	if (stat64(dp, &st) < 0 || (st.st_mode & S_IFMT) != S_IFCHR) {
+	if (stat(dp, &st) < 0 || (st.st_mode & S_IFMT) != S_IFCHR) {
 		free(dp);
 		return (cp);
 	}
@@ -1339,7 +1339,7 @@
 }
 
 static int
-statcmp(const struct stat64 *left, const struct stat64 *right)
+statcmp(const struct stat *left, const struct stat *right)
 {
 	int result = 1;
 
@@ -1378,8 +1378,8 @@
 	int working_mode;
 	int saverr;
 	char *errtext;
-	struct stat64 pre_stat, pre_lstat;
-	struct stat64 post_stat, post_lstat;
+	struct stat pre_stat, pre_lstat;
+	struct stat post_stat, post_lstat;
 
 	/*
 	 * Don't want to be spoofed into trashing something we
@@ -1402,11 +1402,11 @@
 	if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,
 	    perms)) < 0) {
 		if (errno == EEXIST) {
-			if (lstat64(filename, &pre_lstat) < 0) {
+			if (lstat(filename, &pre_lstat) < 0) {
 				return (-1);
 			}
 
-			if (stat64(filename, &pre_stat) < 0) {
+			if (stat(filename, &pre_stat) < 0) {
 				return (-1);
 			}
 
@@ -1422,14 +1422,14 @@
 				return (-1);
 			}
 
-			if (lstat64(filename, &post_lstat) < 0) {
+			if (lstat(filename, &post_lstat) < 0) {
 				saverr = errno;
 				(void) close(fd);
 				errno = saverr;
 				return (-1);
 			}
 
-			if (fstat64(fd, &post_stat) < 0) {
+			if (fstat(fd, &post_stat) < 0) {
 				saverr = errno;
 				(void) close(fd);
 				errno = saverr;
--- a/usr/src/cmd/backup/dump/dumponline.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/dumponline.c	Tue Apr 16 14:35:21 2019 +0300
@@ -172,7 +172,7 @@
 	char	*devname;	/* name of device (raw or block) */
 	char	*dirname;	/* name of f/s mount point */
 {
-	struct stat64 st;
+	struct stat st;
 	char	*blockname;	/* name of block device */
 	dev_t	dev;
 	int	saverr;
@@ -181,7 +181,7 @@
 		msg(gettext("Cannot obtain block name from `%s'\n"), devname);
 		return (-1);
 	}
-	if (stat64(blockname, &st) < 0) {
+	if (stat(blockname, &st) < 0) {
 		saverr = errno;
 		msg(gettext("Cannot obtain status of device `%s': %s\n"),
 		    blockname, strerror(saverr));
@@ -190,7 +190,7 @@
 	}
 	free(blockname);
 	dev = st.st_rdev;
-	if (stat64(dirname, &st) < 0) {
+	if (stat(dirname, &st) < 0) {
 		saverr = errno;
 		msg(gettext("Cannot obtain status of device `%s': %s\n"),
 		    dirname, strerror(saverr));
--- a/usr/src/cmd/backup/dump/dumptape.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/dumptape.c	Tue Apr 16 14:35:21 2019 +0300
@@ -497,7 +497,7 @@
 			if (archive && flags & BUF_ARCHIVE && !punt &&
 			    (size = write(archivefd, data, tp_bsize))
 			    != tp_bsize) {
-				struct stat64 stats;
+				struct stat stats;
 
 				if (size != -1) {
 					errmsg = strdup(gettext(
@@ -508,7 +508,7 @@
 					errmsg = strerror(errno);
 				}
 
-				if (fstat64(archivefd, &stats) < 0)
+				if (fstat(archivefd, &stats) < 0)
 				    stats.st_size = -1;
 
 				/* cast to keep lint&printf happy */
@@ -1067,10 +1067,10 @@
 int
 isrewind(int f)
 {
-	struct stat64 sbuf;
+	struct stat sbuf;
 	int	rewind;
 
-	if (fstat64(f, &sbuf) < 0) {
+	if (fstat(f, &sbuf) < 0) {
 		msg(gettext(
 		    "Cannot obtain status of output device `%s'\n"),
 		    tape);
--- a/usr/src/cmd/backup/dump/lftw.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/lftw.c	Tue Apr 16 14:35:21 2019 +0300
@@ -103,14 +103,14 @@
 
 static int lf_xftw(
 	const char *,
-	int (*)(const char *, const struct stat64 *, int),
+	int (*)(const char *, const struct stat *, int),
 	int,
-	int (*)(const char *, struct stat64 *));
+	int (*)(const char *, struct stat *));
 
 int
 lf_lftw(
 	const char *path,
-	int (*fn)(const char *, const struct stat64 *, int),
+	int (*fn)(const char *, const struct stat *, int),
 	int depth)
 {
 	int rc;
@@ -118,7 +118,7 @@
 	if ((pwdfd = open(".", O_RDONLY)) < 0) {
 		return (-1);
 	} else {
-		rc = (lf_xftw(path, fn, depth, lstat64));
+		rc = (lf_xftw(path, fn, depth, lstat));
 		(void) close(pwdfd);
 		return (rc);
 	}
@@ -128,9 +128,9 @@
 #ifdef __STDC__
 lf_xftw(
 	const char *path,
-	int (*fn)(const char *, const struct stat64 *, int),
+	int (*fn)(const char *, const struct stat *, int),
 	int depth,
-	int (*statfn)(const char *, struct stat64 *))
+	int (*statfn)(const char *, struct stat *))
 #else
 lf_xftw(char *path, int (*fn)(), int depth, int (*statfn)())
 #endif
@@ -139,7 +139,7 @@
 	int rc, sublen, saverr, attrfd;
 	DIR *dirp;
 	char *subpath, *component;
-	struct stat64 sb;
+	struct stat sb;
 	struct dirent *dp;
 	extern dev_t partial_dev;
 
--- a/usr/src/cmd/backup/dump/partial.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/dump/partial.c	Tue Apr 16 14:35:21 2019 +0300
@@ -35,7 +35,7 @@
 #ifdef __STDC__
 static dev_t devfromopts(struct mntent *);
 static int lf_mark_root(dev_t, char *);
-static int lf_ftw_mark(const char *, const struct stat64 *, int);
+static int lf_ftw_mark(const char *, const struct stat *, int);
 static void markino(ino_t);
 #else
 static dev_t devfromopts();
@@ -52,9 +52,9 @@
 #endif
 {
 	struct mntent *mnt;
-	struct stat64 st;
+	struct stat st;
 
-	if (stat64(disk, &st) < 0 ||
+	if (stat(disk, &st) < 0 ||
 	    (st.st_mode & S_IFMT) == S_IFCHR ||
 	    (st.st_mode & S_IFMT) == S_IFBLK)
 		return;
@@ -65,7 +65,7 @@
 	while (mnt = getmnttab()) {
 		st.st_dev = devfromopts(mnt);
 		if (st.st_dev == NODEV &&
-		    stat64(mnt->mnt_dir, &st) < 0)
+		    stat(mnt->mnt_dir, &st) < 0)
 			continue;
 		if (partial_dev == st.st_dev) {
 			if (disk_dynamic) {
@@ -110,7 +110,7 @@
 	char **argv;
 {
 	char *path;
-	struct stat64 st;
+	struct stat st;
 
 	if (partial == 0)
 		return (1);
@@ -118,7 +118,7 @@
 	while (--argc >= 0) {
 		path = *argv++;
 
-		if (stat64(path, &st) < 0 ||
+		if (stat(path, &st) < 0 ||
 			st.st_dev != partial_dev) {
 			msg(gettext("`%s' is not on dump device `%s'\n"),
 				path, disk);
@@ -154,7 +154,7 @@
 	dev_t dev;
 	char *path;
 {
-	struct stat64 st;
+	struct stat st;
 	char dotdot[MAXPATHLEN + 16];
 	char *slash;
 
@@ -163,7 +163,7 @@
 
 	(void) strcpy(dotdot, path);
 
-	if (stat64(dotdot, &st) < 0)
+	if (stat(dotdot, &st) < 0)
 		return (1);
 
 	/* if target is a regular file, find directory */
@@ -181,7 +181,7 @@
 
 	/* keep marking parent until we hit mount point */
 	do {
-		if (stat64(dotdot, &st) < 0 ||
+		if (stat(dotdot, &st) < 0 ||
 			(st.st_mode & S_IFMT) != S_IFDIR ||
 			st.st_dev != dev)
 			return (1);
@@ -199,10 +199,10 @@
 lf_ftw_mark(name, st, flag)
 #ifdef __STDC__
 	const char *name;
-	const struct stat64 *st;
+	const struct stat *st;
 #else
 	char *name;
-	struct stat64 *st;
+	struct stat *st;
 #endif
 	int flag;
 {
--- a/usr/src/cmd/backup/restore/symtab.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/restore/symtab.c	Tue Apr 16 14:35:21 2019 +0300
@@ -680,7 +680,7 @@
 	struct entry *ep;
 	struct entry *baseep, *lep;
 	struct symtableheader hdr;
-	struct stat64 stbuf;
+	struct stat stbuf;
 	uint_t i;
 	int fd;
 
@@ -712,7 +712,7 @@
 		    gettext("cannot open symbol table file %s\n"), filename);
 		done(1);
 	}
-	if (fstat64(fd, &stbuf) < 0) {
+	if (fstat(fd, &stbuf) < 0) {
 		perror("stat");
 		(void) fprintf(stderr,
 		    gettext("cannot stat symbol table file %s\n"), filename);
--- a/usr/src/cmd/backup/restore/tape.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/restore/tape.c	Tue Apr 16 14:35:21 2019 +0300
@@ -823,10 +823,10 @@
 		}
 
 		if (mknod(rname, mode, full_dev) < 0) {
-			struct stat64 s[1];
+			struct stat s[1];
 
 			saverr = errno;
-			if ((stat64(rname, s)) ||
+			if ((stat(rname, s)) ||
 			    ((s->st_mode & S_IFMT) != (mode & S_IFMT)) ||
 			    (s->st_rdev != full_dev)) {
 				if (saverr != EPERM || !complained_mknod) {
--- a/usr/src/cmd/backup/restore/utilities.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/backup/restore/utilities.c	Tue Apr 16 14:35:21 2019 +0300
@@ -259,7 +259,7 @@
 lf_linkit(char *existing, char *new, int type)
 {
 	char linkbuf[MAXPATHLEN];
-	struct stat64 s1[1], s2[1];
+	struct stat s1[1], s2[1];
 	char *name;
 	int dfd, l, result;
 
@@ -296,8 +296,8 @@
 	} else if (type == HARDLINK) {
 		if (link(name, new) < 0) {
 			int saverr = errno;
-			if ((stat64(name, s1) == 0) &&
-			    (stat64(new, s2) == 0) &&
+			if ((stat(name, s1) == 0) &&
+			    (stat(new, s2) == 0) &&
 			    (s1->st_dev == s2->st_dev) &&
 			    (s1->st_ino == s2->st_ino)) {
 				vprintf(stdout,
--- a/usr/src/cmd/devinfo/devinfo.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/devinfo/devinfo.c	Tue Apr 16 14:35:21 2019 +0300
@@ -131,11 +131,11 @@
 	int	slice;
 	major_t maj;
 	minor_t min;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	struct extvtoc vtdata;
 	struct dk_gpt *efi;
 
-	i = stat64(device, &statbuf);
+	i = stat(device, &statbuf);
 	if (i < 0)
 		exit(DRERR);
 	maj = major(statbuf.st_rdev);
--- a/usr/src/cmd/dumpadm/dconf.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/dumpadm/dconf.c	Tue Apr 16 14:35:21 2019 +0300
@@ -288,12 +288,12 @@
 }
 
 static int
-open_stat64(const char *path, struct stat64 *stp)
+open_stat64(const char *path, struct stat *stp)
 {
 	int fd = open64(path, O_RDONLY);
 
 	if (fd >= 0) {
-		int status = fstat64(fd, stp);
+		int status = fstat(fd, stp);
 		(void) close(fd);
 		return (status);
 	}
@@ -304,7 +304,7 @@
 static int
 dconf_swap_compare(const swapent_t *s1, const swapent_t *s2)
 {
-	struct stat64 st1, st2;
+	struct stat st1, st2;
 
 	int prefer_s1 = -1;	/* Return value to move s1 left (s1 < s2) */
 	int prefer_s2 = 1;	/* Return value to move s2 left (s1 > s2) */
@@ -452,7 +452,7 @@
 		 * or if it is not big enough to hold the dump.
 		 */
 		if (dcp->dc_mode == DC_CURRENT) {
-			struct stat64 st;
+			struct stat st;
 			uint64_t d;
 
 			if (dconf_dev_ioctl(dcp, DIOCTRYDEV) == -1)
--- a/usr/src/cmd/eject/eject.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/eject/eject.c	Tue Apr 16 14:35:21 2019 +0300
@@ -190,7 +190,7 @@
 {
 	char 		*name;
 	int		excode = EJECT_OK;
-	struct stat64	sb;
+	struct stat	sb;
 	char		*arg1, *arg2;
 	pid_t		pid;
 	int		status = 1;
@@ -268,7 +268,7 @@
 		}
 
 		if (do_query) {
-			if ((stat64(name, &sb) == 0) && S_ISDIR(sb.st_mode)) {
+			if ((stat(name, &sb) == 0) && S_ISDIR(sb.st_mode)) {
 				(void) fprintf(stderr,
 				    gettext("%s: no media\n"), name);
 				return (EJECT_NO_MEDIA);
--- a/usr/src/cmd/fm/fmd/common/fmd_ckpt.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fm/fmd/common/fmd_ckpt.c	Tue Apr 16 14:35:21 2019 +0300
@@ -137,7 +137,7 @@
 static int
 fmd_ckpt_open(fmd_ckpt_t *ckp, fmd_module_t *mp)
 {
-	struct stat64 st;
+	struct stat st;
 	uint64_t seclen;
 	uint_t i;
 	int err;
@@ -151,7 +151,7 @@
 	if ((ckp->ckp_fd = open(ckp->ckp_src, O_RDONLY)) == -1)
 		return (-1); /* failed to open checkpoint file */
 
-	if (fstat64(ckp->ckp_fd, &st) == -1) {
+	if (fstat(ckp->ckp_fd, &st) == -1) {
 		err = errno;
 		(void) close(ckp->ckp_fd);
 		return (fmd_set_errno(err));
@@ -763,7 +763,7 @@
 void
 fmd_ckpt_save(fmd_module_t *mp)
 {
-	struct stat64 st;
+	struct stat st;
 	char path[PATH_MAX];
 	mode_t dirmode;
 
@@ -794,7 +794,7 @@
 	 * to mkdir(2) a new module checkpoint directory.  If this fails, we
 	 * have no choice but to abort the checkpoint and try again later.
 	 */
-	if (stat64(mp->mod_ckpt, &st) != 0 || !S_ISDIR(st.st_mode)) {
+	if (stat(mp->mod_ckpt, &st) != 0 || !S_ISDIR(st.st_mode)) {
 		(void) snprintf(path, sizeof (path), "%s-", mp->mod_ckpt);
 		(void) rename(mp->mod_ckpt, path);
 		(void) fmd_conf_getprop(fmd.d_conf, "ckpt.dirmode", &dirmode);
--- a/usr/src/cmd/fm/fmd/common/fmd_log.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fm/fmd/common/fmd_log.c	Tue Apr 16 14:35:21 2019 +0300
@@ -56,7 +56,7 @@
  * formats we still support encoding the reference as (major, minor, inode).
  * Note that we break out of the file's dev_t into its two 32-bit components to
  * permit development of either 32-bit or 64-bit log readers and writers; the
- * LFS APIs do not yet export a 64-bit dev_t to fstat64(), so there is no way
+ * LFS APIs do not yet export a 64-bit dev_t to fstat(), so there is no way
  * for a 32-bit application to retrieve and store a 64-bit dev_t.
  *
  * In order to replay events in the event of an fmd crash, events are initially
@@ -378,7 +378,7 @@
 
 top:
 	if ((lp->log_fd = open64(lp->log_name, oflags, 0644)) == -1 ||
-	    fstat64(lp->log_fd, &lp->log_stat) == -1) {
+	    fstat(lp->log_fd, &lp->log_stat) == -1) {
 		fmd_error(EFMD_LOG_OPEN, "failed to open log %s", lp->log_name);
 		fmd_log_close(lp);
 		return (NULL);
--- a/usr/src/cmd/fm/fmd/common/fmd_log.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fm/fmd/common/fmd_log.h	Tue Apr 16 14:35:21 2019 +0300
@@ -40,7 +40,7 @@
 	char *log_name;			/* file pathname */
 	char *log_tag;			/* file content tag */
 	int log_fd;			/* file descriptor */
-	struct stat64 log_stat;		/* status of file at log_open() time */
+	struct stat log_stat;		/* status of file at log_open() time */
 	ea_file_t log_ea;		/* exacct file structure */
 	pthread_mutex_t log_lock;	/* lock for flags, refs, off, append */
 	pthread_cond_t log_cv;		/* condition variable for waiters */
--- a/usr/src/cmd/fs.d/df.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/df.c	Tue Apr 16 14:35:21 2019 +0300
@@ -731,14 +731,14 @@
 	 * either from the mnttab entry or by stat'ing the mount point.
 	 */
 	if (! mtep->mte_dev_is_valid) {
-		struct stat64 st;
+		struct stat st;
 		dev_t dev = NODEV;
 
 		dev = makedev(mtp->mnt_major, mtp->mnt_minor);
 		if (dev == 0)
 			dev = NODEV;
 		if (dev == NODEV) {
-			if (stat64(mtp->mnt_mountp, &st) == -1) {
+			if (stat(mtp->mnt_mountp, &st) == -1) {
 				return (NULL);
 			} else {
 				dev = st.st_dev;
@@ -1781,10 +1781,10 @@
 			dfrp->dfr_valid		= TRUE;
 		}
 	} else {
-		struct stat64 *arg_stat; /* array of stat structures	*/
+		struct stat *arg_stat; /* array of stat structures	*/
 		bool_int *valid_stat;	/* which structures are valid	*/
 
-		arg_stat = xmalloc(argc * sizeof (struct stat64));
+		arg_stat = xmalloc(argc * sizeof (struct stat));
 		valid_stat = xmalloc(argc * sizeof (bool_int));
 
 		/*
@@ -1803,7 +1803,7 @@
 		 * and the mount point is eliminated.
 		 */
 		for (i = 0; i < argc; i++)
-			valid_stat[i] = (stat64(argv[i], &arg_stat[i]) == 0);
+			valid_stat[i] = (stat(argv[i], &arg_stat[i]) == 0);
 
 		mtab_read_file();
 
@@ -2082,9 +2082,9 @@
 
 	for (arg = 1; arg < argc; arg++) {
 		char *file = argv[arg];
-		struct stat64 st;
+		struct stat st;
 
-		if (stat64(file, &st) == -1) {
+		if (stat(file, &st) == -1) {
 			errmsg(ERR_PERROR, "%s: ", file);
 			errors++;
 			continue;
--- a/usr/src/cmd/fs.d/mount.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/mount.c	Tue Apr 16 14:35:21 2019 +0300
@@ -229,7 +229,7 @@
 	    *newargv[ARGV_MAX],	/* arg list for specific command */
 	    *farg = NULL, *Farg = NULL;
 	int	ii, ret, cc, fscnt;
-	struct stat64	stbuf;
+	struct stat	stbuf;
 	struct vfstab	vget, vref;
 	mode_t mode;
 	FILE	*fd;
@@ -474,7 +474,7 @@
 				specific_opts = vget.vfs_mntopts;
 			}
 		} else if (special == NULL) {
-			if (stat64(mountp, &stbuf) == -1) {
+			if (stat(mountp, &stbuf) == -1) {
 				fprintf(stderr, gettext("%s: cannot stat %s\n"),
 				    myname, mountp);
 				exit(2);
@@ -1565,7 +1565,7 @@
 int
 check_fields(char *fstype, char *mountp)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 
 	if (fstype == NULL) {
 		fprintf(stderr,
@@ -1597,7 +1597,7 @@
 	 * not exist now, but will be mounted before we get to it.
 	 * This is one of the quirks of "secondary mounting".
 	 */
-	if (!aflg && stat64(mountp, &stbuf) < 0) {
+	if (!aflg && stat(mountp, &stbuf) < 0) {
 		if (errno == ENOENT || errno == ENOTDIR)
 			fprintf(stderr,
 			    gettext("%s: Mount point %s does not exist.\n"),
--- a/usr/src/cmd/fs.d/nfs/mountd/mountd.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/nfs/mountd/mountd.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1499,7 +1499,7 @@
 same_file_system(const char *path1, const char *path2)
 {
 	uint64_t fsid1, fsid2;
-	struct stat64 st1, st2;
+	struct stat st1, st2;
 	nvlist_t *nvl1 = NULL;
 	nvlist_t *nvl2 = NULL;
 
@@ -1527,11 +1527,11 @@
 	 * fall back on st_dev.
 	 */
 
-	if (stat64(path1, &st1) < 0) {
+	if (stat(path1, &st1) < 0) {
 		syslog(LOG_NOTICE, "%s: %m", path1);
 		return (B_FALSE);
 	}
-	if (stat64(path2, &st2) < 0) {
+	if (stat(path2, &st2) < 0) {
 		syslog(LOG_NOTICE, "%s: %m", path2);
 		return (B_FALSE);
 	}
--- a/usr/src/cmd/fs.d/ufs/df/df.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/df/df.c	Tue Apr 16 14:35:21 2019 +0300
@@ -87,7 +87,7 @@
 static  int 		mdev(char *, struct mnttab **);
 static struct mntlist	*mkmntlist();
 static struct mnttab	*mntdup(struct mnttab *mnt);
-static struct mntlist	*findmntent(char *, struct stat64 *, struct mntlist *);
+static struct mntlist	*findmntent(char *, struct stat *, struct mntlist *);
 
 #define	bcopy(f, t, n)	memcpy(t, f, n)
 #define	bzero(s, n)	memset(s, 0, n)
@@ -279,7 +279,7 @@
 	} else {
 		int i;
 		struct mntlist *mntl;
-		struct stat64    *argstat;
+		struct stat    *argstat;
 		char **devnames;
 		char *cp;
 
@@ -288,14 +288,14 @@
 		argc -= optind;
 
 		/*
-		 * Obtain stat64 information for each argument before
+		 * Obtain stat information for each argument before
 		 * constructing the list of mounted file systems.  This
 		 * ordering forces the automounter to establish any
 		 * mounts required to access the arguments, so that the
 		 * corresponding mount table entries will exist when
 		 * we look for them.
 		 */
-		argstat = (struct stat64 *)xmalloc(argc * sizeof (*argstat));
+		argstat = (struct stat *)xmalloc(argc * sizeof (*argstat));
 		devnames = (char **)xmalloc(argc * sizeof (char *));
 		for (i = 0; i < argc; i++) {
 
@@ -320,7 +320,7 @@
 					exit(1);
 				}
 			}
-			if (stat64(cp, &argstat[i]) < 0) {
+			if (stat(cp, &argstat[i]) < 0) {
 				errcode = errno;
 				/*
 				 * Mark as no longer interesting.
@@ -685,7 +685,7 @@
 {
 	struct mnttab mnt;
 	FILE *mnttab;
-	struct stat64 device_stat, mount_stat;
+	struct stat device_stat, mount_stat;
 	char *mname;
 
 	mnttab = fopen(MNTTAB, "r");
@@ -698,9 +698,9 @@
 			continue;
 		}
 		if (strcmp(file, mnt.mnt_special) == 0) {
-			if (stat64(mnt.mnt_mountp, &mount_stat) != 0)
+			if (stat(mnt.mnt_mountp, &mount_stat) != 0)
 				continue;
-			if (stat64(mnt.mnt_special, &device_stat) != 0)
+			if (stat(mnt.mnt_special, &device_stat) != 0)
 				continue;
 
 			if (device_stat.st_rdev == mount_stat.st_dev) {
@@ -764,7 +764,7 @@
  * those resources are necessary for accessing path.
  */
 static struct mntlist *
-findmntent(char *path, struct stat64 *pstat, struct mntlist *mlist)
+findmntent(char *path, struct stat *pstat, struct mntlist *mlist)
 {
 	static char		cwd[MAXPATHLEN];
 	char			canon[MAXPATHLEN];
@@ -822,10 +822,10 @@
 		 * containing the file by comparing device ids.
 		 */
 		if (mlp->mntl_dev == NODEV) {
-			struct stat64 fs_sb;
+			struct stat fs_sb;
 
-			if (stat64(mnt->mnt_mountp, &fs_sb) < 0 &&
-			    chroot_stat(mnt->mnt_mountp, stat64, (char *)&fs_sb,
+			if (stat(mnt->mnt_mountp, &fs_sb) < 0 &&
+			    chroot_stat(mnt->mnt_mountp, stat, (char *)&fs_sb,
 			    (char **)NULL) < 0) {
 				continue;
 			}
--- a/usr/src/cmd/fs.d/ufs/edquota/edquota.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/edquota/edquota.c	Tue Apr 16 14:35:21 2019 +0300
@@ -657,7 +657,7 @@
 {
 	struct mnttab mntp;
 	struct fsquot *fsqp;
-	struct stat64 statb;
+	struct stat statb;
 	dev_t fsdev;
 	FILE *mtab;
 	char qfilename[MAXPATHLEN];
@@ -669,14 +669,14 @@
 	while (getmntent(mtab, &mntp) == 0) {
 		if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0)
 			continue;
-		if (stat64(mntp.mnt_special, &statb) < 0)
+		if (stat(mntp.mnt_special, &statb) < 0)
 			continue;
 		if ((statb.st_mode & S_IFMT) != S_IFBLK)
 			continue;
 		fsdev = statb.st_rdev;
 		(void) snprintf(qfilename, sizeof (qfilename), "%s/%s",
 			mntp.mnt_mountp, QFNAME);
-		if (stat64(qfilename, &statb) < 0 || statb.st_dev != fsdev)
+		if (stat(qfilename, &statb) < 0 || statb.st_dev != fsdev)
 			continue;
 		fsqp = malloc(sizeof (struct fsquot));
 		if (fsqp == NULL) {
--- a/usr/src/cmd/fs.d/ufs/ff/ff.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/ff/ff.c	Tue Apr 16 14:35:21 2019 +0300
@@ -762,9 +762,9 @@
 time_t
 mod_time(char *file)
 {
-	struct stat64	stat_buf;
+	struct stat	stat_buf;
 
-	if (stat64(file, &stat_buf) < 0) {
+	if (stat(file, &stat_buf) < 0) {
 		(void) fprintf(stderr, "ff: can't stat '%s' - ignored\n", file);
 		return (0);
 	}
--- a/usr/src/cmd/fs.d/ufs/fsck/main.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/fsck/main.c	Tue Apr 16 14:35:21 2019 +0300
@@ -684,7 +684,7 @@
 void
 check_sanity(char *filename)
 {
-	struct stat64 stbd, stbr;
+	struct stat stbd, stbr;
 	char *devname;
 	struct ustat usb;
 	char vfsfilename[MAXPATHLEN];
@@ -699,7 +699,7 @@
 
 	(void) memset(found_magic, 0, sizeof (found_magic));
 
-	if (stat64(filename, &stbd) < 0) {
+	if (stat(filename, &stbd) < 0) {
 		(void) fprintf(stderr,
 		"ufs fsck: sanity check failed : cannot stat %s\n", filename);
 		exit(EXNOSTAT);
@@ -728,7 +728,7 @@
 					devname = vfsbuf.vfs_special;
 				else
 					devname = vfsbuf.vfs_fsckdev;
-				if (stat64(devname, &stbr) == 0) {
+				if (stat(devname, &stbr) == 0) {
 					if (stbr.st_rdev == stbd.st_rdev) {
 						found_magic[magic_cnt] = 1;
 						is_magic = magic_cnt;
--- a/usr/src/cmd/fs.d/ufs/fsck/utilities.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/fsck/utilities.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1433,7 +1433,7 @@
 is_errorlocked(caddr_t fs)
 {
 	int		retval;
-	struct stat64	statb;
+	struct stat	statb;
 	caddr_t		mountp;
 	struct mnttab	*mntent;
 
@@ -1442,7 +1442,7 @@
 	if (!fs)
 		return (0);
 
-	if (stat64(fs, &statb) < 0)
+	if (stat(fs, &statb) < 0)
 		return (0);
 
 	if (S_ISDIR(statb.st_mode)) {
--- a/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c	Tue Apr 16 14:35:21 2019 +0300
@@ -4195,9 +4195,9 @@
 void
 checkdev(char *rdev, char *bdev)
 {
-	struct stat64	statarea;
-
-	if (stat64(bdev, &statarea) < 0) {
+	struct stat	statarea;
+
+	if (stat(bdev, &statarea) < 0) {
 		(void) fprintf(stderr, gettext("can't check mount point; "));
 		(void) fprintf(stderr, gettext("can't stat %s\n"), bdev);
 		lockexit(32);
@@ -4208,7 +4208,7 @@
 		    bdev);
 		lockexit(32);
 	}
-	if (stat64(rdev, &statarea) < 0) {
+	if (stat(rdev, &statarea) < 0) {
 		(void) fprintf(stderr, gettext("can't stat %s\n"), rdev);
 		lockexit(32);
 	}
@@ -4222,16 +4222,16 @@
 void
 checkmount(struct mnttab *mntp, char *bdevname)
 {
-	struct stat64	statdir;
-	struct stat64	statdev;
+	struct stat	statdir;
+	struct stat	statdev;
 
 	if (strcmp(bdevname, mntp->mnt_special) == 0) {
-		if (stat64(mntp->mnt_mountp, &statdir) == -1) {
+		if (stat(mntp->mnt_mountp, &statdir) == -1) {
 			(void) fprintf(stderr, gettext("can't stat %s\n"),
 			    mntp->mnt_mountp);
 			lockexit(32);
 		}
-		if (stat64(mntp->mnt_special, &statdev) == -1) {
+		if (stat(mntp->mnt_special, &statdev) == -1) {
 			(void) fprintf(stderr, gettext("can't stat %s\n"),
 			    mntp->mnt_special);
 			lockexit(32);
--- a/usr/src/cmd/fs.d/ufs/mount/mount.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/mount/mount.c	Tue Apr 16 14:35:21 2019 +0300
@@ -548,11 +548,11 @@
 	if (checkislog(mnt->mnt_mountp)) {
 		/* update mnttab file if necessary */
 		if (!mflg) {
-			struct stat64 statb;
+			struct stat statb;
 			struct mnttagdesc mtdesc;
 			int fd;
 
-			if (stat64(mnt->mnt_mountp, &statb) != 0)
+			if (stat(mnt->mnt_mountp, &statb) != 0)
 				exit(32);
 			/* do tag ioctl */
 			mtdesc.mtd_major = major(statb.st_dev);
--- a/usr/src/cmd/fs.d/ufs/newfs/newfs.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/newfs/newfs.c	Tue Apr 16 14:35:21 2019 +0300
@@ -154,7 +154,7 @@
 main(int argc, char *argv[])
 {
 	char *special, *name;
-	struct stat64 st;
+	struct stat st;
 	int status;
 	int option;
 	struct fs *sbp;	/* Pointer to superblock (if present) */
@@ -331,7 +331,7 @@
 
 	if (*special == '\0') {
 		if (strchr(name, '/') != NULL) {
-			if (stat64(name, &st) < 0) {
+			if (stat(name, &st) < 0) {
 				(void) fprintf(stderr,
 				    gettext("newfs: %s: %s\n"),
 				    name, strerror(errno));
@@ -1014,12 +1014,12 @@
 read_sb(char *fsdev)
 {
 	static struct fs	sblock;
-	struct stat64		statb;
+	struct stat		statb;
 	int			dskfd;
 	char			*bufp = NULL;
 	int			bufsz = 0;
 
-	if (stat64(fsdev, &statb) < 0)
+	if (stat(fsdev, &statb) < 0)
 		return (0);
 
 	if ((dskfd = open64(fsdev, O_RDONLY)) < 0)
--- a/usr/src/cmd/fs.d/ufs/quot/quot.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/quot/quot.c	Tue Apr 16 14:35:21 2019 +0300
@@ -463,14 +463,14 @@
 static int
 getdev(char **devpp)
 {
-	struct stat64 statb;
+	struct stat statb;
 	FILE *fstab;
 	struct mnttab mntp;
 	char *cp;	/* Pointer to raw device name */
 
 	extern char *getfullrawname();
 
-	if (stat64(*devpp, &statb) < 0) {
+	if (stat(*devpp, &statb) < 0) {
 		perror(*devpp);
 		exit(32);
 	}
--- a/usr/src/cmd/fs.d/ufs/quota/quota.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/quota/quota.c	Tue Apr 16 14:35:21 2019 +0300
@@ -623,16 +623,16 @@
 {
 	int fd;
 	dev_t fsdev;
-	struct stat64 statb;
+	struct stat statb;
 	char qfilename[MAXPATHLEN];
 
-	if (stat64(mntp->mnt_special, &statb) < 0 ||
+	if (stat(mntp->mnt_special, &statb) < 0 ||
 	    (statb.st_mode & S_IFMT) != S_IFBLK)
 		return (0);
 	fsdev = statb.st_rdev;
 	(void) snprintf(qfilename, sizeof (qfilename), "%s/%s",
 	    mntp->mnt_mountp, QFNAME);
-	if (stat64(qfilename, &statb) < 0 || statb.st_dev != fsdev)
+	if (stat(qfilename, &statb) < 0 || statb.st_dev != fsdev)
 		return (0);
 	(void) __priv_bracket(PRIV_ON);
 	fd = open64(qfilename, O_RDONLY);
--- a/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c	Tue Apr 16 14:35:21 2019 +0300
@@ -425,7 +425,7 @@
 	struct passwd *pw;
 	int cg, i;
 	char *rawdisk;
-	struct stat64 statb;
+	struct stat statb;
 	struct dqblk dqbuf;
 	extern char *getfullrawname();
 
@@ -453,14 +453,14 @@
 		close(fi);
 		return (1);
 	}
-	if (fstat64(fileno(qf), &statb) < 0) {
+	if (fstat(fileno(qf), &statb) < 0) {
 		perror(qffile);
 		fclose(qf);
 		close(fi);
 		return (1);
 	}
 	quotadev = statb.st_dev;
-	if (stat64(fsdev, &statb) < 0) {
+	if (stat(fsdev, &statb) < 0) {
 		perror(fsdev);
 		fclose(qf);
 		close(fi);
--- a/usr/src/cmd/fs.d/ufs/repquota/repquota.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/repquota/repquota.c	Tue Apr 16 14:35:21 2019 +0300
@@ -232,7 +232,7 @@
 	FILE *qf;
 	uid_t uid;
 	struct dqblk dqbuf;
-	struct stat64 statb;
+	struct stat statb;
 
 	if (vflag || aflag)
 		(void) printf("%s (%s):\n", fsdev, fsfile);
@@ -241,7 +241,7 @@
 		perror(qffile);
 		return (1);
 	}
-	if (fstat64(fileno(qf), &statb) < 0) {
+	if (fstat(fileno(qf), &statb) < 0) {
 		perror(qffile);
 		(void) fclose(qf);
 		return (1);
--- a/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c	Tue Apr 16 14:35:21 2019 +0300
@@ -147,7 +147,7 @@
 main(int argc, char *argv[])
 {
 	char *special, *name, *mountpoint = NULL;
-	struct stat64 st;
+	struct stat st;
 	int i, mountfd;
 	int Aflag = 0;
 	char *chg[2];
@@ -163,7 +163,7 @@
 	 * For performance, don't search mnttab unless necessary
 	 */
 
-	if (stat64(special, &st) >= 0) {
+	if (stat(special, &st) >= 0) {
 		/*
 		 * If mounted directory, search mnttab for special
 		 */
@@ -196,7 +196,7 @@
 		exit(32);
 	}
 
-	if (stat64(special, &st) < 0) {
+	if (stat(special, &st) < 0) {
 		fprintf(stderr, "tunefs: "); perror(special);
 		exit(31+1);
 	}
--- a/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c	Tue Apr 16 14:35:21 2019 +0300
@@ -195,11 +195,11 @@
 {
 	major_t maj;
 	int bufsize;
-	struct stat64 st_buf;
+	struct stat st_buf;
 	struct statvfs64 stfs_buf;
 
 	*devtype = G_NO_DEV;
-	if (fstat64(*fdes, &st_buf) == -1)
+	if (fstat(*fdes, &st_buf) == -1)
 		return (-1);
 	if (!S_ISCHR(st_buf.st_mode) && !S_ISBLK(st_buf.st_mode)) {
 		if (S_ISFIFO(st_buf.st_mode))
--- a/usr/src/cmd/halt/halt.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/halt/halt.c	Tue Apr 16 14:35:21 2019 +0300
@@ -596,7 +596,7 @@
 {
 	static char root_dev_path[] = "/dev/dsk";
 	char kernpath[MAXPATHLEN];
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int rc = 0;
 
 	if (strlen(arg) > MAXPATHLEN) {
@@ -616,7 +616,7 @@
 	}
 
 	/* Create the directory if it doesn't already exist */
-	if (lstat64(mountpoint, &statbuf) != 0) {
+	if (lstat(mountpoint, &statbuf) != 0) {
 		if (mkdirp(mountpoint, 0755) != 0) {
 			(void) fprintf(stderr,
 			    gettext("Failed to create mountpoint %s\n"),
@@ -639,7 +639,7 @@
 	(void) snprintf(kernpath, MAXPATHLEN, "%s/platform/kernel/unix",
 	    mountpoint);
 
-	if (stat64(kernpath, &statbuf) != 0) {
+	if (stat(kernpath, &statbuf) != 0) {
 		(void) fprintf(stderr,
 		    gettext("%s: %s is not a root disk or dataset\n"),
 		    cmdname, arg);
--- a/usr/src/cmd/init/init.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/init/init.c	Tue Apr 16 14:35:21 2019 +0300
@@ -483,7 +483,7 @@
 static char *SYSCON	 = "/dev/syscon";	/* Virtual System console */
 static char *IOCTLSYSCON = "/etc/ioctl.syscon";	/* Last syscon modes */
 static char *ENVFILE	 = "/etc/default/init";	/* Default env. */
-static char *SU	= "/etc/sulogin";	/* Super-user program for single user */
+static char *SU	= "/sbin/sulogin";	/* Super-user program for single user */
 static char *SH	= "/bin/sh";		/* Standard shell */
 
 /*
--- a/usr/src/cmd/itadm/itadm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/itadm/itadm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -2012,7 +2012,7 @@
 	char		*pass;
 	char		buf[1024];
 	int		fd;
-	struct stat64	sbuf;
+	struct stat	sbuf;
 	size_t		rd;
 
 	if (!nvl || !key) {
@@ -2020,7 +2020,7 @@
 	}
 
 	if (passfile) {
-		ret = stat64(passfile, &sbuf);
+		ret = stat(passfile, &sbuf);
 		if ((ret != 0) || (!S_ISREG(sbuf.st_mode))) {
 			(void) fprintf(stderr,
 			    gettext("Invalid secret file %s"),
--- a/usr/src/cmd/latencytop/common/util.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/latencytop/common/util.c	Tue Apr 16 14:35:21 2019 +0300
@@ -302,9 +302,9 @@
 int
 lt_file_exist(const char *name)
 {
-	struct stat64 st;
+	struct stat st;
 
-	if (stat64(name, &st) == 0) {
+	if (stat(name, &st) == 0) {
 		return (1);
 	} else {
 		return (0);
--- a/usr/src/cmd/lofiadm/main.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/lofiadm/main.c	Tue Apr 16 14:35:21 2019 +0300
@@ -363,7 +363,7 @@
 static void
 wait_until_dev_complete(struct lofi_ioctl *li)
 {
-	struct stat64 buf;
+	struct stat buf;
 	int	cursleep;
 	char	blkpath[MAXPATHLEN];
 	char	charpath[MAXPATHLEN];
@@ -377,7 +377,7 @@
 	}
 
 	/* Check if links already present */
-	if (stat64(blkpath, &buf) == 0 && stat64(charpath, &buf) == 0)
+	if (stat(blkpath, &buf) == 0 && stat(charpath, &buf) == 0)
 		return;
 
 	/* First use di_devlink_init() */
@@ -392,17 +392,17 @@
 	 * link creation via sysevents.
 	 */
 	for (cursleep = 0; cursleep < maxsleep; cursleep += sleeptime) {
-		if (stat64(blkpath, &buf) == 0 && stat64(charpath, &buf) == 0)
+		if (stat(blkpath, &buf) == 0 && stat(charpath, &buf) == 0)
 			return;
 		(void) sleep(sleeptime);
 	}
 
 	/* one last try */
 out:
-	if (stat64(blkpath, &buf) == -1) {
+	if (stat(blkpath, &buf) == -1) {
 		die(gettext("%s was not created"), blkpath);
 	}
-	if (stat64(charpath, &buf) == -1) {
+	if (stat(charpath, &buf) == -1) {
 		die(gettext("%s was not created"), charpath);
 	}
 }
@@ -1369,7 +1369,7 @@
 	char *dir = NULL;
 	char *file = NULL;
 	int minor = 0;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int compfd = -1;
 	int uncompfd = -1;
 	ssize_t rbytes;
@@ -1386,7 +1386,7 @@
 		    filename);
 
 	/* Zero length files don't need to be uncompressed */
-	if (stat64(filename, &statbuf) == -1)
+	if (stat(filename, &statbuf) == -1)
 		die(gettext("stat: %s"), filename);
 	if (statbuf.st_size == 0)
 		return;
@@ -1493,7 +1493,7 @@
 	uint64_t *index = NULL;
 	uint64_t offset;
 	size_t real_segsize;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int compfd = -1, uncompfd = -1;
 	int tfd = -1;
 	ssize_t rbytes, wbytes, lastread;
@@ -1552,7 +1552,7 @@
 	if (fcntl(uncompfd, F_SETLKW, &lock) == -1)
 		die(gettext("fcntl: %s"), filename);
 
-	if (fstat64(uncompfd, &statbuf) == -1) {
+	if (fstat(uncompfd, &statbuf) == -1) {
 		(void) close(uncompfd);
 		die(gettext("fstat: %s"), filename);
 	}
@@ -1743,7 +1743,7 @@
 			goto cleanup;
 	}
 
-	if (fstat64(compfd, &statbuf) == -1)
+	if (fstat(compfd, &statbuf) == -1)
 		goto cleanup;
 
 	/*
@@ -1810,7 +1810,7 @@
 static void
 check_file_validity(const char *filename)
 {
-	struct stat64 buf;
+	struct stat buf;
 	int 	error;
 	int	fd;
 
@@ -1818,7 +1818,7 @@
 	if (fd == -1) {
 		die(gettext("open: %s"), filename);
 	}
-	error = fstat64(fd, &buf);
+	error = fstat(fd, &buf);
 	if (error == -1) {
 		die(gettext("fstat: %s"), filename);
 	} else if (!S_ISLOFIABLE(buf.st_mode)) {
--- a/usr/src/cmd/mdb/common/mdb/mdb_fdio.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/mdb/common/mdb/mdb_fdio.c	Tue Apr 16 14:35:21 2019 +0300
@@ -275,7 +275,7 @@
 	fd_data_t *fdp = mdb_alloc(sizeof (fd_data_t), UM_SLEEP);
 
 	struct dk_cinfo info;
-	struct stat64 st;
+	struct stat st;
 
 	switch (fd) {
 	case STDIN_FILENO:
@@ -299,7 +299,7 @@
 	 * If we are operating on a disk in raw mode, we must do our own
 	 * block-oriented i/o; otherwise we can just use read() and write().
 	 */
-	if (fstat64(fd, &st) == 0 && S_ISCHR(st.st_mode) &&
+	if (fstat(fd, &st) == 0 && S_ISCHR(st.st_mode) &&
 	    ioctl(fd, DKIOCINFO, &info) == 0)
 		io->io_ops = &fdio_bdev_ops;
 	else
--- a/usr/src/cmd/mdb/common/mdb/mdb_proc.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/mdb/common/mdb/mdb_proc.c	Tue Apr 16 14:35:21 2019 +0300
@@ -5155,7 +5155,7 @@
 
 	const mdb_tgt_regdesc_t *rdp;
 	char execname[MAXPATHLEN];
-	struct stat64 st;
+	struct stat st;
 	int perr;
 	int state;
 	struct rlimit rlim;
@@ -5240,7 +5240,7 @@
 	 * writing because /proc/object/<file> permission are masked with 0555.
 	 * If Pexecname() fails us, fall back to /proc/<pid>/object/a.out.
 	 */
-	if (t->t_pshandle != NULL && (aout_path == NULL || (stat64(aout_path,
+	if (t->t_pshandle != NULL && (aout_path == NULL || (stat(aout_path,
 	    &st) == 0 && strcmp(st.st_fstype, "proc") == 0))) {
 		GElf_Sym s;
 		aout_path = Pexecname(t->t_pshandle, execname, MAXPATHLEN);
--- a/usr/src/cmd/mkfile/mkfile.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/mkfile/mkfile.c	Tue Apr 16 14:35:21 2019 +0300
@@ -164,7 +164,7 @@
 
 		if (!nobytes) {
 			off_t written = 0;
-			struct stat64 st;
+			struct stat st;
 
 			if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
 				saverr = errno;
@@ -177,7 +177,7 @@
 				argc--;
 				continue;
 			}
-			if (fstat64(fd, &st) < 0) {
+			if (fstat(fd, &st) < 0) {
 				saverr = errno;
 				(void) fprintf(stderr, gettext(
 				    "Could not fstat64 %s: %s\n"),
--- a/usr/src/cmd/msgfmt/gnu_handle.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/msgfmt/gnu_handle.c	Tue Apr 16 14:35:21 2019 +0300
@@ -121,7 +121,7 @@
 check_utf8(const char *charset)
 {
 	int	fd;
-	struct stat64	statbuf;
+	struct stat	statbuf;
 	caddr_t	addr;
 	size_t	buflen, charset_len, utf8_len;
 	char	*c_charset, *c_utf8, *p;
@@ -134,7 +134,7 @@
 		/* no alias file found */
 		return (0);
 	}
-	if (fstat64(fd, &statbuf) == -1) {
+	if (fstat(fd, &statbuf) == -1) {
 		(void) close(fd);
 		return (0);
 	}
--- a/usr/src/cmd/msgfmt/msgfmt.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/msgfmt/msgfmt.c	Tue Apr 16 14:35:21 2019 +0300
@@ -204,7 +204,7 @@
 	char	*mbuf, *addr;
 	size_t	fsize, ln_size, ll;
 	wchar_t	*linebufhead = NULL;
-	struct stat64	statbuf;
+	struct stat	statbuf;
 	char	*filename;
 
 	/*
@@ -235,7 +235,7 @@
 		error(gettext(ERR_OPEN_FAILED), filename);
 		/* NOTREACHED */
 	}
-	if (fstat64(fd, &statbuf) == -1) {
+	if (fstat(fd, &statbuf) == -1) {
 		error(gettext(ERR_STAT_FAILED), filename);
 		/* NOTREACHED */
 	}
--- a/usr/src/cmd/ndmpd/include/tlm.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/include/tlm.h	Tue Apr 16 14:35:21 2019 +0300
@@ -405,7 +405,7 @@
 	char acl_root_dir[TLM_VOLNAME_MAX_LENGTH]; /* name of root filesystem */
 	fs_fhandle_t acl_dir_fh;		/* parent dir's info */
 	fs_fhandle_t acl_fil_fh;		/* file's info */
-	struct stat64 acl_attr;			/* file system attributes */
+	struct stat acl_attr;			/* file system attributes */
 	char uname[32];
 	char gname[32];
 } tlm_acls_t;
--- a/usr/src/cmd/ndmpd/include/tlm_buffers.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/include/tlm_buffers.h	Tue Apr 16 14:35:21 2019 +0300
@@ -168,7 +168,7 @@
 	void *bs_cookie;
 	int bs_level;
 	int bs_ldate;
-	boolean_t (*bs_fn)(struct bk_selector *bks, struct stat64 *s);
+	boolean_t (*bs_fn)(struct bk_selector *bks, struct stat *s);
 } bk_selector_t;
 
 
@@ -243,17 +243,17 @@
 
 typedef int (*path_hist_func_t)(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 
 typedef int (*dir_hist_func_t)(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *);
+    struct stat *);
 
 typedef int (*node_hist_func_t)(lbr_fhlog_call_backs_t *,
     char *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 
 lbr_fhlog_call_backs_t *lbrlog_callbacks_init(void *,
--- a/usr/src/cmd/ndmpd/include/traverse.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/include/traverse.h	Tue Apr 16 14:35:21 2019 +0300
@@ -275,7 +275,7 @@
 typedef struct fst_node {
 	char *tn_path;
 	fs_fhandle_t *tn_fh;
-	struct stat64 *tn_st;
+	struct stat *tn_st;
 } fst_node_t;
 
 extern int traverse_post(fs_traverse_t *);
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd.h	Tue Apr 16 14:35:21 2019 +0300
@@ -790,36 +790,36 @@
     boolean_t);
 extern int ndmpd_file_history_path(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 extern int ndmpd_file_history_dir(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *);
+    struct stat *);
 extern int ndmpd_file_history_node(lbr_fhlog_call_backs_t *,
     char *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 extern int
 ndmpd_path_restored(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 extern int ndmpd_fhpath_v3_cb(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 extern int ndmpd_fhdir_v3_cb(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *);
+    struct stat *);
 extern int ndmpd_fhnode_v3_cb(lbr_fhlog_call_backs_t *,
     char *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 extern int ndmpd_path_restored_v3(lbr_fhlog_call_backs_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 
 extern int ndmp_send_recovery_stat_v3(ndmpd_module_params_t *,
@@ -1034,9 +1034,9 @@
 
 extern boolean_t match(char *, char *);
 extern char *trim_whitespace(char *);
-extern int fs_getstat(char *, struct fs_fhandle *, struct stat64 *);
+extern int fs_getstat(char *, struct fs_fhandle *, struct stat *);
 extern int fs_readdir(struct fs_fhandle *, char *, long *,
-    char *, int *, struct fs_fhandle *, struct stat64 *);
+    char *, int *, struct fs_fhandle *, struct stat *);
 extern int iscreated(ndmp_lbr_params_t *nlp, char *name, tlm_acls_t *tacl,
     time_t t);
 
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_common.h	Tue Apr 16 14:35:21 2019 +0300
@@ -185,13 +185,13 @@
 
 typedef int ndmpd_write_func_t(void *, char *, ulong_t);
 
-typedef int ndmpd_file_history_path_func_t(void *, char *, struct stat64 *,
+typedef int ndmpd_file_history_path_func_t(void *, char *, struct stat *,
     u_longlong_t);
 
 typedef int ndmpd_file_history_dir_func_t(void *, char *, ulong_t,
     ulong_t);
 
-typedef int ndmpd_file_history_node_func_t(void *, ulong_t, struct stat64 *,
+typedef int ndmpd_file_history_node_func_t(void *, ulong_t, struct stat *,
     u_longlong_t);
 
 typedef int ndmpd_seek_func_t(void *, u_longlong_t, u_longlong_t);
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_fhistory.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_fhistory.c	Tue Apr 16 14:35:21 2019 +0300
@@ -114,7 +114,7 @@
  */
 int
 ndmpd_api_file_history_path_v2(void *cookie, char *name,
-    struct stat64 *file_stat, u_longlong_t fh_info)
+    struct stat *file_stat, u_longlong_t fh_info)
 {
 	ndmpd_session_t *session = (ndmpd_session_t *)cookie;
 	ndmp_fh_unix_path *entry;
@@ -294,7 +294,7 @@
  */
 int
 ndmpd_api_file_history_node_v2(void *cookie, ulong_t node,
-    struct stat64 *file_stat, u_longlong_t fh_info)
+    struct stat *file_stat, u_longlong_t fh_info)
 {
 	ndmpd_session_t *session = (ndmpd_session_t *)cookie;
 	ndmp_fh_unix_node *entry;
@@ -388,7 +388,7 @@
  */
 int
 ndmpd_api_file_history_file_v3(void *cookie, char *name,
-    struct stat64 *file_stat, u_longlong_t fh_info)
+    struct stat *file_stat, u_longlong_t fh_info)
 {
 	ndmpd_session_t *session = (ndmpd_session_t *)cookie;
 	ndmp_file_v3 *file_entry;
@@ -627,7 +627,7 @@
  */
 int
 ndmpd_api_file_history_node_v3(void *cookie, ulong_t node,
-    struct stat64 *file_stat, u_longlong_t fh_info)
+    struct stat *file_stat, u_longlong_t fh_info)
 {
 	ndmpd_session_t *session = (ndmpd_session_t *)cookie;
 	ndmp_node_v3 *node_entry;
@@ -730,7 +730,7 @@
  * Callback function for file history path information
  */
 int
-ndmpd_fhpath_v3_cb(lbr_fhlog_call_backs_t *cbp, char *path, struct stat64 *stp,
+ndmpd_fhpath_v3_cb(lbr_fhlog_call_backs_t *cbp, char *path, struct stat *stp,
     u_longlong_t off)
 {
 	int err;
@@ -787,7 +787,7 @@
  * Callback function for file history dir information
  */
 int
-ndmpd_fhdir_v3_cb(lbr_fhlog_call_backs_t *cbp, char *dir, struct stat64 *stp)
+ndmpd_fhdir_v3_cb(lbr_fhlog_call_backs_t *cbp, char *dir, struct stat *stp)
 {
 	char nm[PATH_MAX+1];
 	int nml;
@@ -901,12 +901,12 @@
 		 * backed up file.
 		 */
 		if (ndmp_fhinode) {
-			struct stat64 ret_attr;
+			struct stat ret_attr;
 
 			(void) strlcpy(dirpath, dir, PATH_MAX);
 			(void) strlcat(dirpath, "/", PATH_MAX);
 			(void) strlcat(dirpath, nm, PATH_MAX);
-			err = stat64(dirpath, &ret_attr);
+			err = stat(dirpath, &ret_attr);
 			if (err != 0) {
 				NDMP_LOG(LOG_DEBUG,
 				    "Error looking up %s", nm);
@@ -937,7 +937,7 @@
  */
 int
 ndmpd_fhnode_v3_cb(lbr_fhlog_call_backs_t *cbp, char *dir, char *file,
-    struct stat64 *stp, u_longlong_t off)
+    struct stat *stp, u_longlong_t off)
 {
 	int err;
 	ulong_t ino;
@@ -1038,7 +1038,7 @@
 /*ARGSUSED*/
 int
 ndmpd_path_restored_v3(lbr_fhlog_call_backs_t *cbp, char *name,
-    struct stat64 *st, u_longlong_t ll_idx)
+    struct stat *st, u_longlong_t ll_idx)
 {
 	int rv;
 	ndmp_lbr_params_t *nlp;
@@ -1330,7 +1330,7 @@
 /*ARGSUSED*/
 int
 ndmpd_file_history_path(lbr_fhlog_call_backs_t *cbp, char *path,
-    struct stat64 *stp, u_longlong_t off)
+    struct stat *stp, u_longlong_t off)
 {
 	int err;
 	ndmpd_module_params_t *params;
@@ -1376,7 +1376,7 @@
  */
 int
 ndmpd_file_history_dir(lbr_fhlog_call_backs_t *cbp, char *dir,
-    struct stat64 *stp)
+    struct stat *stp)
 {
 	char nm[PATH_MAX+1];
 	int nml;
@@ -1485,12 +1485,12 @@
 		 * backed up file.
 		 */
 		if (ndmp_fhinode) {
-			struct stat64 ret_attr;
+			struct stat ret_attr;
 
 			(void) strlcpy(dirpath, dir, PATH_MAX);
 			(void) strlcat(dirpath, "/", PATH_MAX);
 			(void) strlcat(dirpath, nm, PATH_MAX);
-			err = stat64(dirpath, &ret_attr);
+			err = stat(dirpath, &ret_attr);
 			if (err != 0) {
 				NDMP_LOG(LOG_DEBUG,
 				    "Error looking up %s", nm);
@@ -1522,7 +1522,7 @@
 /*ARGSUSED*/
 int
 ndmpd_file_history_node(lbr_fhlog_call_backs_t *cbp, char *dir, char *file,
-    struct stat64 *stp, u_longlong_t off)
+    struct stat *stp, u_longlong_t off)
 {
 	int err;
 	ulong_t ino;
@@ -1585,7 +1585,7 @@
  */
 /*ARGSUSED*/
 int
-ndmpd_path_restored(lbr_fhlog_call_backs_t *cbp, char *name, struct stat64 *stp,
+ndmpd_path_restored(lbr_fhlog_call_backs_t *cbp, char *name, struct stat *stp,
     u_longlong_t ll_pos)
 {
 	int rv;
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_log.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_log.c	Tue Apr 16 14:35:21 2019 +0300
@@ -196,7 +196,7 @@
 {
 	char *fname, *mode, *lpath;
 	char oldfname[PATH_MAX];
-	struct stat64 st;
+	struct stat st;
 	int i;
 
 	log_to_stderr = to_stderr;
@@ -212,7 +212,7 @@
 	if ((lpath == NULL) || (*lpath == '\0'))
 		lpath = LOG_PATH;
 
-	if (stat64(lpath, &st) < 0) {
+	if (stat(lpath, &st) < 0) {
 		if (mkdirp(lpath, 0755) < 0) {
 			(void) fprintf(stderr,
 			    "Could not create log path %s: %s\n",
@@ -234,7 +234,7 @@
 		while (i >= 0) {
 			fname = mk_pathname(LOG_FNAME, lpath, i);
 			(void) strncpy(oldfname, fname, PATH_MAX);
-			if (stat64(oldfname, &st) == -1) {
+			if (stat(oldfname, &st) == -1) {
 				i--;
 				continue;
 			}
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_mark.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_mark.c	Tue Apr 16 14:35:21 2019 +0300
@@ -253,7 +253,7 @@
 	u_longlong_t bl;
 	time_t ddate;
 	fs_fhandle_t *pfhp, *efhp;
-	struct stat64 *pstp, *estp;
+	struct stat *pstp, *estp;
 	mark_param_t *mpp;
 	ndmp_lbr_params_t *nlp;
 	tlm_acls_t *tacl;
@@ -737,7 +737,7 @@
 	int bmd;
 	u_longlong_t bl;
 	fs_fhandle_t *pfhp, *efhp;
-	struct stat64 *pstp, *estp;
+	struct stat *pstp, *estp;
 	mark_param_t *mpp;
 	ndmp_lbr_params_t *nlp;
 
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar.c	Tue Apr 16 14:35:21 2019 +0300
@@ -371,7 +371,7 @@
  */
 static boolean_t
 timecmp(bk_selector_t *bksp,
-		struct stat64 *attr)
+		struct stat *attr)
 {
 	ndmp_lbr_params_t *nlp;
 
@@ -440,7 +440,7 @@
 	acl_t *aclp = NULL;
 	char *acltp;
 
-	erc = lstat64(name, &tlm_acls->acl_attr);
+	erc = lstat(name, &tlm_acls->acl_attr);
 	if (erc != 0) {
 		NDMP_LOG(LOG_ERR, "Could not find file %s.", name);
 		erc = TLM_NO_SOURCE_FILE;
@@ -487,7 +487,7 @@
 		    js->js_job_name);
 	else
 		fil = dir;
-	erc = lstat64(fil, &tlm_acls->acl_attr);
+	erc = lstat(fil, &tlm_acls->acl_attr);
 	if (erc != 0) {
 		NDMP_LOG(LOG_ERR, "Could not find directory %s.", dir);
 		free(checkpointed_dir);
@@ -503,9 +503,9 @@
 		*spot = '/';
 	}
 	if (strcmp(root_dir, tlm_acls->acl_root_dir) != 0) {
-		struct stat64 attr;
+		struct stat attr;
 
-		erc = lstat64(root_dir, &attr);
+		erc = lstat(root_dir, &attr);
 		if (erc != 0) {
 			NDMP_LOG(LOG_ERR, "Cannot find root directory %s.",
 			    root_dir);
@@ -643,7 +643,7 @@
 {
 	struct full_dir_info dir_info; /* the blob to push/pop with cstack_t */
 	struct full_dir_info *t_dir_info, *p_dir_info;
-	struct stat64 ret_attr; /* attributes of current file name */
+	struct stat ret_attr; /* attributes of current file name */
 	fs_fhandle_t ret_fh;
 	char *first_name; /* where the first name is located */
 	char *dname;
@@ -1592,10 +1592,10 @@
 {
 	char *msg;
 	int rv;
-	struct stat64 st;
+	struct stat st;
 
 	rv = NDMP_NO_ERR;
-	if (stat64(bkpath, &st) < 0) {
+	if (stat(bkpath, &st) < 0) {
 		msg = strerror(errno);
 		MOD_LOG(params, "Error: stat(%s): %s.\n", bkpath, msg);
 		rv = NDMP_ILLEGAL_ARGS_ERR;
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_tar3.c	Tue Apr 16 14:35:21 2019 +0300
@@ -651,14 +651,14 @@
 is_valid_backup_dir_v3(ndmpd_module_params_t *params, char *bkpath)
 {
 	char *msg;
-	struct stat64 st;
+	struct stat st;
 
 	if (*bkpath != '/') {
 		MOD_LOGV3(params, NDMP_LOG_ERROR,
 		    "Relative backup path not allowed \"%s\".\n", bkpath);
 		return (FALSE);
 	}
-	if (stat64(bkpath, &st) < 0) {
+	if (stat(bkpath, &st) < 0) {
 		msg = strerror(errno);
 		MOD_LOGV3(params, NDMP_LOG_ERROR, "\"%s\" %s.\n",
 		    bkpath, msg);
@@ -1648,7 +1648,7 @@
 	longlong_t apos, bpos;
 	acl_t *aclp = NULL;
 	char *acltp;
-	struct stat64 st;
+	struct stat st;
 	char fullpath[TLM_MAX_PATH_NAME];
 	char *p;
 
@@ -1659,7 +1659,7 @@
 
 	NDMP_LOG(LOG_DEBUG, "d(%s)", bpp->bp_tmp);
 
-	if (lstat64(bpp->bp_tmp, &st) != 0)
+	if (lstat(bpp->bp_tmp, &st) != 0)
 		return (0);
 
 	if (acl_get(bpp->bp_tmp, ACL_NO_TRIVIAL, &aclp) != 0) {
@@ -1722,7 +1722,7 @@
 	longlong_t apos, bpos;
 	acl_t *aclp = NULL;
 	char *acltp;
-	struct stat64 st;
+	struct stat st;
 	char fullpath[TLM_MAX_PATH_NAME];
 	char *p;
 
@@ -1733,7 +1733,7 @@
 
 	NDMP_LOG(LOG_DEBUG, "f(%s)", bpp->bp_tmp);
 
-	if (lstat64(bpp->bp_tmp, &st) != 0)
+	if (lstat(bpp->bp_tmp, &st) != 0)
 		return (0);
 
 	if (!S_ISLNK(bpp->bp_tlmacl->acl_attr.st_mode)) {
@@ -1849,7 +1849,7 @@
 {
 	char *ent;
 	boolean_t rv;
-	struct stat64 *estp;
+	struct stat *estp;
 
 	if (!bpp || !pnp || !enp || !errp) {
 		NDMP_LOG(LOG_DEBUG, "Invalid argument");
@@ -1917,7 +1917,7 @@
  * bk_selector_t, the the object must be backed up.
  */
 static boolean_t
-ischngd(struct stat64 *stp, time_t t, ndmp_lbr_params_t *nlp)
+ischngd(struct stat *stp, time_t t, ndmp_lbr_params_t *nlp)
 {
 	boolean_t rv;
 
@@ -2033,7 +2033,7 @@
 static int
 size_cb(void *arg, fst_node_t *pnp, fst_node_t *enp)
 {
-	struct stat64 *stp;
+	struct stat *stp;
 
 	stp = enp->tn_path ? enp->tn_st : pnp->tn_st;
 	*((u_longlong_t *)arg) += stp->st_size;
@@ -2067,7 +2067,7 @@
 	int rv;
 	time_t t;
 	bk_param_v3_t *bpp;
-	struct stat64 *stp;
+	struct stat *stp;
 	fs_fhandle_t *fhp;
 
 	bpp = (bk_param_v3_t *)arg;
@@ -2112,7 +2112,7 @@
 
 		if (ischngd(stp, t, bpp->bp_nlp)) {
 			(void) memcpy(&bpp->bp_tlmacl->acl_attr, stp,
-			    sizeof (struct stat64));
+			    sizeof (struct stat));
 			rv = backup_dirv3(bpp, pnp, enp);
 		}
 	} else {
@@ -2120,7 +2120,7 @@
 		    iscreated(bpp->bp_nlp, bpp->bp_tmp, bpp->bp_tlmacl, t)) {
 			rv = 0;
 			(void) memcpy(&bpp->bp_tlmacl->acl_attr, stp,
-			    sizeof (struct stat64));
+			    sizeof (struct stat));
 			bpp->bp_tlmacl->acl_fil_fh = *fhp;
 			(void) backup_filev3(bpp, pnp, enp);
 		}
@@ -2154,7 +2154,7 @@
 	char *ent;
 	int rv;
 	bk_param_v3_t *bpp;
-	struct stat64 *stp;
+	struct stat *stp;
 	fs_fhandle_t *fhp;
 
 	bpp = (bk_param_v3_t *)arg;
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_util.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_util.c	Tue Apr 16 14:35:21 2019 +0300
@@ -2098,9 +2098,9 @@
 boolean_t
 fs_is_valid_logvol(char *path)
 {
-	struct stat64 st;
+	struct stat st;
 
-	if (stat64(path, &st) < 0)
+	if (stat(path, &st) < 0)
 		return (FALSE);
 
 	return (TRUE);
@@ -2203,9 +2203,9 @@
 boolean_t
 ndmp_is_chkpnt_root(char *path)
 {
-	struct stat64 st;
+	struct stat st;
 
-	if (stat64(path, &st) != 0) {
+	if (stat(path, &st) != 0) {
 		NDMP_LOG(LOG_DEBUG, "Couldn't stat path \"%s\"", path);
 		return (TRUE);
 	}
@@ -2256,9 +2256,9 @@
 ndmp_get_bk_dir_ino(ndmp_lbr_params_t *nlp)
 {
 	int rv;
-	struct stat64 st;
+	struct stat st;
 
-	if (stat64(nlp->nlp_backup_path, &st) != 0) {
+	if (stat(nlp->nlp_backup_path, &st) != 0) {
 		rv = -1;
 		NDMP_LOG(LOG_DEBUG, "Getting inode # of \"%s\"",
 		    nlp->nlp_backup_path);
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c	Tue Apr 16 14:35:21 2019 +0300
@@ -500,7 +500,7 @@
 {
 	ndmpd_session_t *session = (ndmpd_session_t *)
 	    (ndmpd_zfs_params->mp_daemon_cookie);
-	struct stat64 st;
+	struct stat st;
 	char *envp;
 
 	envp = MOD_GETENV(ndmpd_zfs_params, "HIST");
@@ -515,7 +515,7 @@
 	}
 
 	/* Build up a sample root dir stat */
-	(void) memset(&st, 0, sizeof (struct stat64));
+	(void) memset(&st, 0, sizeof (struct stat));
 	st.st_mode = S_IFDIR | 0777;
 	st.st_mtime = st.st_atime = st.st_ctime = time(NULL);
 	st.st_uid = st.st_gid = 0;
--- a/usr/src/cmd/ndmpd/tlm/tlm_backup_reader.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_backup_reader.c	Tue Apr 16 14:35:21 2019 +0300
@@ -243,7 +243,7 @@
 output_xattr_header(char *fname, char *aname, int fd,
     tlm_acls_t *tlm_acls, int section, tlm_cmd_t *local_commands)
 {
-	struct stat64 *attr = &tlm_acls->acl_attr;
+	struct stat *attr = &tlm_acls->acl_attr;
 	struct xattr_hdr *xhdr;
 	struct xattr_buf *xbuf;
 	tlm_tar_hdr_t *tar_hdr;
@@ -256,7 +256,7 @@
 	if (section_name == NULL)
 		return (-TLM_NO_SCRATCH_SPACE);
 
-	if (fstat64(fd, attr) == -1) {
+	if (fstat(fd, attr) == -1) {
 		NDMP_LOG(LOG_DEBUG, "output_file_header stat failed.");
 		free(section_name);
 		return (-TLM_OPEN_ERR);
@@ -349,7 +349,7 @@
     tlm_acls_t *tlm_acls, int section, tlm_cmd_t *local_commands)
 {
 	static	longlong_t file_count = 0;
-	struct stat64 *attr = &tlm_acls->acl_attr;
+	struct stat *attr = &tlm_acls->acl_attr;
 	tlm_tar_hdr_t *tar_hdr;
 	long	actual_size;
 	boolean_t long_name = FALSE;
--- a/usr/src/cmd/ndmpd/tlm/tlm_lib.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_lib.c	Tue Apr 16 14:35:21 2019 +0300
@@ -488,7 +488,7 @@
  * Call back for file history directory info
  */
 int
-tlm_log_fhdir(tlm_job_stats_t *job_stats, char *dir, struct stat64 *stp,
+tlm_log_fhdir(tlm_job_stats_t *job_stats, char *dir, struct stat *stp,
     fs_fhandle_t *fhp)
 {
 	int rv;
@@ -517,7 +517,7 @@
  */
 int
 tlm_log_fhnode(tlm_job_stats_t *job_stats, char *dir, char *file,
-    struct stat64 *stp, u_longlong_t off)
+    struct stat *stp, u_longlong_t off)
 {
 	int rv;
 	lbr_fhlog_call_backs_t *cbp; /* callbacks pointer */
@@ -547,7 +547,7 @@
  */
 int
 tlm_log_fhpath_name(tlm_job_stats_t *job_stats, char *pathname,
-    struct stat64 *stp, u_longlong_t off)
+    struct stat *stp, u_longlong_t off)
 {
 	int rv;
 	lbr_fhlog_call_backs_t *cbp; /* callbacks pointer */
@@ -1235,13 +1235,13 @@
 int
 get_zfsvolname(char *volname, int len, char *path)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 	struct extmnttab ent;
 	FILE *mntfp;
 	int rv;
 
 	*volname = '\0';
-	if (stat64(path, &stbuf) != 0) {
+	if (stat(path, &stbuf) != 0) {
 		return (-1);
 	}
 
--- a/usr/src/cmd/ndmpd/tlm/tlm_proto.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_proto.h	Tue Apr 16 14:35:21 2019 +0300
@@ -61,17 +61,17 @@
 extern int tlm_log_fhnode(tlm_job_stats_t *,
     char *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 
 extern int tlm_log_fhdir(tlm_job_stats_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     struct fs_fhandle *);
 
 extern int tlm_log_fhpath_name(tlm_job_stats_t *,
     char *,
-    struct stat64 *,
+    struct stat *,
     u_longlong_t);
 
 extern boolean_t tlm_is_too_long(int,
--- a/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_restore_writer.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1093,7 +1093,7 @@
 {
 	char c;
 	char *cp, *end;
-	struct stat64 st;
+	struct stat st;
 
 	cp = dir;
 	cp += strspn(cp, "/");
@@ -1102,7 +1102,7 @@
 		if (*cp == '\0' || *cp == '/') {
 			c = *cp;
 			*cp = '\0';
-			if (lstat64(dir, &st) < 0)
+			if (lstat(dir, &st) < 0)
 				if (mkdir(dir, 0777) < 0) {
 					NDMP_LOG(LOG_DEBUG, "Error %d"
 					    " creating directory %s",
@@ -1126,7 +1126,7 @@
 {
 	int rv;
 	char *cp;
-	struct stat64 st;
+	struct stat st;
 
 	if (!path || !*path) {
 		NDMP_LOG(LOG_DEBUG, "Invalid argument");
@@ -1136,7 +1136,7 @@
 	cp = strrchr(path, '/');
 	if (cp)
 		*cp = '\0';
-	rv = lstat64(path, &st);
+	rv = lstat(path, &st);
 	if (rv < 0)	/* need new directories */
 		rv = make_dirs(path);
 	if (cp)
@@ -1163,7 +1163,7 @@
     tlm_job_stats_t *job_stats,
     long *size_left)
 {
-	struct stat64	attr;
+	struct stat	attr;
 	int	ret, rv;
 
 	*size_left = 0;
@@ -1200,7 +1200,7 @@
 				return (ret);
 		}
 
-		ret = stat64(real_name, (struct stat64 *)&attr);
+		ret = stat(real_name, (struct stat *)&attr);
 		if (ret < 0) {
 			/*EMPTY*/
 			/* new file */
@@ -1331,7 +1331,7 @@
  * Set the extended attributes file attribute
  */
 static void
-set_xattr(int fd, struct stat64 st)
+set_xattr(int fd, struct stat st)
 {
 	struct timeval times[2];
 
@@ -1848,7 +1848,7 @@
 static int
 create_directory(char *dir, tlm_job_stats_t *job_stats)
 {
-	struct stat64 attr;
+	struct stat attr;
 	char	*p;
 	char	temp;
 	int	erc;
@@ -1865,7 +1865,7 @@
 		temp = *p;
 		if (temp == '/' || temp == 0) {
 			*p = 0;
-			if (stat64(dir, &attr) < 0) {
+			if (stat(dir, &attr) < 0) {
 				if (mkdir(dir, 0777) != 0 && errno != EEXIST) {
 					erc = errno;
 					job_stats->js_errors++;
@@ -1920,7 +1920,7 @@
     tlm_job_stats_t *job_stats)
 {
 	int erc;
-	struct stat64 *st;
+	struct stat *st;
 
 	erc = mkbasedir(dst);
 	if (erc != 0)
@@ -2083,7 +2083,7 @@
 {
 	struct utimbuf tbuf;
 	boolean_t priv_all = FALSE;
-	struct stat64 *st;
+	struct stat *st;
 	uid_t uid;
 	gid_t gid;
 	struct passwd *pwd;
--- a/usr/src/cmd/ndmpd/tlm/tlm_traverse.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_traverse.c	Tue Apr 16 14:35:21 2019 +0300
@@ -101,7 +101,7 @@
 	char *ts_ent;
 	long ts_dpos; /* position in the directory when reading its entries */
 	fs_fhandle_t ts_fh;
-	struct stat64 ts_st;
+	struct stat ts_st;
 } traverse_state_t;
 
 /*
@@ -129,7 +129,7 @@
 #define	MAX_DENT_BUF_SIZE	(8 * 1024)
 
 typedef struct {
-	struct stat64 fd_attr;
+	struct stat fd_attr;
 	fs_fhandle_t fd_fh;
 	short fd_len;
 	char fd_name[1];
@@ -150,7 +150,7 @@
  */
 static int
 fs_populate_dents(void *arg, int namelen,
-    char *name, long *countp, struct stat64 *attr,
+    char *name, long *countp, struct stat *attr,
     fs_fhandle_t *fh)
 {
 	dent_arg_t *darg = (dent_arg_t *)arg;
@@ -200,9 +200,9 @@
  * Create a file handle and get stats for the given path
  */
 int
-fs_getstat(char *path, fs_fhandle_t *fh, struct stat64 *st)
+fs_getstat(char *path, fs_fhandle_t *fh, struct stat *st)
 {
-	if (lstat64(path, st) == -1)
+	if (lstat(path, st) == -1)
 		return (errno);
 
 	fh->fh_fid = st->st_ino;
@@ -226,7 +226,7 @@
 	struct dirent *ptr;
 	char file_path[PATH_MAX + 1];
 	fs_fhandle_t fh;
-	struct stat64 st;
+	struct stat st;
 	char *p;
 	int len;
 	int rv;
@@ -254,7 +254,7 @@
 		(void) strlcat(file_path, ptr->d_name, PATH_MAX + 1);
 		(void) memset(&fh, 0, sizeof (fs_fhandle_t));
 
-		if (lstat64(file_path, &st) != 0) {
+		if (lstat(file_path, &st) != 0) {
 			rv = -1;
 			break;
 		}
@@ -284,7 +284,7 @@
  */
 int
 fs_readdir(fs_fhandle_t *ts_fh, char *path, long *dpos,
-    char *nm, int *el, fs_fhandle_t *efh, struct stat64 *est)
+    char *nm, int *el, fs_fhandle_t *efh, struct stat *est)
 {
 	struct dirent *dp;
 	char  file_path[PATH_MAX + 1];
@@ -333,7 +333,7 @@
 	int pl, el; /* path and directory entry length */
 	cstack_t *sp;
 	fs_fhandle_t pfh, efh;
-	struct stat64 pst, est;
+	struct stat pst, est;
 	traverse_state_t *tsp;
 	struct fst_node pn, en; /* parent and entry nodes */
 
@@ -752,7 +752,7 @@
 
 	cstack_t *sp;
 	fs_fhandle_t pfh, efh;
-	struct stat64 pst, est;
+	struct stat pst, est;
 	traverse_state_t *tsp;
 	struct fst_node pn, en;  /* parent and entry nodes */
 	dent_arg_t darg;
@@ -1060,8 +1060,8 @@
 {
 	FILE *src_fh = 0;
 	FILE *dst_fh = 0;
-	struct stat64 src_attr;
-	struct stat64 dst_attr;
+	struct stat src_attr;
+	struct stat dst_attr;
 	char *buf = 0;
 	u_longlong_t bytes_to_copy;
 	size_t nbytes;
@@ -1084,7 +1084,7 @@
 		return (-3);
 	}
 
-	if (stat64(src, &src_attr) < 0) {
+	if (stat(src, &src_attr) < 0) {
 		free(buf);
 		(void) fclose(src_fh);
 		(void) fclose(dst_fh);
@@ -1113,7 +1113,7 @@
 		return (-4);
 	}
 
-	if (stat64(src, &dst_attr) < 0) {
+	if (stat(src, &dst_attr) < 0) {
 		free(buf);
 		return (-2);
 	}
--- a/usr/src/cmd/ndmpd/tlm/tlm_util.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ndmpd/tlm/tlm_util.c	Tue Apr 16 14:35:21 2019 +0300
@@ -483,13 +483,13 @@
 boolean_t
 fs_volexist(char *path)
 {
-	struct stat64 st;
+	struct stat st;
 	char *p;
 
 	if ((p = get_volname(path)) == NULL)
 		return (FALSE);
 
-	if (stat64(p, &st) != 0) {
+	if (stat(p, &st) != 0) {
 		free(p);
 		return (FALSE);
 	}
--- a/usr/src/cmd/nohup/nohup.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/nohup/nohup.c	Tue Apr 16 14:35:21 2019 +0300
@@ -244,7 +244,7 @@
 static int
 fd_cb(void *data, int fd)
 {
-	struct stat64 sbuf;
+	struct stat sbuf;
 	int flags;
 	int *fdp;
 	int oflags;
--- a/usr/src/cmd/ps/ps.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ps/ps.c	Tue Apr 16 14:35:21 2019 +0300
@@ -497,7 +497,7 @@
 			p1 = optarg;
 			do {
 				char nambuf[TSZ+6];	/* for "/dev/" + '\0' */
-				struct stat64 s;
+				struct stat s;
 				parg = getarg(&p1);
 				p = Realloc(NULL, TSZ+1);	/* for '\0' */
 				/* zero the buffer before using it */
@@ -517,7 +517,7 @@
 				tty[ntty].tdev = PRNODEV;
 				(void) strcpy(nambuf, "/dev/");
 				(void) strcat(nambuf, p);
-				if (stat64(nambuf, &s) == 0)
+				if (stat(nambuf, &s) == 0)
 					tty[ntty].tdev = s.st_rdev;
 				tty[ntty++].tname = p;
 			} while (*p1);
--- a/usr/src/cmd/ptools/pmap/pmap.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ptools/pmap/pmap.c	Tue Apr 16 14:35:21 2019 +0300
@@ -198,7 +198,7 @@
 	const char *bar16 = "----------";
 	const char *bar;
 	struct rlimit rlim;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	char buf[128];
 	int mapfd;
 	int prg_gflags = PGRAB_RDONLY;
@@ -412,7 +412,7 @@
 					continue;
 				}
 
-				if (fstat64(mapfd, &statbuf) != 0) {
+				if (fstat(mapfd, &statbuf) != 0) {
 					Prelease(Pr, prr_flags);
 					(void) close(mapfd);
 					(void) fprintf(stderr, "%s: cannot "
@@ -467,9 +467,9 @@
 			 * Ensure mappings are consistent.
 			 */
 			if (Pstate(Pr) != PS_DEAD) {
-				struct stat64 newbuf;
+				struct stat newbuf;
 
-				if (fstat64(mapfd, &newbuf) != 0 ||
+				if (fstat(mapfd, &newbuf) != 0 ||
 				    memcmp(&newbuf.st_mtim, &statbuf.st_mtim,
 				    sizeof (newbuf.st_mtim)) != 0) {
 					if (stacks != NULL) {
--- a/usr/src/cmd/ptools/preap/preap.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ptools/preap/preap.c	Tue Apr 16 14:35:21 2019 +0300
@@ -54,7 +54,7 @@
 open_usage(pid_t pid, int *perr)
 {
 	char path[64];
-	struct stat64 st;
+	struct stat st;
 	int fd;
 
 	(void) snprintf(path, sizeof (path), "/proc/%d/usage", (int)pid);
@@ -64,7 +64,7 @@
 	 * confirm this is a regular file provided by /proc.
 	 */
 	if ((fd = open64(path, O_RDONLY)) >= 0) {
-		if (fstat64(fd, &st) != 0 || !S_ISREG(st.st_mode) ||
+		if (fstat(fd, &st) != 0 || !S_ISREG(st.st_mode) ||
 		    strcmp(st.st_fstype, "proc") != 0) {
 			(void) close(fd);
 			fd = -1;
--- a/usr/src/cmd/ptools/ptree/ptree.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ptools/ptree/ptree.c	Tue Apr 16 14:35:21 2019 +0300
@@ -404,7 +404,7 @@
 	ps_t *pp;
 	int fd, n;
 	ct_stathdl_t hdl;
-	struct stat64 st;
+	struct stat st;
 
 	for (n = 0; n < nctps; n++)
 		if (ctps[n]->ctid == ctid) {
@@ -414,7 +414,7 @@
 
 	if ((fd = contract_open(ctid, "process", "status", O_RDONLY)) == -1)
 		return;
-	if (fstat64(fd, &st) == -1 || ct_status_read(fd, CTD_COMMON, &hdl)) {
+	if (fstat(fd, &st) == -1 || ct_status_read(fd, CTD_COMMON, &hdl)) {
 		(void) close(fd);
 		return;
 	}
--- a/usr/src/cmd/savecore/savecore.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/savecore/savecore.c	Tue Apr 16 14:35:21 2019 +0300
@@ -287,12 +287,12 @@
 		    strerror(errno));
 }
 
-typedef struct stat64 Stat_t;
+typedef struct stat Stat_t;
 
 static void
 Fstat(int fd, Stat_t *sb, const char *fname)
 {
-	if (fstat64(fd, sb) != 0)
+	if (fstat(fd, sb) != 0)
 		logprint(SC_SL_ERR | SC_EXIT_ERR, "fstat(\"%s\"): %s", fname,
 		    strerror(errno));
 }
@@ -300,7 +300,7 @@
 static void
 Stat(const char *fname, Stat_t *sb)
 {
-	if (stat64(fname, sb) != 0) {
+	if (stat(fname, sb) != 0) {
 		have_dumpfile = B_FALSE;
 		logprint(SC_SL_ERR | SC_EXIT_ERR, "failed to get status "
 		    "of file %s", fname);
--- a/usr/src/cmd/sgs/nm/common/nm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/sgs/nm/common/nm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -401,11 +401,11 @@
 	int	fd;
 	Elf_Kind   file_type;
 
-	struct stat64 buf;
+	struct stat buf;
 
 	Elf_Cmd cmd;
 	errno = 0;
-	if (stat64(filename, &buf) == -1)	{
+	if (stat(filename, &buf) == -1)	{
 		(void) fprintf(stderr, "%s: ", prog_name);
 		perror(filename);
 		errflag++;
--- a/usr/src/cmd/svc/common/manifest_hash.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/svc/common/manifest_hash.c	Tue Apr 16 14:35:21 2019 +0300
@@ -596,7 +596,7 @@
 {
 	apply_action_t action;
 	boolean_t do_hash;
-	struct stat64 st;
+	struct stat st;
 	char *cp;
 	char *data;
 	uchar_t stored_hash[MHASH_SIZE];
@@ -683,7 +683,7 @@
 	}
 
 	do {
-		ret = stat64(file, &st);
+		ret = stat(file, &st);
 	} while (ret < 0 && errno == EINTR);
 	if (ret < 0) {
 		uu_free(pname);
--- a/usr/src/cmd/svc/startd/method.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/svc/startd/method.c	Tue Apr 16 14:35:21 2019 +0300
@@ -842,7 +842,7 @@
 	 */
 	if (instance_is_wait_style(inst) && type == METHOD_START) {
 		char *pend;
-		struct stat64 sbuf;
+		struct stat sbuf;
 
 		/*
 		 * We need to handle start method strings that have arguments,
@@ -851,7 +851,7 @@
 		if ((pend = strchr(method, ' ')) != NULL)
 			*pend = '\0';
 
-		if (*method == '/' && stat64(method, &sbuf) == -1 &&
+		if (*method == '/' && stat(method, &sbuf) == -1 &&
 		    errno == ENOENT) {
 			log_instance(inst, B_TRUE, "Missing start method (%s), "
 			    "changing state to maintenance.", method);
--- a/usr/src/cmd/svc/svcs/svcs.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/svc/svcs/svcs.c	Tue Apr 16 14:35:21 2019 +0300
@@ -2070,10 +2070,10 @@
 	 * Check for file:// dependencies
 	 */
 	if (scf_parse_file_fmri(lfmri, NULL, &path) == SCF_SUCCESS) {
-		struct stat64 statbuf;
+		struct stat statbuf;
 		const char *msg;
 
-		if (stat64(path, &statbuf) == 0)
+		if (stat(path, &statbuf) == 0)
 			msg = "online";
 		else if (errno == ENOENT)
 			msg = "absent";
--- a/usr/src/cmd/swap/swap.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/swap/swap.c	Tue Apr 16 14:35:21 2019 +0300
@@ -371,7 +371,7 @@
 	struct swaptable 	*st;
 	struct swapent	*swapent;
 	int	i;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	char		*path;
 	char		fullpath[MAXPATHLEN+1];
 	int		num;
@@ -437,7 +437,7 @@
 		else
 			(void) snprintf(fullpath, sizeof (fullpath),
 			    "%s", swapent->ste_path);
-		if (stat64(fullpath, &statbuf) < 0)
+		if (stat(fullpath, &statbuf) < 0)
 			if (*swapent->ste_path != '/')
 				(void) printf(gettext("%-20s  -  "),
 				    swapent->ste_path);
@@ -657,11 +657,11 @@
 static int
 valid(char *pathname, off_t offset, off_t length)
 {
-	struct stat64		f;
+	struct stat		f;
 	struct statvfs64	fs;
 	off_t		need;
 
-	if (stat64(pathname, &f) < 0 || statvfs64(pathname,  &fs) < 0) {
+	if (stat(pathname, &f) < 0 || statvfs64(pathname,  &fs) < 0) {
 		(void) perror(pathname);
 		return (errno);
 	}
--- a/usr/src/cmd/syslogd/syslogd.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/syslogd/syslogd.c	Tue Apr 16 14:35:21 2019 +0300
@@ -3400,7 +3400,7 @@
 	char buf[MAXLINE];
 	char ebuf[SYS_NMLN+1+40];
 	mode_t fmode, omode = O_WRONLY|O_APPEND|O_NOCTTY;
-	struct stat64 sbuf;
+	struct stat sbuf;
 	pthread_t mythreadno;
 
 	if (Debug) {
@@ -3485,7 +3485,7 @@
 
 	case '/':
 		(void) strlcpy(f->f_un.f_fname, p, MAXPATHLEN);
-		if (stat64(p, &sbuf) < 0) {
+		if (stat(p, &sbuf) < 0) {
 			logerror(p);
 			break;
 		}
--- a/usr/src/cmd/ypcmd/makedbm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ypcmd/makedbm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -83,7 +83,7 @@
 int
 close(int filedes) {
 
-	struct stat64	sb;
+	struct stat	sb;
 	static int	(*fptr)() = 0;
 
 	if (fptr == 0) {
@@ -96,7 +96,7 @@
 		}
 	}
 
-	if (inode_dev_valid != 0 && fstat64(filedes, &sb) == 0) {
+	if (inode_dev_valid != 0 && fstat(filedes, &sb) == 0) {
 		if (sb.st_ino == inode && sb.st_dev == dev) {
 			/* Keep open; pretend successful */
 			return (0);
@@ -130,7 +130,7 @@
 	char local_host[MAX_MASTER_NAME];
 	int cnt, i;
 	DBM *fdb;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int num_del_to_match = 0;
 	/* flag to indicate if matching char can be escaped */
 	int count_esp = 0;
@@ -311,7 +311,7 @@
 
 		if (strcmp(infile, "-") != 0)
 			infp = fopen(infile, "r");
-		else if (fstat64(fileno(stdin), &statbuf) == -1) {
+		else if (fstat(fileno(stdin), &statbuf) == -1) {
 			fprintf(stderr, "makedbm: can't open stdin\n");
 			exit(1);
 		} else
@@ -330,7 +330,7 @@
 
 		if (lockf(fileno(outfp), F_TLOCK, 0) == 0) {
 			/* Got exclusive access; save inode and dev */
-			if (fstat64(fileno(outfp), &statbuf) != 0) {
+			if (fstat(fileno(outfp), &statbuf) != 0) {
 				fprintf(stderr, "makedbm: can't fstat ");
 				perror(tmpdirbuf);
 				exit(1);
--- a/usr/src/cmd/ypcmd/shared/utils.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ypcmd/shared/utils.c	Tue Apr 16 14:35:21 2019 +0300
@@ -191,7 +191,7 @@
 	char *pname;
 {
 	char dbfile[MAXNAMLEN + 1];
-	struct stat64 filestat;
+	struct stat filestat;
 	int len;
 
 	if (!pname || ((len = strlen(pname)) == 0) ||
@@ -203,11 +203,11 @@
 	(void) strcpy(dbfile, pname);
 	(void) strcat(dbfile, dbm_dir);
 
-	if (stat64(dbfile, &filestat) != -1) {
+	if (stat(dbfile, &filestat) != -1) {
 		(void) strcpy(dbfile, pname);
 		(void) strcat(dbfile, dbm_pag);
 
-		if (stat64(dbfile, &filestat) != -1) {
+		if (stat(dbfile, &filestat) != -1) {
 			return (TRUE);
 		} else {
 
--- a/usr/src/cmd/ypcmd/yppush.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/ypcmd/yppush.c	Tue Apr 16 14:35:21 2019 +0300
@@ -259,7 +259,7 @@
 main(int argc, char **argv)
 {
 	unsigned long program;
-	struct stat64 sbuf;
+	struct stat sbuf;
 
 	get_command_line_args(argc, argv);
 
@@ -283,7 +283,7 @@
 	else
 		sprintf(ypmapname, "%s/%s/%s.dir", ypdbpath, domain_alias,
 		    map_alias);
-	if (stat64(ypmapname, &sbuf) < 0) {
+	if (stat(ypmapname, &sbuf) < 0) {
 		fprintf(stderr, "yppush: Map does not exist.\n");
 		exit(1);
 	}
--- a/usr/src/cmd/zdb/zdb.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zdb/zdb.c	Tue Apr 16 14:35:21 2019 +0300
@@ -2418,7 +2418,7 @@
 dump_cachefile(const char *cachefile)
 {
 	int fd;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	char *buf;
 	nvlist_t *config;
 
@@ -2428,7 +2428,7 @@
 		exit(1);
 	}
 
-	if (fstat64(fd, &statbuf) != 0) {
+	if (fstat(fd, &statbuf) != 0) {
 		(void) printf("failed to stat '%s': %s\n", cachefile,
 		    strerror(errno));
 		exit(1);
@@ -2594,7 +2594,7 @@
 	char path[MAXPATHLEN];
 	char *buf = label.vl_vdev_phys.vp_nvlist;
 	size_t buflen = sizeof (label.vl_vdev_phys.vp_nvlist);
-	struct stat64 statbuf;
+	struct stat statbuf;
 	uint64_t psize, ashift;
 	boolean_t label_found = B_FALSE;
 
@@ -2605,7 +2605,7 @@
 			(void) snprintf(path, sizeof (path), "%s%s",
 			    ZFS_RDISK_ROOTD, dev + strlen(ZFS_DISK_ROOTD));
 		}
-	} else if (stat64(path, &statbuf) != 0) {
+	} else if (stat(path, &statbuf) != 0) {
 		char *s;
 
 		(void) snprintf(path, sizeof (path), "%s%s", ZFS_RDISK_ROOTD,
@@ -2622,7 +2622,7 @@
 		exit(1);
 	}
 
-	if (fstat64(fd, &statbuf) != 0) {
+	if (fstat(fd, &statbuf) != 0) {
 		(void) fprintf(stderr, "failed to stat '%s': %s\n", path,
 		    strerror(errno));
 		(void) close(fd);
--- a/usr/src/cmd/zfs/zfs_main.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zfs/zfs_main.c	Tue Apr 16 14:35:21 2019 +0300
@@ -6333,7 +6333,7 @@
 {
 	zfs_handle_t *zhp;
 	int ret = 0;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	struct extmnttab entry;
 	const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
 	ino_t path_inode;
@@ -6344,7 +6344,7 @@
 	 * or "//"), we stat() the path and search for the corresponding
 	 * (major,minor) device pair.
 	 */
-	if (stat64(path, &statbuf) != 0) {
+	if (stat(path, &statbuf) != 0) {
 		(void) fprintf(stderr, gettext("cannot %s '%s': %s\n"),
 		    cmdname, path, strerror(errno));
 		return (1);
@@ -6385,7 +6385,7 @@
 		return (1);
 
 	ret = 1;
-	if (stat64(entry.mnt_mountp, &statbuf) != 0) {
+	if (stat(entry.mnt_mountp, &statbuf) != 0) {
 		(void) fprintf(stderr, gettext("cannot %s '%s': %s\n"),
 		    cmdname, path, strerror(errno));
 		goto out;
--- a/usr/src/cmd/zinject/translate.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zinject/translate.c	Tue Apr 16 14:35:21 2019 +0300
@@ -87,7 +87,7 @@
  */
 static int
 parse_pathname(const char *inpath, char *dataset, char *relpath,
-    struct stat64 *statbuf)
+    struct stat *statbuf)
 {
 	struct extmnttab mp;
 	FILE *fp;
@@ -109,7 +109,7 @@
 		return (-1);
 	}
 
-	if (stat64(fullpath, statbuf) != 0) {
+	if (stat(fullpath, statbuf) != 0) {
 		(void) fprintf(stderr, "cannot open '%s': %s\n",
 		    fullpath, strerror(errno));
 		return (-1);
@@ -163,7 +163,7 @@
  */
 /* ARGSUSED */
 static int
-object_from_path(const char *dataset, const char *path, struct stat64 *statbuf,
+object_from_path(const char *dataset, const char *path, struct stat *statbuf,
     zinject_record_t *record)
 {
 	objset_t *os;
@@ -334,7 +334,7 @@
 {
 	char path[MAXPATHLEN];
 	char *slash;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int ret = -1;
 
 	kernel_init(FREAD);
--- a/usr/src/cmd/zlogin/zlogin.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zlogin/zlogin.c	Tue Apr 16 14:35:21 2019 +0300
@@ -712,11 +712,11 @@
 process_raw_input(int stdin_fd, int appin_fd)
 {
 	int cc;
-	struct stat64 sb;
+	struct stat sb;
 	char ibuf[ZLOGIN_RDBUFSIZ];
 
 	/* Check how much data is already in the pipe */
-	if (fstat64(appin_fd, &sb) == -1) {
+	if (fstat(appin_fd, &sb) == -1) {
 		perror("stat failed");
 		return (-1);
 	}
--- a/usr/src/cmd/zlook/zlook.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zlook/zlook.c	Tue Apr 16 14:35:21 2019 +0300
@@ -138,7 +138,7 @@
 }
 
 static void
-print_stats(struct stat64 *sb)
+print_stats(struct stat *sb)
 {
 	char timebuf[512];
 
--- a/usr/src/cmd/zoneadm/zoneadm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zoneadm/zoneadm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -2160,7 +2160,7 @@
 static int
 verify_fs_special(struct zone_fstab *fstab)
 {
-	struct stat64 st;
+	struct stat st;
 
 	/*
 	 * This validation is really intended for standard zone administration.
@@ -2173,7 +2173,7 @@
 	if (strcmp(fstab->zone_fs_type, MNTTYPE_ZFS) == 0)
 		return (verify_fs_zfs(fstab));
 
-	if (stat64(fstab->zone_fs_special, &st) != 0) {
+	if (stat(fstab->zone_fs_special, &st) != 0) {
 		(void) fprintf(stderr, gettext("could not verify fs "
 		    "%s: could not access %s: %s\n"), fstab->zone_fs_dir,
 		    fstab->zone_fs_special, strerror(errno));
@@ -2199,9 +2199,9 @@
 static int
 isregfile(const char *path)
 {
-	struct stat64 st;
-
-	if (stat64(path, &st) == -1)
+	struct stat st;
+
+	if (stat(path, &st) == -1)
 		return (-1);
 
 	return (S_ISREG(st.st_mode));
--- a/usr/src/cmd/zoneadmd/vplat.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zoneadmd/vplat.c	Tue Apr 16 14:35:21 2019 +0300
@@ -801,9 +801,9 @@
 static int
 isregfile(const char *path)
 {
-	struct stat64 st;
-
-	if (stat64(path, &st) == -1)
+	struct stat st;
+
+	if (stat(path, &st) == -1)
 		return (-1);
 
 	return (S_ISREG(st.st_mode));
@@ -1224,9 +1224,9 @@
 	 * time we get here.
 	 */
 	if (zonecfg_in_alt_root()) {
-		struct stat64 st;
-
-		if (stat64(fsptr->zone_fs_special, &st) != -1 &&
+		struct stat st;
+
+		if (stat(fsptr->zone_fs_special, &st) != -1 &&
 		    S_ISBLK(st.st_mode)) {
 			/*
 			 * If we're going to mount a block device we need
@@ -3720,10 +3720,10 @@
 static boolean_t
 duplicate_reachable_path(zlog_t *zlogp, const char *rootpath)
 {
-	struct stat64 rst, zst;
+	struct stat rst, zst;
 	struct mnttab *mnp;
 
-	if (stat64(rootpath, &rst) == -1) {
+	if (stat(rootpath, &rst) == -1) {
 		zerror(zlogp, B_TRUE, "can't stat %s", rootpath);
 		return (B_TRUE);
 	}
@@ -3735,7 +3735,7 @@
 			continue;
 		/* We're looking at a loopback mount.  Stat it. */
 		if (mnp->mnt_special != NULL &&
-		    stat64(mnp->mnt_special, &zst) != -1 &&
+		    stat(mnp->mnt_special, &zst) != -1 &&
 		    rst.st_dev == zst.st_dev && rst.st_ino == zst.st_ino) {
 			zerror(zlogp, B_FALSE,
 			    "zone root %s is reachable through %s",
--- a/usr/src/cmd/zonestat/zonestatd/zonestatd.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zonestat/zonestatd/zonestatd.c	Tue Apr 16 14:35:21 2019 +0300
@@ -389,11 +389,11 @@
 	/* To track extended accounting */
 	int		zsctl_proc_fd;		/* Log currently being used */
 	ea_file_t	zsctl_proc_eaf;
-	struct stat64	zsctl_proc_stat;
+	struct stat	zsctl_proc_stat;
 	int		zsctl_proc_open;
 	int		zsctl_proc_fd_next;	/* Log file to use next */
 	ea_file_t	zsctl_proc_eaf_next;
-	struct stat64	zsctl_proc_stat_next;
+	struct stat	zsctl_proc_stat_next;
 	int		zsctl_proc_open_next;
 
 	/* pool configuration handle */
@@ -2520,7 +2520,7 @@
 	int ret, oret, state, trys = 0, flags;
 	int *fd, *open;
 	ea_file_t *eaf;
-	struct stat64 *stat;
+	struct stat *stat;
 	char path[MAXPATHLEN];
 
 	/*
@@ -2569,7 +2569,7 @@
 
 	if ((*fd = open64(path, O_RDONLY, 0)) >= 0 &&
 	    (oret = ea_fdopen(eaf, *fd, NULL, flags, O_RDONLY)) == 0)
-		ret = fstat64(*fd, stat);
+		ret = fstat(*fd, stat);
 
 	if (*fd < 0 || oret < 0 || ret < 0) {
 		struct timespec ts;
@@ -2781,8 +2781,8 @@
 		if (ret == EO_ERROR) {
 			if (ea_error() == EXR_EOF) {
 
-				struct stat64 *stat;
-				struct stat64 *stat_next;
+				struct stat *stat;
+				struct stat *stat_next;
 
 				/*
 				 * See if the next accounting file is the
--- a/usr/src/cmd/zpool/zpool_vdev.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/cmd/zpool/zpool_vdev.c	Tue Apr 16 14:35:21 2019 +0300
@@ -391,7 +391,7 @@
 make_leaf_vdev(const char *arg, uint64_t is_log)
 {
 	char path[MAXPATHLEN];
-	struct stat64 statbuf;
+	struct stat statbuf;
 	nvlist_t *vdev = NULL;
 	char *type = NULL;
 	boolean_t wholedisk = B_FALSE;
@@ -407,7 +407,7 @@
 		 * examining the file descriptor afterwards.
 		 */
 		wholedisk = is_whole_disk(arg);
-		if (!wholedisk && (stat64(arg, &statbuf) != 0)) {
+		if (!wholedisk && (stat(arg, &statbuf) != 0)) {
 			(void) fprintf(stderr,
 			    gettext("cannot open '%s': %s\n"),
 			    arg, strerror(errno));
@@ -425,7 +425,7 @@
 		(void) snprintf(path, sizeof (path), "%s/%s", ZFS_DISK_ROOT,
 		    arg);
 		wholedisk = is_whole_disk(path);
-		if (!wholedisk && (stat64(path, &statbuf) != 0)) {
+		if (!wholedisk && (stat(path, &statbuf) != 0)) {
 			/*
 			 * If we got ENOENT, then the user gave us
 			 * gibberish, so try to direct them with a
@@ -617,7 +617,7 @@
 			for (c = 0; c < children; c++) {
 				nvlist_t *cnv = child[c];
 				char *path;
-				struct stat64 statbuf;
+				struct stat statbuf;
 				uint64_t size = -1ULL;
 				char *childtype;
 				int fd, err;
@@ -688,10 +688,10 @@
 				 * this device altogether.
 				 */
 				if ((fd = open(path, O_RDONLY)) >= 0) {
-					err = fstat64(fd, &statbuf);
+					err = fstat(fd, &statbuf);
 					(void) close(fd);
 				} else {
-					err = stat64(path, &statbuf);
+					err = stat(path, &statbuf);
 				}
 
 				if (err != 0 ||
--- a/usr/src/lib/fm/libfmd_log/common/fmd_log.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/fm/libfmd_log/common/fmd_log.c	Tue Apr 16 14:35:21 2019 +0300
@@ -393,7 +393,7 @@
 		return (fmd_log_open_err(lp, errp, EFDL_NOMEM));
 
 	if ((lp->log_fd = open64(name, O_RDONLY)) == -1 ||
-	    fstat64(lp->log_fd, &lp->log_stat) == -1 ||
+	    fstat(lp->log_fd, &lp->log_stat) == -1 ||
 	    (fd = dup(lp->log_fd)) == -1)
 		return (fmd_log_open_err(lp, errp, errno));
 
--- a/usr/src/lib/fm/libfmd_log/common/fmd_log_impl.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/fm/libfmd_log/common/fmd_log_impl.h	Tue Apr 16 14:35:21 2019 +0300
@@ -39,7 +39,7 @@
 #endif
 
 struct fmd_log {
-	struct stat64 log_stat;		/* fstat64() information for log file */
+	struct stat log_stat;		/* fstat() information for log file */
 	ea_file_t log_ea;		/* libexacct handle for log file */
 	char *log_path;			/* log file pathname used for open */
 	char *log_version;		/* creator version string */
--- a/usr/src/lib/fm/topo/libtopo/common/mod.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/fm/topo/libtopo/common/mod.c	Tue Apr 16 14:35:21 2019 +0300
@@ -170,10 +170,10 @@
 mod_nvl_data(topo_mod_t *mp, nvlist_t *out, const char *path)
 {
 	struct modinfo mi;
-	struct stat64 s;
+	struct stat s;
 	int id, e;
 
-	if (stat64(path, &s) < 0) {
+	if (stat(path, &s) < 0) {
 		topo_mod_dprintf(mp,
 		    "No system object file for driver %s", path);
 		return (topo_mod_seterrno(mp, EMOD_METHOD_INVAL));
--- a/usr/src/lib/libadm/common/ckpath.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libadm/common/ckpath.c	Tue Apr 16 14:35:21 2019 +0300
@@ -157,7 +157,7 @@
 int
 ckpath_val(char *path, int pflags)
 {
-	struct stat64 status;
+	struct stat status;
 	int	fd;
 	char	*pt;
 
@@ -169,7 +169,7 @@
 		errstr = E_ABSOLUTE;
 		return (1);
 	}
-	if (stat64(path, &status)) {
+	if (stat(path, &status)) {
 		if (pflags & P_EXIST) {
 			errstr = E_EXIST;
 			return (1);
--- a/usr/src/lib/libadm/common/devtab.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libadm/common/devtab.c	Tue Apr 16 14:35:21 2019 +0300
@@ -112,7 +112,7 @@
  */
 
 static int
-samedev(struct stat64 x, struct stat64 y)
+samedev(struct stat x, struct stat y)
 {
 	int	same;
 
@@ -910,8 +910,8 @@
 	 *  Automatic data
 	 */
 
-	struct stat64		devstatbuf;	/* Stat struct, <device> */
-	struct stat64		tblstatbuf;	/* Stat struct, tbl entry */
+	struct stat		devstatbuf;	/* Stat struct, <device> */
+	struct stat		tblstatbuf;	/* Stat struct, tbl entry */
 	struct devtabent	*devrec;	/* Pointer to current record */
 	int			found;		/* TRUE if record found */
 	int			olderrno;	/* Old value of errno */
@@ -946,7 +946,7 @@
 		_setdevtab();
 
 		/*  Status the file <device>.  If fails, invalid device */
-		if (stat64(device, &devstatbuf) != 0) errno = ENODEV;
+		if (stat(device, &devstatbuf) != 0) errno = ENODEV;
 		else {
 
 			/*
@@ -961,7 +961,7 @@
 			while (!found && (devrec = _getdevtabent())) {
 			    if (!devrec->comment &&
 				(devrec->cdevice != NULL))
-				if (stat64(devrec->cdevice, &tblstatbuf) == 0) {
+				if (stat(devrec->cdevice, &tblstatbuf) == 0) {
 				    if (samedev(tblstatbuf, devstatbuf))
 					found = TRUE;
 				} else {
@@ -984,7 +984,7 @@
 			while (!found && (devrec = _getdevtabent())) {
 			    if (!devrec->comment &&
 				(devrec->bdevice != NULL))
-				if (stat64(devrec->bdevice, &tblstatbuf) == 0) {
+				if (stat(devrec->bdevice, &tblstatbuf) == 0) {
 				    if (samedev(tblstatbuf, devstatbuf))
 					found = TRUE;
 				} else {
@@ -1007,7 +1007,7 @@
 			while (!found && (devrec = _getdevtabent())) {
 			    if (!devrec->comment &&
 				(devrec->pathname != NULL))
-				if (stat64(devrec->pathname,
+				if (stat(devrec->pathname,
 				    &tblstatbuf) == 0) {
 				    if (samedev(tblstatbuf, devstatbuf))
 					found = TRUE;
--- a/usr/src/lib/libadm/common/fulldevnm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libadm/common/fulldevnm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -95,8 +95,8 @@
 
 static int test_if_blk(char *, dev_t);
 static int test_if_raw(char *, dev_t);
-static char *getblkcomplete(char *, struct stat64 *);
-static char *getrawcomplete(char *, struct stat64 *);
+static char *getblkcomplete(char *, struct stat *);
+static char *getrawcomplete(char *, struct stat *);
 
 /*
  * getfullname() - Builds a fully qualified pathname.
@@ -151,10 +151,10 @@
 static int
 test_if_blk(char *new_path, dev_t raw_dev)
 {
-	struct stat64	buf;
+	struct stat	buf;
 
 	/* check if we got a char special file */
-	if (stat64(new_path, &buf) != 0)
+	if (stat(new_path, &buf) != 0)
 		return (0);
 
 	if (!S_ISBLK(buf.st_mode))
@@ -172,10 +172,10 @@
 static int
 test_if_raw(char *new_path, dev_t blk_dev)
 {
-	struct stat64	buf;
+	struct stat	buf;
 
 	/* check if we got a char special file */
-	if (stat64(new_path, &buf) != 0)
+	if (stat(new_path, &buf) != 0)
 		return (0);
 
 	if (!S_ISCHR(buf.st_mode))
@@ -192,7 +192,7 @@
  */
 
 static char *
-getblkcomplete(char *cp, struct stat64 *dat)
+getblkcomplete(char *cp, struct stat *dat)
 {
 	char 		*dp;
 	char		*new_path;
@@ -245,7 +245,7 @@
  */
 
 static char *
-getrawcomplete(char *cp, struct stat64 *dat)
+getrawcomplete(char *cp, struct stat *dat)
 {
 	char 		*dp;
 	char		*new_path;
@@ -335,7 +335,7 @@
 char *
 getfullblkname(char *cp)
 {
-	struct stat64	buf;
+	struct stat	buf;
 	char		*dp;
 	char		*new_path;
 	dev_t		raw_dev;
@@ -352,7 +352,7 @@
 	if (*cp == '\0')
 		return (cp);
 
-	if (stat64(cp, &buf) != 0) {
+	if (stat(cp, &buf) != 0) {
 		free(cp);
 		return (strdup(""));
 	}
@@ -417,7 +417,7 @@
 char *
 getfullrawname(char *cp)
 {
-	struct stat64	buf;
+	struct stat	buf;
 	char		*dp;
 	char		*new_path;
 	dev_t		blk_dev;
@@ -434,7 +434,7 @@
 	if (*cp == '\0')
 		return (cp);
 
-	if (stat64(cp, &buf) != 0) {
+	if (stat(cp, &buf) != 0) {
 		free(cp);
 		return (strdup(""));
 	}
--- a/usr/src/lib/libadm/common/putdev.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libadm/common/putdev.c	Tue Apr 16 14:35:21 2019 +0300
@@ -165,7 +165,7 @@
 	char   *p;			/* Ptr to last '/' in devtab name */
 	int    fd;			/* Opened file descriptor */
 	FILE   *fp;			/* Opened file pointer */
-	struct stat64	sbuf;		/* stat buf for old devtab file */
+	struct stat	sbuf;		/* stat buf for old devtab file */
 
 	fp = NULL;
 	if (oldname = _devtabpath()) {
@@ -179,7 +179,7 @@
 	    if ((fd = open(oldname, O_WRONLY)) == -1)
 		return (NULL);
 
-	    if (fstat64(fd, &sbuf) == -1) {
+	    if (fstat(fd, &sbuf) == -1) {
 		(void) close(fd);
 		return (NULL);
 	    }
--- a/usr/src/lib/libadm/common/putdgrp.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libadm/common/putdgrp.c	Tue Apr 16 14:35:21 2019 +0300
@@ -128,7 +128,7 @@
 	char   *p;			/* Ptr to last '/' in dgrptab name */
 	int    fd;			/* Opened file descriptor */
 	FILE   *fp;			/* Opened file pointer */
-	struct stat64	sbuf;		/* stat buf for old dgrptab file */
+	struct stat	sbuf;		/* stat buf for old dgrptab file */
 
 
 	/* Initializations */
@@ -148,7 +148,7 @@
 		if ((fd = open(oldname, O_WRONLY)) == -1)
 			return (NULL);
 
-		if (fstat64(fd, &sbuf) == -1) {
+		if (fstat(fd, &sbuf) == -1) {
 			(void) close(fd);
 			return (NULL);
 		}
--- a/usr/src/lib/libc/port/mapfile-vers	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libc/port/mapfile-vers	Tue Apr 16 14:35:21 2019 +0300
@@ -1061,6 +1061,12 @@
 	fdwalk;
 	_fdwalk;
 	fstatat;
+$if _ELF32
+	fstatat_new;
+	fstat_new;
+	lstat_new;
+	stat_new;
+$endif
 	futimesat;
 	_futimesat;
 	getcpuid;
--- a/usr/src/lib/libc/port/sys/stat.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libc/port/sys/stat.c	Tue Apr 16 14:35:21 2019 +0300
@@ -24,6 +24,8 @@
  * Use is subject to license terms.
  */
 
+#define _LIBC_STAT_C
+
 #include "lint.h"
 #include <sys/types.h>
 #include <sys/syscall.h>
@@ -35,11 +37,81 @@
 #pragma weak stat64 = stat
 #pragma weak lstat64 = lstat
 
+#ifdef _LP64
 int
 fstatat(int fd, const char *name, struct stat *sb, int flags)
 {
 	return (syscall(SYS_fstatat, fd, name, sb, flags));
 }
+#else
+#include <string.h>
+int
+fstatat_new(int fd, const char *name, struct stat *sb, int flags)
+{
+	return (syscall(SYS_fstatat, fd, name, sb, flags));
+}
+struct oldstat32 {
+	dev_t		st_dev;
+	long		st_pad1[3];
+	ino_t		st_ino;
+	mode_t		st_mode;
+	nlink_t		st_nlink;
+	uid_t		st_uid;
+	gid_t		st_gid;
+	dev_t		st_rdev;
+	long		st_pad2[2];
+	off_t		st_size;
+	timestruc_t	st_atim;
+	timestruc_t	st_mtim;
+	timestruc_t	st_ctim;
+	blksize_t	st_blksize;
+	blkcnt_t	st_blocks;
+	char		st_fstype[_ST_FSTYPSZ];
+	long		st_pad4[8];
+};
+int
+fstatat(int fd, const char *name, struct stat *oldsb, int flags)
+{
+	struct stat sb = { 0 };
+	struct oldstat32 *old = (struct oldstat32 *)oldsb;
+	int ret;
+	ret = fstatat_new(fd, name, &sb, flags);
+	if (ret == 0) {
+		old->st_dev = sb.st_dev;
+		old->st_ino = sb.st_ino;
+		old->st_mode = sb.st_mode;
+		old->st_nlink = sb.st_nlink;
+		old->st_uid = sb.st_uid;
+		old->st_gid = sb.st_gid;
+		old->st_rdev = sb.st_rdev;
+		old->st_size = sb.st_size;
+		old->st_atim = sb.st_atim;
+		old->st_mtim = sb.st_mtim;
+		old->st_ctim = sb.st_ctim;
+		old->st_blksize = sb.st_blksize;
+		old->st_blocks = sb.st_blocks;
+		strlcpy(old->st_fstype, sb.st_fstype, _ST_FSTYPSZ);
+	}
+	return ret;
+}
+int
+stat_new(const char *name, struct stat *sb)
+{
+	return (fstatat_new(AT_FDCWD, name, sb, 0));
+}
+
+int
+lstat_new(const char *name, struct stat *sb)
+{
+	return (fstatat_new(AT_FDCWD, name, sb, AT_SYMLINK_NOFOLLOW));
+}
+
+int
+fstat_new(int fd, struct stat *sb)
+{
+	return (fstatat_new(fd, NULL, sb, 0));
+}
+#endif
 
 int
 stat(const char *name, struct stat *sb)
--- a/usr/src/lib/libcmdutils/libcmdutils.h	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libcmdutils/libcmdutils.h	Tue Apr 16 14:35:21 2019 +0300
@@ -105,7 +105,7 @@
 	struct stat *, struct stat *);
 #else
 extern int writefile(int, int, char *, char *, char *, char *,
-	struct stat64 *, struct stat64 *);
+	struct stat *, struct stat *);
 #endif
 
 /* Gets file descriptors of the source and target attribute files */
--- a/usr/src/lib/libctf/common/ctf_lib.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libctf/common/ctf_lib.c	Tue Apr 16 14:35:21 2019 +0300
@@ -423,7 +423,7 @@
 	ctf_file_t *fp = NULL;
 	size_t shstrndx, shnum;
 
-	struct stat64 st;
+	struct stat st;
 	ssize_t nbytes;
 
 	union {
@@ -437,7 +437,7 @@
 	bzero(&strsect, sizeof (ctf_sect_t));
 	bzero(&hdr.ctf, sizeof (hdr));
 
-	if (fstat64(fd, &st) == -1)
+	if (fstat(fd, &st) == -1)
 		return (ctf_set_open_errno(errp, errno));
 
 	if ((nbytes = pread64(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0)
--- a/usr/src/lib/libdtrace/common/dt_module.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libdtrace/common/dt_module.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1060,7 +1060,7 @@
 dt_module_update(dtrace_hdl_t *dtp, const char *name)
 {
 	char fname[MAXPATHLEN];
-	struct stat64 st;
+	struct stat st;
 	int fd, err, bits;
 
 	dt_module_t *dmp;
@@ -1073,7 +1073,7 @@
 	(void) snprintf(fname, sizeof (fname),
 	    "%s/%s/object", OBJFS_ROOT, name);
 
-	if ((fd = open(fname, O_RDONLY)) == -1 || fstat64(fd, &st) == -1 ||
+	if ((fd = open(fname, O_RDONLY)) == -1 || fstat(fd, &st) == -1 ||
 	    (dmp = dt_module_create(dtp, name)) == NULL) {
 		dt_dprintf("failed to open %s: %s\n", fname, strerror(errno));
 		(void) close(fd);
--- a/usr/src/lib/libgen/common/copylist.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libgen/common/copylist.c	Tue Apr 16 14:35:21 2019 +0300
@@ -80,10 +80,10 @@
 char *
 copylist64(const char *filenm, off64_t *szptr)
 {
-	struct	stat64	stbuf;
+	struct	stat	stbuf;
 
 	/* get size of file */
-	if (stat64(filenm, &stbuf) == -1) {
+	if (stat(filenm, &stbuf) == -1) {
 		return (NULL);
 	}
 	*szptr = stbuf.st_size;
@@ -95,10 +95,10 @@
 char *
 copylist(const char *filenm, off_t *szptr)
 {
-	struct	stat64	stbuf;
+	struct	stat	stbuf;
 
 	/* get size of file */
-	if (stat64(filenm, &stbuf) == -1) {
+	if (stat(filenm, &stbuf) == -1) {
 		return (NULL);
 	}
 
--- a/usr/src/lib/libgen/common/pathfind.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libgen/common/pathfind.c	Tue Apr 16 14:35:21 2019 +0300
@@ -175,12 +175,12 @@
 static int
 fullck(char *name, mode_t mode, int nzflag)
 {
-	struct stat64 sbuf;
+	struct stat sbuf;
 	int xor;
 
 	if ((mode & 0177000) == 0 && nzflag == 0) /* no special info wanted */
 		return (1);
-	if (stat64(name, &sbuf) == -1)
+	if (stat(name, &sbuf) == -1)
 		return (0);
 	xor = (sbuf.st_mode ^ mode) & 077000;	/* see mknod(2) */
 	if ((mode & 0170000) == 0)
--- a/usr/src/lib/libgen/common/rmdirp.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libgen/common/rmdirp.c	Tue Apr 16 14:35:21 2019 +0300
@@ -53,12 +53,12 @@
 int
 rmdirp(char *d, char *d1)
 {
-	struct stat64	st, cst;
+	struct stat	st, cst;
 	int		currstat;
 	char		*slash;
 
 	slash = strrchr(d, '/');
-	currstat = stat64(".", &cst);
+	currstat = stat(".", &cst);
 
 	/* Starts from right most element */
 
@@ -97,7 +97,7 @@
 
 			/* Stop if can not stat it */
 
-			if (stat64(d, &st) < 0) {
+			if (stat(d, &st) < 0) {
 				(void) strcpy(d1, d);
 				return (-1);
 			}
--- a/usr/src/lib/libkvm/common/kvm.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libkvm/common/kvm.c	Tue Apr 16 14:35:21 2019 +0300
@@ -90,7 +90,7 @@
 	int flag, const char *err)
 {
 	kvm_t *kd;
-	struct stat64 memstat, kmemstat, allkmemstat, corestat;
+	struct stat memstat, kmemstat, allkmemstat, corestat;
 	struct nlist nl[3] = { { "kas" }, { "practive" }, { "" } };
 
 	if ((kd = calloc(1, sizeof (kvm_t))) == NULL)
@@ -105,17 +105,17 @@
 	if (corefile == NULL)
 		corefile = "/dev/kmem";
 
-	if (stat64(corefile, &corestat) == -1)
+	if (stat(corefile, &corestat) == -1)
 		return (fail(kd, err, "cannot stat %s", corefile));
 
 	if (S_ISCHR(corestat.st_mode)) {
-		if (stat64("/dev/mem", &memstat) == -1)
+		if (stat("/dev/mem", &memstat) == -1)
 			return (fail(kd, err, "cannot stat /dev/mem"));
 
-		if (stat64("/dev/kmem", &kmemstat) == -1)
+		if (stat("/dev/kmem", &kmemstat) == -1)
 			return (fail(kd, err, "cannot stat /dev/kmem"));
 
-		if (stat64("/dev/allkmem", &allkmemstat) == -1)
+		if (stat("/dev/allkmem", &allkmemstat) == -1)
 			return (fail(kd, err, "cannot stat /dev/allkmem"));
 		if (corestat.st_rdev == memstat.st_rdev ||
 		    corestat.st_rdev == kmemstat.st_rdev ||
--- a/usr/src/lib/libnisdb/yptol/shim_ancil.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libnisdb/yptol/shim_ancil.c	Tue Apr 16 14:35:21 2019 +0300
@@ -214,7 +214,7 @@
 ypcheck_map_existence_yptol(char *pname)
 {
 	char dbfile[MAXNAMLEN + sizeof (TTL_POSTFIX) + 1];
-	struct stat64 filestat;
+	struct stat filestat;
 	int len;
 
 	if (!pname || ((len = (int)strlen(pname)) == 0) ||
@@ -229,7 +229,7 @@
 	(void) strcpy(dbfile, pname);
 	(void) strcat(dbfile, dbm_dir);
 
-	if (stat64(dbfile, &filestat) == -1) {
+	if (stat(dbfile, &filestat) == -1) {
 		if (errno != ENOENT) {
 			(void) fprintf(stderr,
 			    "ypserv:  Stat error on map file %s.\n",
@@ -242,7 +242,7 @@
 	(void) strcpy(dbfile, pname);
 	(void) strcat(dbfile, dbm_pag);
 
-	if (stat64(dbfile, &filestat) == -1) {
+	if (stat(dbfile, &filestat) == -1) {
 		if (errno != ENOENT) {
 			(void) fprintf(stderr,
 			    "ypserv:  Stat error on map file %s.\n",
@@ -257,7 +257,7 @@
 		(void) strcat(dbfile, TTL_POSTFIX);
 		(void) strcat(dbfile, dbm_dir);
 
-		if (stat64(dbfile, &filestat) == -1) {
+		if (stat(dbfile, &filestat) == -1) {
 			if (errno != ENOENT) {
 				(void) fprintf(stderr,
 				    "ypserv:  Stat error on map file %s.\n",
@@ -271,7 +271,7 @@
 		(void) strcat(dbfile, TTL_POSTFIX);
 		(void) strcat(dbfile, dbm_pag);
 
-		if (stat64(dbfile, &filestat) == -1) {
+		if (stat(dbfile, &filestat) == -1) {
 			if (errno != ENOENT) {
 				(void) fprintf(stderr,
 				    "ypserv:  Stat error on map file %s.\n",
--- a/usr/src/lib/libpam/Makefile.com	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libpam/Makefile.com	Tue Apr 16 14:35:21 2019 +0300
@@ -37,8 +37,6 @@
 
 CPPFLAGS +=	-I $(SRCDIR)
 
-CERRWARN +=	-Wno-uninitialized
-
 .KEEP_STATE:
 
 all:		$(LIBS)
--- a/usr/src/lib/libpam/pam_framework.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libpam/pam_framework.c	Tue Apr 16 14:35:21 2019 +0300
@@ -1026,9 +1026,9 @@
 		return (PAM_SYSTEM_ERR);
 	if ((err = read_pam_conf(pamh, service_file, service))
 	    != PAM_SUCCESS) {
-		pam_trace(PAM_DEBUG_CONF, "run_stack[%d:%s]: can't read "
+		pam_trace(PAM_DEBUG_CONF, "run_stack[%d]: can't read "
 		    "service-specific conf %s", pamh->include_depth,
-		    pam_trace_cname(pamh), modulep->module_path, service_file);
+		    pam_trace_cname(pamh), service_file);
 	}
 	free(service_file);
 	service_file = NULL;
@@ -1374,7 +1374,7 @@
 	int		error = PAM_SYSTEM_ERR;
 	char		*equal_sign = 0;
 	char		*name = NULL, *value = NULL, *tmp_value = NULL;
-	env_list	*traverse, *trail;
+	env_list	*traverse = NULL, *trail;
 
 	pam_trace(PAM_DEBUG_DEFAULT,
 	    "pam_putenv(%p, %s)", (void *)pamh,
@@ -1817,7 +1817,7 @@
 static void *
 open_module(pam_handle_t *pamh, char *module_so)
 {
-	struct stat64	stb;
+	struct stat	stb;
 	char		*errmsg;
 	void		*lfd;
 	fd_list		*module_fds = 0;
@@ -1825,7 +1825,7 @@
 	fd_list		*traverse = 0;
 
 	/* Check the ownership and file modes */
-	if (stat64(module_so, &stb) < 0) {
+	if (stat(module_so, &stb) < 0) {
 		__pam_log(LOG_AUTH | LOG_ERR,
 		    "open_module[%d:%s]: stat(%s) failed: %s",
 		    pamh->include_depth, pam_trace_cname(pamh), module_so,
@@ -1924,7 +1924,7 @@
 open_pam_conf(struct pam_fh **pam_fh, pam_handle_t *pamh, char *config,
     int shardfile)
 {
-	struct stat64	stb;
+	struct stat	stb;
 	int		fd;
 
 	if ((fd = open(config, O_RDONLY)) == -1) {
@@ -1936,7 +1936,7 @@
 		return (0);
 	}
 	/* Check the ownership and file modes */
-	if (fstat64(fd, &stb) < 0) {
+	if (fstat(fd, &stb) < 0) {
 		__pam_log(LOG_AUTH | LOG_ALERT,
 		    "open_pam_conf[%d:%s]: stat(%s) failed: %s",
 		    pamh->include_depth, pam_trace_cname(pamh), config,
--- a/usr/src/lib/libsec/common/aclutils.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libsec/common/aclutils.c	Tue Apr 16 14:35:21 2019 +0300
@@ -106,7 +106,7 @@
 	acl_t *acl_info;
 	int	save_errno;
 	int	stat_error;
-	struct stat64 statbuf;
+	struct stat statbuf;
 
 	*aclp = NULL;
 	if (type == ACL_PATH) {
@@ -168,11 +168,11 @@
 	}
 
 	if (type == ACL_PATH) {
-		stat_error = stat64(fname, &statbuf);
+		stat_error = stat(fname, &statbuf);
 		error = acl(fname, getcmd, acl_info->acl_cnt,
 		    acl_info->acl_aclp);
 	} else {
-		stat_error = fstat64(fd, &statbuf);
+		stat_error = fstat(fd, &statbuf);
 		error = facl(fd, getcmd, acl_info->acl_cnt,
 		    acl_info->acl_aclp);
 	}
@@ -248,18 +248,18 @@
 {
 	int error = 0;
 	int acl_flavor_target;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int stat_error;
 	int isdir;
 
 
 	if (type == ACL_PATH) {
-		stat_error = stat64(acl_inp->file, &statbuf);
+		stat_error = stat(acl_inp->file, &statbuf);
 		if (stat_error)
 			return (-1);
 		acl_flavor_target = pathconf(acl_inp->file, _PC_ACL_ENABLED);
 	} else {
-		stat_error = fstat64(acl_inp->fd, &statbuf);
+		stat_error = fstat(acl_inp->fd, &statbuf);
 		if (stat_error)
 			return (-1);
 		acl_flavor_target = fpathconf(acl_inp->fd, _PC_ACL_ENABLED);
@@ -394,11 +394,11 @@
 	ace_t	*min_ace_acl;
 	int	acl_flavor;
 	int	aclcnt;
-	struct stat64 statbuf;
+	struct stat statbuf;
 
 	acl_flavor = pathconf(file, _PC_ACL_ENABLED);
 
-	if (stat64(file, &statbuf) != 0) {
+	if (stat(file, &statbuf) != 0) {
 		error = 1;
 		return (error);
 	}
--- a/usr/src/lib/libsmbios/common/smbios_lib.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libsmbios/common/smbios_lib.c	Tue Apr 16 14:35:21 2019 +0300
@@ -201,9 +201,9 @@
 smbios_hdl_t *
 smbios_fdopen(int fd, int version, int flags, int *errp)
 {
-	struct stat64 st1, st2;
+	struct stat st1, st2;
 
-	if (stat64(SMB_BIOS_DEVICE, &st1) == 0 && fstat64(fd, &st2) == 0 &&
+	if (stat(SMB_BIOS_DEVICE, &st1) == 0 && fstat(fd, &st2) == 0 &&
 	    S_ISCHR(st2.st_mode) && st1.st_rdev == st2.st_rdev)
 		return (smb_biosopen(fd, version, flags, errp));
 	else
--- a/usr/src/lib/libvolmgt/common/volmgt_on_private.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libvolmgt/common/volmgt_on_private.c	Tue Apr 16 14:35:21 2019 +0300
@@ -78,7 +78,7 @@
 	static FILE 	*fp = NULL;		/* mnttab file pointer */
 	struct mnttab	mnt;			/* set bug not used */
 	char		*cn = NULL;		/* char spcl pathname */
-	struct stat64	sb;
+	struct stat	sb;
 	int		ret_val = 0;
 
 
@@ -96,7 +96,7 @@
 		goto dun;
 	}
 
-	if (fstat64(fd, &sb) < 0) {
+	if (fstat(fd, &sb) < 0) {
 		goto dun;
 	}
 
@@ -267,7 +267,7 @@
 vol_getmntdev(FILE *fp, struct mnttab *mp, dev_t dev, struct dk_cinfo *ip)
 {
 	int		fd;		/* dev-in-question fd */
-	struct stat64	sb;		/* dev-in-question stat struct */
+	struct stat	sb;		/* dev-in-question stat struct */
 	int		ret_val = 0;	/* default value: no match found */
 	char		*cn;		/* char pathname */
 	struct dk_cinfo	dkinfo;		/* for testing for slices */
@@ -308,7 +308,7 @@
 		}
 
 		/* stat the device */
-		if (fstat64(fd, &sb) < 0) {
+		if (fstat(fd, &sb) < 0) {
 			free(cn);
 			(void) close(fd);
 			continue;	/* ain't there: can't be a match */
@@ -413,7 +413,7 @@
 	FILE		*fp = NULL;
 	int		fd = -1;
 	char		*cn = NULL;		/* char spcl pathname */
-	struct stat64	sb;
+	struct stat	sb;
 	struct dk_cinfo	info;
 	struct mnttab	mnt;
 	int		ret_val = FALSE;
@@ -435,7 +435,7 @@
 		goto dun;
 	}
 
-	if (fstat64(fd, &sb) < 0) {
+	if (fstat(fd, &sb) < 0) {
 		goto dun;
 	}
 
@@ -493,7 +493,7 @@
 			char		lpath[2 * (MAXNAMELEN+1)];
 			char		linkbuf[MAXPATHLEN+4];
 			int		lb_len;
-			struct stat64	sb;
+			struct stat	sb;
 
 
 			if (strncmp(dp->d_name, mtype, mtype_len) != 0) {
@@ -502,7 +502,7 @@
 
 			(void) sprintf(lpath, "%s/%s", mnt_dir,
 			    dp->d_name);
-			if (lstat64(lpath, &sb) < 0) {
+			if (lstat(lpath, &sb) < 0) {
 				continue;	/* what? */
 			}
 			if (!S_ISLNK(sb.st_mode)) {
--- a/usr/src/lib/libzfs/common/libzfs_diff.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libzfs/common/libzfs_diff.c	Tue Apr 16 14:35:21 2019 +0300
@@ -483,12 +483,12 @@
 find_shares_object(differ_info_t *di)
 {
 	char fullpath[MAXPATHLEN];
-	struct stat64 sb = { 0 };
+	struct stat sb = { 0 };
 
 	(void) strlcpy(fullpath, di->dsmnt, MAXPATHLEN);
 	(void) strlcat(fullpath, ZDIFF_SHARESDIR, MAXPATHLEN);
 
-	if (stat64(fullpath, &sb) != 0) {
+	if (stat(fullpath, &sb) != 0) {
 		(void) snprintf(di->errbuf, sizeof (di->errbuf),
 		    dgettext(TEXT_DOMAIN, "Cannot stat %s"), fullpath);
 		return (zfs_error(di->zhp->zfs_hdl, EZFS_DIFF, di->errbuf));
--- a/usr/src/lib/libzfs/common/libzfs_import.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libzfs/common/libzfs_import.c	Tue Apr 16 14:35:21 2019 +0300
@@ -846,14 +846,14 @@
 int
 zpool_read_label(int fd, nvlist_t **config)
 {
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int l;
 	vdev_label_t *label;
 	uint64_t state, txg, size;
 
 	*config = NULL;
 
-	if (fstat64(fd, &statbuf) == -1)
+	if (fstat(fd, &statbuf) == -1)
 		return (-1);
 	size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
 
@@ -1018,7 +1018,7 @@
 zpool_open_func(void *arg)
 {
 	rdsk_node_t *rn = arg;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	nvlist_t *config;
 	int fd;
 
@@ -1034,7 +1034,7 @@
 	 * Ignore failed stats.  We only want regular
 	 * files, character devs and block devs.
 	 */
-	if (fstat64(fd, &statbuf) != 0 ||
+	if (fstat(fd, &statbuf) != 0 ||
 	    (!S_ISREG(statbuf.st_mode) &&
 	    !S_ISCHR(statbuf.st_mode) &&
 	    !S_ISBLK(statbuf.st_mode))) {
@@ -1070,12 +1070,12 @@
 int
 zpool_clear_label(int fd)
 {
-	struct stat64 statbuf;
+	struct stat statbuf;
 	int l;
 	vdev_label_t *label;
 	uint64_t size;
 
-	if (fstat64(fd, &statbuf) == -1)
+	if (fstat(fd, &statbuf) == -1)
 		return (0);
 	size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
 
@@ -1299,7 +1299,7 @@
 {
 	char *buf;
 	int fd;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	nvlist_t *raw, *src, *dst;
 	nvlist_t *pools;
 	nvpair_t *elem;
@@ -1316,7 +1316,7 @@
 		return (NULL);
 	}
 
-	if (fstat64(fd, &statbuf) != 0) {
+	if (fstat(fd, &statbuf) != 0) {
 		zfs_error_aux(hdl, "%s", strerror(errno));
 		(void) close(fd);
 		(void) zfs_error(hdl, EZFS_BADCACHE,
--- a/usr/src/lib/libzfs/common/libzfs_pool.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libzfs/common/libzfs_pool.c	Tue Apr 16 14:35:21 2019 +0300
@@ -435,7 +435,7 @@
 	char *strval;
 	uint64_t intval;
 	char *slash, *check;
-	struct stat64 statbuf;
+	struct stat statbuf;
 	zpool_handle_t *zhp;
 
 	if (nvlist_alloc(&retprops, NV_UNIQUE_NAME, 0) != 0) {
@@ -612,7 +612,7 @@
 			*slash = '\0';
 
 			if (strval[0] != '\0' &&
-			    (stat64(strval, &statbuf) != 0 ||
+			    (stat(strval, &statbuf) != 0 ||
 			    !S_ISDIR(statbuf.st_mode))) {
 				zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
 				    "'%s' is not a valid directory"),
--- a/usr/src/lib/libzfs/common/libzfs_util.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libzfs/common/libzfs_util.c	Tue Apr 16 14:35:21 2019 +0300
@@ -707,7 +707,7 @@
 zfs_handle_t *
 zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype)
 {
-	struct stat64 statbuf;
+	struct stat statbuf;
 	struct extmnttab entry;
 	int ret;
 
@@ -718,7 +718,7 @@
 		return (zfs_open(hdl, path, argtype));
 	}
 
-	if (stat64(path, &statbuf) != 0) {
+	if (stat(path, &statbuf) != 0) {
 		(void) fprintf(stderr, "%s: %s\n", path, strerror(errno));
 		return (NULL);
 	}
@@ -1566,7 +1566,7 @@
 zfs_get_hole_count(const char *path, uint64_t *count, uint64_t *bs)
 {
 	int fd, err;
-	struct stat64 ss;
+	struct stat ss;
 	uint64_t fill;
 
 	fd = open(path, O_RDONLY);
@@ -1579,7 +1579,7 @@
 		return (err);
 	}
 
-	if (fstat64(fd, &ss) == -1) {
+	if (fstat(fd, &ss) == -1) {
 		err = errno;
 		(void) close(fd);
 		return (err);
--- a/usr/src/lib/libzpool/common/kernel.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/libzpool/common/kernel.c	Tue Apr 16 14:35:21 2019 +0300
@@ -411,7 +411,7 @@
 	vnode_t *vp;
 	int old_umask;
 	char realpath[MAXPATHLEN];
-	struct stat64 st;
+	struct stat st;
 
 	/*
 	 * If we're accessing a real disk from userland, we need to use
@@ -428,7 +428,7 @@
 		fd = open64(path, O_RDONLY);
 		if (fd == -1)
 			return (errno);
-		if (fstat64(fd, &st) == -1) {
+		if (fstat(fd, &st) == -1) {
 			close(fd);
 			return (errno);
 		}
@@ -440,7 +440,7 @@
 			    dsk + 1);
 	} else {
 		(void) sprintf(realpath, "%s", path);
-		if (!(flags & FCREAT) && stat64(realpath, &st) == -1)
+		if (!(flags & FCREAT) && stat(realpath, &st) == -1)
 			return (errno);
 	}
 
@@ -470,7 +470,7 @@
 	if (fd == -1)
 		return (errno);
 
-	if (fstat64(fd, &st) == -1) {
+	if (fstat(fd, &st) == -1) {
 		close(fd);
 		return (errno);
 	}
@@ -559,9 +559,9 @@
 int
 fop_getattr_real(vnode_t *vp, vattr_t *vap)
 {
-	struct stat64 st;
+	struct stat st;
 
-	if (fstat64(vp->v_fd, &st) == -1) {
+	if (fstat(vp->v_fd, &st) == -1) {
 		close(vp->v_fd);
 		return (errno);
 	}
@@ -781,10 +781,10 @@
 int
 kobj_get_filesize(struct _buf *file, uint64_t *size)
 {
-	struct stat64 st;
+	struct stat st;
 	vnode_t *vp = (vnode_t *)file->_fd;
 
-	if (fstat64(vp->v_fd, &st) == -1) {
+	if (fstat(vp->v_fd, &st) == -1) {
 		vn_close(vp);
 		return (errno);
 	}
--- a/usr/src/lib/nsswitch/files/common/files_common.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/nsswitch/files/common/files_common.c	Tue Apr 16 14:35:21 2019 +0300
@@ -398,7 +398,7 @@
 	/* LINTED E_FUNC_VAR_UNUSED */
 	nss_XbyY_args_t xargs;
 	/* LINTED E_FUNC_VAR_UNUSED */
-	struct stat64 st;
+	struct stat st;
 
 #ifndef PIC
 	return (_nss_files_XY_all(be, args, netdb, 0, check));
@@ -410,7 +410,7 @@
 	mutex_lock(&fhp->fh_lock);
 retry:
 	retries = 100;
-	while (stat64(be->filename, &st) < 0) {
+	while (stat(be->filename, &st) < 0) {
 		/*
 		 * This can happen only in two cases: Either the file is
 		 * completely missing and we were not able to read it yet
@@ -513,7 +513,7 @@
 	 * with its server.  The 1-2 second age hack doesn't cover these
 	 * cases -- oh well.
 	 */
-	if (stat64(be->filename, &st) < 0 ||
+	if (stat(be->filename, &st) < 0 ||
 	    st.st_mtim.tv_sec != fhp->fh_mtime.tv_sec ||
 	    st.st_mtim.tv_nsec != fhp->fh_mtime.tv_nsec ||
 	    (uint_t)(time(0) - st.st_mtim.tv_sec + 2) < 4) {
--- a/usr/src/lib/passwdutil/files_attr.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/passwdutil/files_attr.c	Tue Apr 16 14:35:21 2019 +0300
@@ -911,7 +911,7 @@
 int
 files_update_shadow(char *name, struct spwd *spwd)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 	FILE *dst;
 	FILE *src;
 	struct spwd cur;
@@ -922,7 +922,7 @@
 	int err = PWU_SUCCESS;
 
 	/* Mode of the shadow file should be 400 or 000 */
-	if (stat64(SHADOW, &stbuf) < 0) {
+	if (stat(SHADOW, &stbuf) < 0) {
 		err = PWU_STAT_FAILED;
 		goto shadow_exit;
 	}
@@ -1017,7 +1017,7 @@
 int
 files_update_passwd(char *name, struct passwd *pwd)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 	FILE *src, *dst;
 	int tempfd;
 	struct passwd cur;
@@ -1025,7 +1025,7 @@
 	int result;
 	int err = PWU_SUCCESS;
 
-	if (stat64(PASSWD, &stbuf) < 0) {
+	if (stat(PASSWD, &stbuf) < 0) {
 		err = PWU_STAT_FAILED;
 		goto passwd_exit;
 	}
@@ -1155,7 +1155,7 @@
 	int	tmpfd;
 	FILE	*src;	/* history database file */
 	FILE	*dst;	/* temp history database being updated */
-	struct	stat64 statbuf;
+	struct	stat statbuf;
 	char buf[MAX_LOGNAME + MAXHISTORY +
 	    (MAXHISTORY * CRYPT_MAXCIPHERTEXTLEN)+1];
 	int	found;
@@ -1262,7 +1262,7 @@
 
 	(void) unlink(OHISTORY);
 
-	if (stat64(OHISTORY, &statbuf) == 0 ||
+	if (stat(OHISTORY, &statbuf) == 0 ||
 	    ((src != NULL) && (link(HISTORY, OHISTORY) != 0)) ||
 	    rename(HISTEMP, HISTORY) != 0) {
 
--- a/usr/src/lib/scsi/plugins/smp/usmp/common/usmp.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/scsi/plugins/smp/usmp/common/usmp.c	Tue Apr 16 14:35:21 2019 +0300
@@ -84,7 +84,7 @@
 	struct usmp_dev *dp;
 	const char *target_name = (const char *)target;
 
-	struct stat64 st;
+	struct stat st;
 	di_node_t root, smp;
 	struct di_walk_arg walk;
 
@@ -105,7 +105,7 @@
 		return (NULL);
 	}
 
-	if (fstat64(dp->ud_fd, &st) != 0) {
+	if (fstat(dp->ud_fd, &st) != 0) {
 		(void) smp_error(ESMP_BADTARGET,
 		    "failed to stat %s: %s", target_name, strerror(errno));
 		(void) close(dp->ud_fd);
--- a/usr/src/lib/smbsrv/libsmb/common/smb_pwdutil.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/lib/smbsrv/libsmb/common/smb_pwdutil.c	Tue Apr 16 14:35:21 2019 +0300
@@ -472,7 +472,7 @@
 static int
 smb_pwd_update(const char *name, const char *password, int control)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 	FILE *src, *dst;
 	int tempfd;
 	int err = SMB_PWE_SUCCESS;
@@ -488,7 +488,7 @@
 	if (err != SMB_PWE_SUCCESS)
 		return (err);
 
-	if (stat64(SMB_PASSWD, &stbuf) < 0) {
+	if (stat(SMB_PASSWD, &stbuf) < 0) {
 		err = SMB_PWE_STAT_FAILED;
 		goto passwd_exit;
 	}
@@ -914,7 +914,7 @@
 static void
 smb_lucache_update(void)
 {
-	struct stat64 stbuf;
+	struct stat stbuf;
 	int rc;
 
 	(void) mutex_lock(&smb_uch.uc_mtx);
@@ -943,7 +943,7 @@
 	 * smb_pwd_lock() is not called here so it can
 	 * be checked quickly whether an updated is needed
 	 */
-	if (stat64(SMB_PASSWD, &stbuf) < 0) {
+	if (stat(SMB_PASSWD, &stbuf) < 0) {
 		(void) mutex_unlock(&smb_uch.uc_mtx);
 		if (errno != ENOENT)
 			return;
@@ -975,7 +975,7 @@
 	rc = smb_lucache_do_update();
 
 	(void) mutex_lock(&smb_uch.uc_mtx);
-	if ((rc == SMB_PWE_SUCCESS) && (stat64(SMB_PASSWD, &stbuf) == 0))
+	if ((rc == SMB_PWE_SUCCESS) && (stat(SMB_PASSWD, &stbuf) == 0))
 		smb_uch.uc_timestamp = stbuf.st_mtim;
 	smb_uch.uc_state = SMB_UCHS_UPDATED;
 	smb_uch.uc_refcnt--;
--- a/usr/src/pkg/manifests/system-header.mf	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/pkg/manifests/system-header.mf	Tue Apr 16 14:35:21 2019 +0300
@@ -1190,7 +1190,6 @@
 file path=usr/include/sys/squeue_impl.h
 file path=usr/include/sys/stack.h
 file path=usr/include/sys/stat.h
-file path=usr/include/sys/stat_impl.h
 file path=usr/include/sys/statfs.h
 file path=usr/include/sys/statvfs.h
 file path=usr/include/sys/stdbool.h
--- a/usr/src/uts/common/fs/zut/zut.c	Sat Apr 13 09:03:04 2019 -0400
+++ b/usr/src/uts/common/fs/zut/zut.c	Tue Apr 16 14:35:21 2019 +0300
@@ -197,7 +197,7 @@
 }
 
 static int
-zut_stat64(vnode_t *vp, struct stat64 *sb, uint64_t *xvs, int flag, cred_t *cr)
+zut_stat64(vnode_t *vp, struct stat *sb, uint64_t *xvs, int flag, cred_t *cr)
 {
 	xoptattr_t *xoap = NULL;
 	xvattr_t xv = { 0 };