3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _SYS_SENDFILE_H
28 #define _SYS_SENDFILE_H
29
30 #pragma ident "%Z%%M% %I% %E% SMI"
31
32 #include <sys/feature_tests.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <sys/types.h>
39 #include <sys/uio.h>
40
41 /*
42 * Structure used by sendfilev()
43 */
44 typedef struct sendfilevec {
45 int sfv_fd;
46 uint_t sfv_flag;
47 off_t sfv_off;
48 size_t sfv_len;
49 } sendfilevec_t;
50
51 #define SFV_NOWAIT 1
111 #ifdef __PRAGMA_REDEFINE_EXTNAME
112 #pragma redefine_extname sendfilev sendfilev64
113 #pragma redefine_extname sendfile sendfile64
114 #else /* __PRAGMA_REDEFINE_EXTNAME */
115 #define sendfilev sendfilev64
116 #define sendfile sendfile64
117 #endif /* __PRAGMA_REDEFINE_EXTNAME */
118 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
119
120 /* In the LP64 compilation environment, the APIs are already large file */
121 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
122 #ifdef __PRAGMA_REDEFINE_EXTNAME
123 #pragma redefine_extname sendfilev64 sendfilev
124 #pragma redefine_extname sendfile64 sendfile
125 #else /* __PRAGMA_REDEFINE_EXTNAME */
126 #define sendfilev64 sendfilev
127 #define sendfile64 sendfile
128 #endif /* __PRAGMA_REDEFINE_EXTNAME */
129 #endif /* _LP64 && _LARGEFILE64_SOURCE */
130
131 #ifdef __STDC__
132 extern ssize_t sendfilev(int, const struct sendfilevec *, int, size_t *);
133 extern ssize_t sendfile(int, int, off_t *, size_t);
134 /* Transitional largefile interface */
135 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
136 !defined(__PRAGMA_REDEFINE_EXTNAME))
137 extern ssize_t sendfilev64(int, const struct sendfilevec64 *, int, size_t *);
138 extern ssize_t sendfile64(int, int, off64_t *, size_t);
139 #endif
140 #else /* __STDC__ */
141 extern int sendfilev();
142 extern int sendfile();
143 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
144 !defined(__PRAGMA_REDEFINE_EXTNAME))
145 extern int sendfilev64();
146 extern int sendfile64();
147 #endif
148 #endif /* __STDC__ */
149 #endif /* _KERNEL */
150
151 #ifdef __cplusplus
152 }
153 #endif
154
155 #endif /* _SYS_SENDFILE_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _SYS_SENDFILE_H
30 #define _SYS_SENDFILE_H
31
32 #include <sys/feature_tests.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <sys/types.h>
39 #include <sys/uio.h>
40
41 /*
42 * Structure used by sendfilev()
43 */
44 typedef struct sendfilevec {
45 int sfv_fd;
46 uint_t sfv_flag;
47 off_t sfv_off;
48 size_t sfv_len;
49 } sendfilevec_t;
50
51 #define SFV_NOWAIT 1
111 #ifdef __PRAGMA_REDEFINE_EXTNAME
112 #pragma redefine_extname sendfilev sendfilev64
113 #pragma redefine_extname sendfile sendfile64
114 #else /* __PRAGMA_REDEFINE_EXTNAME */
115 #define sendfilev sendfilev64
116 #define sendfile sendfile64
117 #endif /* __PRAGMA_REDEFINE_EXTNAME */
118 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
119
120 /* In the LP64 compilation environment, the APIs are already large file */
121 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
122 #ifdef __PRAGMA_REDEFINE_EXTNAME
123 #pragma redefine_extname sendfilev64 sendfilev
124 #pragma redefine_extname sendfile64 sendfile
125 #else /* __PRAGMA_REDEFINE_EXTNAME */
126 #define sendfilev64 sendfilev
127 #define sendfile64 sendfile
128 #endif /* __PRAGMA_REDEFINE_EXTNAME */
129 #endif /* _LP64 && _LARGEFILE64_SOURCE */
130
131 extern ssize_t sendfilev(int, const struct sendfilevec *, int, size_t *);
132 extern ssize_t sendfile(int, int, off_t *, size_t);
133 /* Transitional largefile interface */
134 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
135 !defined(__PRAGMA_REDEFINE_EXTNAME))
136 extern ssize_t sendfilev64(int, const struct sendfilevec64 *, int, size_t *);
137 extern ssize_t sendfile64(int, int, off64_t *, size_t);
138 #endif
139 #endif /* _KERNEL */
140
141 #ifdef __cplusplus
142 }
143 #endif
144
145 #endif /* _SYS_SENDFILE_H */
|