Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/fcntl.h
Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct __oflock { | struct __oflock { | ||||
off_t l_start; /* starting offset */ | off_t l_start; /* starting offset */ | ||||
off_t l_len; /* len = 0 means until end of file */ | off_t l_len; /* len = 0 means until end of file */ | ||||
pid_t l_pid; /* lock owner */ | pid_t l_pid; /* lock owner */ | ||||
short l_type; /* lock type: read/write, etc. */ | short l_type; /* lock type: read/write, etc. */ | ||||
short l_whence; /* type of l_start */ | short l_whence; /* type of l_start */ | ||||
}; | }; | ||||
/* | |||||
* Space control offset/length description | |||||
*/ | |||||
struct spacectl_range { | |||||
off_t r_offset; /* starting offset */ | |||||
off_t r_len; /* length */ | |||||
}; | |||||
#endif | #endif | ||||
#if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||
/* lock operations for flock(2) */ | /* lock operations for flock(2) */ | ||||
#define LOCK_SH 0x01 /* shared file lock */ | #define LOCK_SH 0x01 /* shared file lock */ | ||||
#define LOCK_EX 0x02 /* exclusive file lock */ | #define LOCK_EX 0x02 /* exclusive file lock */ | ||||
#define LOCK_NB 0x04 /* don't block when locking */ | #define LOCK_NB 0x04 /* don't block when locking */ | ||||
#define LOCK_UN 0x08 /* unlock file */ | #define LOCK_UN 0x08 /* unlock file */ | ||||
Show All 13 Lines | |||||
#ifdef __BSD_VISIBLE | #ifdef __BSD_VISIBLE | ||||
/* | /* | ||||
* Magic value that specify that corresponding file descriptor to filename | * Magic value that specify that corresponding file descriptor to filename | ||||
* is unknown and sanitary check should be omitted in the funlinkat() and | * is unknown and sanitary check should be omitted in the funlinkat() and | ||||
* similar syscalls. | * similar syscalls. | ||||
*/ | */ | ||||
#define FD_NONE -200 | #define FD_NONE -200 | ||||
/* | |||||
* Commands for fspacectl(2) | |||||
*/ | |||||
#define SPACECTL_DEALLOC 0 /* deallocate space */ | |||||
kib: Start it from 1. | |||||
/* | |||||
* fspacectl(2) flags | |||||
*/ | |||||
#define SPACECTL_F_SUPPORTED 0 | |||||
#endif | #endif | ||||
#ifndef _KERNEL | #ifndef _KERNEL | ||||
__BEGIN_DECLS | __BEGIN_DECLS | ||||
int open(const char *, int, ...); | int open(const char *, int, ...); | ||||
int creat(const char *, mode_t); | int creat(const char *, mode_t); | ||||
int fcntl(int, int, ...); | int fcntl(int, int, ...); | ||||
#if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||
int flock(int, int); | int flock(int, int); | ||||
#endif | #endif | ||||
#if __POSIX_VISIBLE >= 200809 | #if __POSIX_VISIBLE >= 200809 | ||||
int openat(int, const char *, int, ...); | int openat(int, const char *, int, ...); | ||||
#endif | #endif | ||||
#if __POSIX_VISIBLE >= 200112 | #if __POSIX_VISIBLE >= 200112 | ||||
int posix_fadvise(int, off_t, off_t, int); | int posix_fadvise(int, off_t, off_t, int); | ||||
int posix_fallocate(int, off_t, off_t); | int posix_fallocate(int, off_t, off_t); | ||||
#endif | |||||
#if __BSD_VISIBLE | |||||
int fspacectl(int, int, struct spacectl_range *, int); | |||||
Done Inline ActionsMove this right after flock(), avoiding another ifdef. kib: Move this right after flock(), avoiding another ifdef. | |||||
#endif | #endif | ||||
__END_DECLS | __END_DECLS | ||||
#endif | #endif | ||||
#endif /* !_SYS_FCNTL_H_ */ | #endif /* !_SYS_FCNTL_H_ */ |
Start it from 1.