1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
//! A guest's `siginfo_t`, in a form a syscall handler can hold across
//! `.await`s.
//!
//! Since libc 0.2.190 the Linux `siginfo_t` holds raw pointers
//! (`si_addr`, `si_ptr`, `si_call_addr`, ...) and is neither `Send` nor
//! `Sync`. Neither is an `AddrMut<siginfo_t>` naming one, because Reverie's
//! address types are `Send` only when their pointee is. A handler that keeps
//! either alive across an `.await` makes its future non-`Send`, which the
//! tool's `handle_syscall_event` must be. Detcore copies these values between
//! guest memory and the kernel and never dereferences their pointer fields, so
//! the value is plain data. Read and write it as [`GuestSiginfo`], casting the
//! guest address with `AddrMut::cast`.
/// A guest `siginfo_t` as plain data; see the module documentation.
pub siginfo_t);
// SAFETY: the raw-pointer fields are guest addresses, never dereferenced.
unsafe
// SAFETY: as for `Send`; shared access only reads plain fields.
unsafe
// The wrapper keeps a handler future `Send` on every libc only if it is
// `Send` and `Sync` even where `libc::siginfo_t` is not, an address typed by
// it is `Send`, and it has `siginfo_t`'s layout so a guest address can be
// cast to it. Checked at compile time.
const _: = ;