diff options
| author | Garrett Wollman <wollman@FreeBSD.org> | 2000-04-22 15:22:31 +0000 |
|---|---|---|
| committer | Garrett Wollman <wollman@FreeBSD.org> | 2000-04-22 15:22:31 +0000 |
| commit | aa543039b57a46e0087df4a4dec3586071ae6120 (patch) | |
| tree | bf6ed85570f850a184fd25e49ef2b68222430aca /sys/vm | |
| parent | b39b38ecd0f0fdec3130c626f0a33967b07b7f2c (diff) | |
Notes
Diffstat (limited to 'sys/vm')
| -rw-r--r-- | sys/vm/vm_mmap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 53462f4bccf45..d617d0c2d3ba2 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -282,6 +282,16 @@ mmap(p, uap) return (EBADF); if (fp->f_type != DTYPE_VNODE) return (EINVAL); + /* + * POSIX shared-memory objects are defined to have + * kernel persistence, and are not defined to support + * read(2)/write(2) -- or even open(2). Thus, we can + * use MAP_ASYNC to trade on-disk coherence for speed. + * The shm_open(3) library routine turns on the FPOSIXSHM + * flag to request this behavior. + */ + if (fp->f_flag & FPOSIXSHM) + flags |= MAP_NOSYNC; vp = (struct vnode *) fp->f_data; if (vp->v_type != VREG && vp->v_type != VCHR) return (EINVAL); |
