EventFileDescription implements vfs.FileDescriptionImpl for file-based event notification (eventfd). Eventfds are usually internal to the Sentry but in certain situations they may be converted into a host-backed eventfd. +stateify savable
| 39 | // |
| 40 | // +stateify savable |
| 41 | type EventFileDescription struct { |
| 42 | vfsfd vfs.FileDescription |
| 43 | vfs.FileDescriptionDefaultImpl |
| 44 | vfs.DentryMetadataFileDescriptionImpl |
| 45 | vfs.NoLockFD |
| 46 | |
| 47 | // queue is used to notify interested parties when the event object |
| 48 | // becomes readable or writable. |
| 49 | queue waiter.Queue |
| 50 | |
| 51 | // mu protects the fields below. |
| 52 | mu sync.Mutex `state:"nosave"` |
| 53 | |
| 54 | // val is the current value of the event counter. |
| 55 | val uint64 |
| 56 | |
| 57 | // semMode specifies whether the event is in "semaphore" mode. |
| 58 | semMode bool |
| 59 | |
| 60 | // hostfd indicates whether this eventfd is passed through to the host. |
| 61 | hostfd int |
| 62 | |
| 63 | // sentryOwnedHostfd indicates whether the sentry owns the hostfd. |
| 64 | sentryOwnedHostfd bool |
| 65 | |
| 66 | // hostfdState is the state of the hostfd during save/restore. |
| 67 | hostfdState [8]byte |
| 68 | } |
| 69 | |
| 70 | var _ vfs.FileDescriptionImpl = (*EventFileDescription)(nil) |
| 71 |
nothing calls this directly
no outgoing calls
no test coverage detected