/*-
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fcntl.h 8.3 (Berkeley) 1/21/94
* $FreeBSD$
*/
#ifndef _SYS_FCNTL_H_
#define _SYS_FCNTL_H_
/*
* This file includes the definitions for open and fcntl
* described by POSIX for <fcntl.h>; it also includes
* related kernel definitions.
*/
#ifndef _MODE_T_DECLARED
#define _MODE_T_DECLARED
#endif
#ifndef _OFF_T_DECLARED
#define _OFF_T_DECLARED
#endif
#ifndef _PID_T_DECLARED
#define _PID_T_DECLARED
#endif
/*
* File status flags: these are used by open(2), fcntl(2).
* They are also used (indirectly) in the kernel file structure f_flags,
* are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags).
*/
/* open-only flags */
/*
* Kernel encoding of open mode; separate read and write bits that are
* independently testable: 1 greater than the above.
*
* XXX
* FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH,
*/
#if __BSD_VISIBLE
#endif
#if __BSD_VISIBLE
#endif
#if __POSIX_VISIBLE >= 200809
#endif
#ifdef _KERNEL
#endif
/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
#if __BSD_VISIBLE
/* Attempt to bypass buffer cache */
#endif
#if __POSIX_VISIBLE >= 200809
#endif
#ifdef _KERNEL
#endif
#if __POSIX_VISIBLE >= 200809
/* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */
#endif
#if __BSD_VISIBLE
#endif
/*
* XXX missing O_DSYNC, O_RSYNC.
*/
#ifdef _KERNEL
/* Only for devfs d_close() flags. */
/* Only for fo_close() from half-succeeded open */
/* bits to save after open */
/* bits settable by fcntl(F_SETFL, ...) */
#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \
defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
/*
* Set by shm_open(3) in older libc's to get automatic MAP_ASYNC
* behavior for POSIX shared memory objects (which are otherwise
* implemented as plain files).
*/
#endif
#endif
/*
* The O_* flags used to have only F* names, which were used in the kernel
* and by fcntl. We retain the F* names for the kernel f_flag field
* and for backward compatibility for fcntl. These flags are deprecated.
*/
#if __BSD_VISIBLE
#endif
/*
* We are out of bits in f_flag (which is a short). However,
* the flag bits not set in FMASK are only meaningful in the
* initial open syscall. Those bits can thus be given a
* different meaning for fcntl(2).
*/
#if __BSD_VISIBLE
/* Read ahead */
#endif
#if __POSIX_VISIBLE >= 200809
/*
* Magic value that specify the use of the current working directory
* to determine the target of relative file paths in the openat() and
* similar syscalls.
*/
/*
* Miscellaneous flags for the *at() syscalls.
*/
#endif
/*
* Constants used for fcntl(2)
*/
/* command values */
#endif
#if __BSD_VISIBLE
#endif
#if __BSD_VISIBLE
#endif
#if __POSIX_VISIBLE >= 200809
#endif
#if __BSD_VISIBLE
#endif
/* file descriptor flags (F_GETFD, F_SETFD) */
/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
#if __BSD_VISIBLE
#endif
#ifdef _KERNEL
#endif
/*
* Advisory file segment locking data type -
* information passed to system by user
*/
struct flock {
};
#if __BSD_VISIBLE
/*
* Old advisory file segment locking data type,
* before adding l_sysid.
*/
struct __oflock {
};
#endif
#if __BSD_VISIBLE
/* lock operations for flock(2) */
#endif
#if __POSIX_VISIBLE >= 200112
/*
* Advice to posix_fadvise
*/
#endif
#ifndef _KERNEL
int open(const char *, int, ...);
int fcntl(int, int, ...);
#if __BSD_VISIBLE
int flock(int, int);
#endif
#if __POSIX_VISIBLE >= 200809
int openat(int, const char *, int, ...);
#endif
#if __POSIX_VISIBLE >= 200112
#endif
#endif
#endif /* !_SYS_FCNTL_H_ */