kboot: Add HOST_O_ constants for open, etc

Add the common O_ constants for the open, fcntl, etc system calls. They
are different than FreeBSD's. While they can differ based on
architecture, they are constant for architectures we care about, and
those architectures use the 'generic' version so future architectures
will also work.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-07-01 11:57:02 -06:00
parent bf35f00522
commit ae366d5106

View File

@ -32,6 +32,27 @@
long host_syscall(int number, ...);
/*
* Constants for open, fcntl, etc
*
* Note: Some of these are arch dependent on Linux, but are the same for
* powerpc, x86, arm*, and riscv. We should be futureproof, though, since these
* are the 'generic' values and only older architectures (no longer supported by
* FreeBSD) vary.
*
* These are from tools/include/uapi/asm-generic/fcntl.h and use the octal
* notation. Beware, hex is used in other places creating potential confsion.
*/
#define HOST_O_RDONLY 0
#define HOST_O_WRONLY 1
#define HOST_O_RDWR 2
#define HOST_O_CREAT 00100
#define HOST_O_EXCL 00200
#define HOST_O_NOCTTY 00400
#define HOST_O_TRUNC 01000
#define HOST_O_APPEND 02000
#define HOST_O_NONBLOCK 04000
/*
* Data types
*/