4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 /* Copyright (c) 1988 AT&T */
30 /* All Rights Reserved */
35 #include <sys/feature_tests.h>
36 #if defined(__EXTENSIONS__) || defined(_XPG4)
39 #include <sys/types.h>
40 #include <sys/fcntl.h>
46 #if defined(__EXTENSIONS__) || defined(_XPG4)
48 /* Symbolic constants for the "lseek" routine. */
51 #define SEEK_SET 0 /* Set file pointer to "offset" */
55 #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
59 #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
61 #endif /* defined(__EXTENSIONS__) || defined(_XPG4) */
63 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
65 #define SEEK_DATA 3 /* Set file pointer to next data past offset */
69 #define SEEK_HOLE 4 /* Set file pointer to next hole past offset */
71 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
73 extern int fcntl(int, int, ...);
74 extern int open(const char *, int, ...);
75 extern int creat(const char *, mode_t
);
77 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
78 extern int posix_fadvise(int, off_t
, off_t
, int);
79 extern int posix_fallocate(int, off_t
, off_t
);
80 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || ... */
81 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
82 defined(_ATFILE_SOURCE)
83 extern int openat(int, const char *, int, ...);
84 extern int attropen(const char *, const char *, int, ...);
85 #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
86 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
87 extern int directio(int, int);