Merge illumos-gate
[unleashed.git] / include / fcntl.h
blob9120d2291efe0a2aa64aadc923f9e237a4458a8d
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
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 */
32 #ifndef _FCNTL_H
33 #define _FCNTL_H
35 #include <sys/feature_tests.h>
36 #if defined(__EXTENSIONS__) || defined(_XPG4)
37 #include <sys/stat.h>
38 #endif
39 #include <sys/types.h>
40 #include <sys/fcntl.h>
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
46 #if defined(__EXTENSIONS__) || defined(_XPG4)
48 /* Symbolic constants for the "lseek" routine. */
50 #ifndef SEEK_SET
51 #define SEEK_SET 0 /* Set file pointer to "offset" */
52 #endif
54 #ifndef SEEK_CUR
55 #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
56 #endif
58 #ifndef SEEK_END
59 #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
60 #endif
61 #endif /* defined(__EXTENSIONS__) || defined(_XPG4) */
63 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
64 #ifndef SEEK_DATA
65 #define SEEK_DATA 3 /* Set file pointer to next data past offset */
66 #endif
68 #ifndef SEEK_HOLE
69 #define SEEK_HOLE 4 /* Set file pointer to next hole past offset */
70 #endif
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);
88 #endif
90 /* FIXME source compat; these libc symbols are aliases to the non-64 ones */
91 int open64(const char *, int, ...);
92 int openat64(int, const char *, int, ...);
93 int creat64(const char *, mode_t);
95 #ifdef __cplusplus
97 #endif
99 #endif /* _FCNTL_H */