Records
Functions
-
zx::channel CloneChannelFromFileDescriptor (int fd)Defined at line 13 of file ../../src/lib/fsl/io/fd.cc
-
zx::channel TransferChannelFromFileDescriptor (fbl::unique_fd fd)Defined at line 30 of file ../../src/lib/fsl/io/fd.cc
-
bool VmoFromVector (const std::vector<char> & vector, SizedVmo * sized_vmo_ptr)Make a new shared buffer with the contents of a char vector.
Defined at line 95 of file ../../src/lib/fsl/vmo/vmo.cc
-
fbl::unique_fd OpenChannelAsFileDescriptor (zx::channel channel)Defined at line 48 of file ../../src/lib/fsl/io/fd.cc
-
bool BlockingCopyToString (zx::socket source, std::string * contents)Copies the data from |source| into |contents| and returns true on success and
false on error. In case of I/O error, |contents| holds the data that could
be read from source before the error occurred.
Defined at line 15 of file ../../src/lib/fsl/socket/strings.cc
-
bool VmoFromFd (fbl::unique_fd fd, SizedVmo * handle_ptr)Make a new shared buffer with the contents of a file.
Defined at line 15 of file ../../src/lib/fsl/vmo/file.cc
-
bool VmoFromString (std::string_view string, SizedVmo * handle_ptr)Make a new shared buffer with the contents of a string.
Defined at line 63 of file ../../src/lib/fsl/vmo/vmo.cc
-
bool BlockingDrainFrom (zx::socket source, fit::function<size_t (const void *, uint32_t)> write_bytes)Drain the given socket and call |write_bytes| with pieces of data.
|write_bytes| must return the number of bytes consumed. Returns |true| if the
socket has been drained, |false| if an error occurred.
Defined at line 15 of file ../../src/lib/fsl/socket/blocking_drain.cc
-
bool VmoFromVector (const std::vector<char> & vector, fuchsia::mem::Buffer * sized_vmo_ptr)Make a new shared buffer with the contents of a char vector.
Defined at line 99 of file ../../src/lib/fsl/vmo/vmo.cc
-
zx_koid_t GetKoid (zx_handle_t handle)Gets the kernel object id (koid) of the object associated with the handle.
Returns |ZX_KOID_INVALID| if the handle is invalid.
Defined at line 14 of file ../../src/lib/fsl/handles/object_info.cc
-
bool BlockingCopyFromString (std::string_view source, const zx::socket & destination)Defined at line 24 of file ../../src/lib/fsl/socket/strings.cc
-
bool VmoFromFilename (const std::string & filename, SizedVmo * handle_ptr)Make a new shared buffer with the contents of a file.
Defined at line 29 of file ../../src/lib/fsl/vmo/file.cc
-
bool VmoFromString (std::string_view string, fuchsia::mem::Buffer * buffer_ptr)Make a new shared buffer with the contents of a string.
Defined at line 67 of file ../../src/lib/fsl/vmo/vmo.cc
-
void CopyToFileDescriptor (zx::socket source, fbl::unique_fd destination, async_dispatcher_t * dispatcher, fit::function<void (bool, fbl::unique_fd)> callback)Asynchronously copies data from source to the destination file descriptor.
The given |callback| is run upon completion. File writes and |callback| will
be scheduled on the given |task_runner|.
Defined at line 188 of file ../../src/lib/fsl/socket/files.cc
-
bool VectorFromVmo (const SizedVmo & shared_buffer, std::vector<char> * vector_ptr)Copy the contents of a shared buffer into a char vector.
Defined at line 108 of file ../../src/lib/fsl/vmo/vmo.cc
-
zx::socket WriteStringToSocket (std::string_view source)Copies the string |source| to a temporary socket and returns the
consumer handle.
Defined at line 49 of file ../../src/lib/fsl/socket/strings.cc
-
bool VmoFromFilenameAt (int dirfd, const std::string & filename, SizedVmo * handle_ptr)Make a new shared buffer with the contents of a file.
Defined at line 36 of file ../../src/lib/fsl/vmo/file.cc
-
bool StringFromVmo (const SizedVmo & handle, std::string * string_ptr)Copy the contents of a shared buffer into a string.
Defined at line 76 of file ../../src/lib/fsl/vmo/vmo.cc
-
bool VectorFromVmo (const fuchsia::mem::Buffer & shared_buffer, std::vector<char> * vector_ptr)Copy the contents of a shared buffer into a char vector.
Defined at line 112 of file ../../src/lib/fsl/vmo/vmo.cc
-
bool StringFromVmo (const fuchsia::mem::Buffer & handle, std::string * string_ptr)Copy the contents of a shared buffer into a string.
Defined at line 80 of file ../../src/lib/fsl/vmo/vmo.cc
-
void CopyFromFileDescriptor (fbl::unique_fd source, zx::socket destination, async_dispatcher_t * dispatcher, fit::function<void (bool, fbl::unique_fd)> callback)Asynchronously copies data from source file to the destination. The given
|callback| is run upon completion. File reads and |callback| will be
scheduled to the given |task_runner|.
Defined at line 194 of file ../../src/lib/fsl/socket/files.cc
-
bool VmoFromVector (const std::vector<uint8_t> & vector, SizedVmo * sized_vmo_ptr)Make a new shared buffer with the contents of a uint8_t vector.
Defined at line 119 of file ../../src/lib/fsl/vmo/vmo.cc
-
zx_status_t CreateRedirectedSocket (int startup_fd, zx::socket * out_socket, StartupHandle * out_startup_handle)Creates a socket and returns one end of it along with a |StartupHandle|
which can be used to bind the other end to a file descriptor in a new
process which is about to be launched.
|startup_fd| is the file descriptor number to which the socket will be
bound in the new process, eg. use 0 to bind to standard input.
|out_socket| receives the local end of the socket.
|out_startup_handle| receives the startup handle which must be passed to
the launcher to bind the remote end of the socket in the new process.
Defined at line 13 of file ../../src/lib/fsl/io/redirection.cc
-
bool StringFromVmo (const fuchsia::mem::Buffer & handle, size_t num_bytes, std::string * string_ptr)Copy the contents of a shared buffer upto |num_bytes| into a string.
|num_bytes| should be
<
= |handle.size|.
Defined at line 87 of file ../../src/lib/fsl/vmo/vmo.cc
-
bool VmoFromVector (const std::vector<uint8_t> & vector, fuchsia::mem::Buffer * sized_vmo_ptr)Make a new shared buffer with the contents of a uint8_t vector.
Defined at line 123 of file ../../src/lib/fsl/vmo/vmo.cc
-
zx_koid_t GetRelatedKoid (zx_handle_t handle)Gets the kernel object id (koid) of the object related to the object
associated with the handle. For example, if the object associated with the
handle is a channel, this function returns the koid of the channel object at
the opposite end.
Returns |ZX_KOID_INVALID| if the handle is invalid or the object associated
with the handle has no related object.
Note that closing all of the handles to the related object will not free it
immediately, as long as handles to its partner remain. The return value will
still be a valid koid in this case.
Defined at line 21 of file ../../src/lib/fsl/handles/object_info.cc
-
bool VectorFromVmo (const SizedVmo & shared_buffer, std::vector<uint8_t> * vector_ptr)Copy the contents of a shared buffer into a uint8_t vector.
Defined at line 132 of file ../../src/lib/fsl/vmo/vmo.cc
-
bool VectorFromVmo (const fuchsia::mem::Buffer & shared_buffer, std::vector<uint8_t> * vector_ptr)Copy the contents of a shared buffer into a uint8_t vector.
Defined at line 137 of file ../../src/lib/fsl/vmo/vmo.cc
-
std::pair<zx_koid_t, zx_koid_t> GetKoids (zx_handle_t handle)Gets the kernel object ids (koids) of the object associated with the handle
and of the object related to the handle's object.
For example, if the object associated with the handle is an eventpair, this
function returns the koids of each end.
The return value is as if std::pair(GetKoid(), GetRelatedKoid()) was called.
The first slot of the std::pair contains |ZX_KOID_INVALID| if the handle is
invalid. The second slot of the std::pair contains |ZX_KOID_INVALID| if the
handle is invalid, or the object associated with the handle has no related
object.
Note that closing all of the handles to the related object will not free it
immediately, as long as handles to its partner remain. The second slot of
the std::pair will contain a valid koid in this case.
Defined at line 28 of file ../../src/lib/fsl/handles/object_info.cc
-
zx_obj_type_t GetType (zx_handle_t handle)Gets the type of a kernel object.
Defined at line 36 of file ../../src/lib/fsl/handles/object_info.cc
-
std::string GetObjectName (zx_handle_t handle)Gets the name of a kernel object.
Defined at line 43 of file ../../src/lib/fsl/handles/object_info.cc
-
zx_status_t SetObjectName (zx_handle_t handle, const std::string & name)Sets the name of a kernel object.
Note: The kernel truncates names to |ZX_MAX_NAME_LEN|.
Defined at line 49 of file ../../src/lib/fsl/handles/object_info.cc
-
bool MaybeSetObjectName (zx_handle_t handle, const std::string & name, std::function<bool (std::string)> replace)Sets the name of a kernel object if it is currently unset or the |replace| function returns true
when passed the current name. For example, a caller may choose to only set the name if its
current name begins with "Sysmem". Returns true iff the name was set successfully.
Defined at line 53 of file ../../src/lib/fsl/handles/object_info.cc
-
zx_koid_t GetCurrentProcessKoid ()Gets the kernel object id of the current process.
Defined at line 65 of file ../../src/lib/fsl/handles/object_info.cc
-
std::string GetCurrentProcessName ()Gets the current process name.
Defined at line 67 of file ../../src/lib/fsl/handles/object_info.cc
-
zx_koid_t GetCurrentThreadKoid ()Gets the kernel object id of the current thread.
Defined at line 69 of file ../../src/lib/fsl/handles/object_info.cc
-
std::string GetCurrentThreadName ()Gets the current thread name.
Defined at line 71 of file ../../src/lib/fsl/handles/object_info.cc
-
zx_status_t SetCurrentThreadName (const std::string & name)Sets the name of the current thread.
Note: The kernel truncates names to |ZX_MAX_NAME_LEN|.
Defined at line 73 of file ../../src/lib/fsl/handles/object_info.cc
-
zx::duration GetCurrentThreadTotalRuntime ()Gets the total runtime of the current thread.
Defined at line 77 of file ../../src/lib/fsl/handles/object_info.cc
-
size_t GetCurrentProcessMemoryMappedBytes ()Gets the total size of mapped memory ranges in the current process in bytes.
Not all will be backed by physical memory.
Defined at line 84 of file ../../src/lib/fsl/handles/object_info.cc
-
size_t GetCurrentProcessMemoryPrivateBytes ()Gets the committed memory that is only mapped into the current process in
bytes.
Defined at line 91 of file ../../src/lib/fsl/handles/object_info.cc
-
size_t GetCurrentProcessMemorySharedBytes ()Gets the committed memory that is mapped into the current process and at
least one other process.
Defined at line 98 of file ../../src/lib/fsl/handles/object_info.cc
-
size_t GetCurrentProcessMemoryScaledSharedBytes ()Gets a number that estimates the fraction of shared bytes that the current
process is responsible for keeping alive.
Defined at line 105 of file ../../src/lib/fsl/handles/object_info.cc