stream: set file sharing on POSIX

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-06-30 20:25:33 +02:00
parent faeddedd46
commit a9d87b4cfd

View File

@ -2811,6 +2811,8 @@ namespace stdex
case mode_create: flags |= O_CREAT | O_TRUNC; break; case mode_create: flags |= O_CREAT | O_TRUNC; break;
default: throw std::invalid_argument("invalid mode"); default: throw std::invalid_argument("invalid mode");
} }
if (mode & share_reading) flags |= O_SHLOCK;
if (mode & share_writing) flags |= O_EXLOCK;
if (mode & hint_write_thru) flags |= O_DSYNC; if (mode & hint_write_thru) flags |= O_DSYNC;
#ifndef __APPLE__ #ifndef __APPLE__
if (mode & hint_no_buffering) flags |= O_RSYNC; if (mode & hint_no_buffering) flags |= O_RSYNC;