1.1 --- a/libfsclient/lib/src/file.cc Mon May 30 00:47:07 2022 +0200
1.2 +++ b/libfsclient/lib/src/file.cc Thu Jun 02 01:08:50 2022 +0200
1.3 @@ -378,6 +378,18 @@
1.4 return L4_EOK;
1.5 }
1.6
1.7 +/* Return opening flags compatible with the given region flags. */
1.8 +
1.9 +flags_t file_opening_flags(l4re_rm_flags_t rm_flags)
1.10 +{
1.11 + if ((rm_flags & L4RE_RM_F_RW) == L4RE_RM_F_RW)
1.12 + return O_RDWR;
1.13 + else if (rm_flags & L4RE_RM_F_W)
1.14 + return O_WRONLY;
1.15 + else
1.16 + return O_RDONLY;
1.17 +}
1.18 +
1.19 /* Return mmap flags corresponding to the file access flags. */
1.20
1.21 l4re_rm_flags_t file_region_flags(flags_t flags)