Event
public struct Event: FileDescriptor
Event represents an event file descriptor as described in eventfd(2).
-
The file descriptor for this event.
Declaration
Swift
public let fileDescriptor: Int32
-
Creates an event file descriptor with the provided initial value and flags.
Declaration
Swift
public init(initialValue: UInt32 = 0, flags: Flags = []) throws
-
Reads the current value from the file descriptor. See eventfd(2) for details on the behaviour of this call. Returns the value read from the event.
Declaration
Swift
public func read() throws -> UInt64
-
Adds the specified value to the event file descriptor. See eventfd(2) for details on the behaviour of this call.
Declaration
Swift
public func write(_ n: UInt64) throws
-
Releases the resource associated with this file descriptor.
Declaration
Swift
public func close() throws