From a5c89b33acf88cdb61446a1e61780cfe36cf1088 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 29 Jun 2007 05:12:40 +0000 Subject: [PATCH] Add O_MAPONREAD (not yet implemented). This will have the semantics of replacing the underlying VM with a copy-on-write page mapping when possible. Ultimately when used with syslink this will have the semantics of allowing a fully shared mapping for syslink DMA buffers. --- sys/sys/fcntl.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 9a368274c9..2d0d24e841 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -37,7 +37,7 @@ * * @(#)fcntl.h 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/fcntl.h,v 1.9.2.2 2001/06/03 05:00:10 dillon Exp $ - * $DragonFly: src/sys/sys/fcntl.h,v 1.11 2006/12/05 23:14:55 dillon Exp $ + * $DragonFly: src/sys/sys/fcntl.h,v 1.12 2007/06/29 05:12:40 dillon Exp $ */ #ifndef _SYS_FCNTL_H_ @@ -108,9 +108,11 @@ #define O_FASYNCWRITE 0x00800000 /* force asynchronous write */ #define O_FUNBUFFERED 0x01000000 /* force unbuffered (direct) I/O */ #define O_FBUFFERED 0x02000000 /* force buffered I/O */ +#define O_MAPONREAD 0x04000000 /* memory map read buffer */ #define O_FMASK (O_FBLOCKING|O_FNONBLOCKING|O_FAPPEND|O_FOFFSET|\ - O_FSYNCWRITE|O_FASYNCWRITE|O_FUNBUFFERED|O_FBUFFERED) + O_FSYNCWRITE|O_FASYNCWRITE|O_FUNBUFFERED|O_FBUFFERED|\ + O_MAPONREAD) #ifdef _KERNEL /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ @@ -118,9 +120,11 @@ #define OFLAGS(fflags) ((fflags) - 1) /* bits to save after open */ -#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT) +#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|\ + O_DIRECT|O_MAPONREAD) /* bits settable by fcntl(F_SETFL, ...) */ -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|\ + O_DIRECT|O_MAPONREAD) #endif /* -- 2.41.0