summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/uio.h
diff options
context:
space:
mode:
authorDJ Hoffman <dj.hoffman@joyent.com>2014-06-09 20:35:13 +0000
committerRobert Mustacchi <rm@joyent.com>2015-01-14 13:51:40 -0800
commitfca543ca45b12c44a243625bce68b645ba8ed791 (patch)
tree40308157ab44217c4e91c13aa0e0aab95d583b74 /usr/src/uts/common/sys/uio.h
parent078266a5aafa880521ea55488ef3d676f35e908e (diff)
downloadillumos-joyent-fca543ca45b12c44a243625bce68b645ba8ed791.tar.gz
4923 want preadv and pwritev
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Robert Mustacchi <robert.mustacchi@joyent.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/sys/uio.h')
-rw-r--r--usr/src/uts/common/sys/uio.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/uio.h b/usr/src/uts/common/sys/uio.h
index dd8cbea4fa..b04ca7b8f3 100644
--- a/usr/src/uts/common/sys/uio.h
+++ b/usr/src/uts/common/sys/uio.h
@@ -23,6 +23,7 @@
*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -254,6 +255,45 @@ extern uioasync_t uioasync;
extern ssize_t readv(int, const struct iovec *, int);
extern ssize_t writev(int, const struct iovec *, int);
+/*
+ * When in the large file compilation environment,
+ * map preadv/pwritev to their 64 bit offset versions
+ */
+#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma redefine_extname preadv preadv64
+#pragma redefine_extname pwritev pwritev64
+#else /* __PRAGMA_REDEFINE_EXTNAME */
+#define preadv preadv64
+#define pwritev pwritev64
+#endif /* __PRAGMA_REDEFINE_EXTNAME */
+#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
+
+/* In the LP64 compilation environment, the APIs are already large file */
+#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
+#ifdef __PRAGMA_REDEFINE_EXTNAME
+#pragma redefine_extname preadv64 preadv
+#pragma redefine_extname pwritev64 pwritev
+#else /* __PRAGMA_REDEFINE_EXTNAME */
+#define preadv64 preadv
+#define pwritev64 pwritev
+#endif /* __PRAGMA_REDEFINE_EXTNAME */
+#endif /* _LP64 && _LARGEFILE64_SOURCE */
+
+extern ssize_t preadv(int, const struct iovec *, int, off_t);
+extern ssize_t pwritev(int, const struct iovec *, int, off_t);
+
+/*
+ * preadv64 and pwritev64 should be defined when:
+ * - Using the transitional compilation environment, and not
+ * the large file compilation environment.
+ */
+#if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
+ !defined(__PRAGMA_REDEFINE_EXTNAME))
+extern ssize_t preadv64(int, const struct iovec *, int, off64_t);
+extern ssize_t pwritev64(int, const struct iovec *, int, off64_t);
+#endif /* _LARGEFILE64_SOURCE */
+
#endif /* defined(_KERNEL) */
#ifdef __cplusplus