class Exceptionate
Defined at line 22 of file ../../zircon/kernel/object/include/object/exceptionate.h
Kernel-owned exception channel endpoint.
This class is thread-safe, does not require external synchronization.
Public Methods
void Exceptionate (uint32_t type)
|type| must be a valid ZX_EXCEPTION_CHANNEL_TYPE_* constant.
Defined at line 18 of file ../../zircon/kernel/object/exceptionate.cc
void ~Exceptionate ()
Shuts the underlying channel down if it's still connected to be sure the
userspace endpoint gets the PEER_CLOSED signal.
In most cases the task wants to manually shutdown the exceptionate when
transitioning to a dead state, but in some cases tasks can be destroyed
without registering the dead state e.g. childless jobs.
Defined at line 20 of file ../../zircon/kernel/object/exceptionate.cc
zx_status_t SetChannel (KernelHandle<ChannelDispatcher> channel_handle, zx_rights_t thread_rights, zx_rights_t process_rights)
Sets the backing ChannelDispatcher endpoint.
The exception channel is first-come-first-served, so if there is
already a valid channel in place (i.e. has a live peer) this will
fail.
The |*_rights| arguments give the rights to assign to task handles
provided through this exception channel. A value of 0 indicates that
the handle should not be made available through this channel.
Returns:
ZX_ERR_INVALID_ARGS if |channel| is null.
ZX_ERR_ALREADY_BOUND is there is already a valid channel.
ZX_ERR_BAD_STATE if Shutdown() has already been called.
Defined at line 22 of file ../../zircon/kernel/object/exceptionate.cc
uint32_t type ()
Defined at line 27 of file ../../zircon/kernel/object/include/object/exceptionate.h
void Shutdown ()
Removes any exception channel, which will signal PEER_CLOSED for the
userspace endpoint.
Any further attempt to set a new channel will return ZX_ERR_BAD_STATE.
Defined at line 48 of file ../../zircon/kernel/object/exceptionate.cc
bool HasValidChannel ()
Returns true if the channel exists and has a valid userspace peer.
Defined at line 54 of file ../../zircon/kernel/object/exceptionate.cc
zx_status_t SendException (const fbl::RefPtr<ExceptionDispatcher> & exception)
Sends an exception to userspace.
The exception message contains:
* 1 struct: zx_exception_info_t
* 1 handle: ExceptionDispatcher
Returns:
ZX_ERR_NEXT if there is no valid underlying channel.
ZX_ERR_NO_MEMORY if we failed to allocate memory.
Defined at line 63 of file ../../zircon/kernel/object/exceptionate.cc