xref: /aosp_15_r20/external/crosvm/arch/src/pstore/sys/windows.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 // Copyright 2022 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 use std::fs::OpenOptions;
6 use std::os::windows::fs::OpenOptionsExt;
7 
8 use winapi::um::winnt::FILE_SHARE_READ;
9 
set_extra_open_opts(opts: &mut OpenOptions)10 pub fn set_extra_open_opts(opts: &mut OpenOptions) {
11     // Allow other applications to read the memory region. This is useful when
12     // folks want to tail the pstore file, and would fail without this setting.
13     opts.share_mode(FILE_SHARE_READ);
14 }
15