Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
fdutils.h
Go to the documentation of this file.
1// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_BIN_FDUTILS_H_
6#define RUNTIME_BIN_FDUTILS_H_
7
8#include "bin/builtin.h"
9#include "platform/globals.h"
10
11namespace dart {
12namespace bin {
13
14class FDUtils {
15 public:
16 static bool SetCloseOnExec(intptr_t fd);
17
18 static bool SetNonBlocking(intptr_t fd);
19 static bool SetBlocking(intptr_t fd);
20
21 // Checks whether the file descriptor is blocking. If the function
22 // returns true the value pointed to by is_blocking will be set to
23 // the blocking state of the file descriptor. If the function
24 // returns false the system call for checking the file descriptor
25 // failed and the value pointed to by is_blocking is not modified.
26 static bool IsBlocking(intptr_t fd, bool* is_blocking);
27
28 static intptr_t AvailableBytes(intptr_t fd);
29
30 // Reads the requested number of bytes from a file descriptor. This
31 // function will only return on short reads if an error occurs in
32 // which case it returns -1 and errno is still valid. The file
33 // descriptor must be in blocking mode.
34 static ssize_t ReadFromBlocking(int fd, void* buffer, size_t count);
35
36 // Writes the requested number of bytes to a file descriptor. This
37 // function will only return on short writes if an error occurs in
38 // which case it returns -1 and errno is still valid. The file
39 // descriptor must be in blocking mode.
40 static ssize_t WriteToBlocking(int fd, const void* buffer, size_t count);
41
42 // Closes fd without modifying errno.
43 static void SaveErrorAndClose(intptr_t fd);
44
45 private:
46 DISALLOW_ALLOCATION();
47 DISALLOW_IMPLICIT_CONSTRUCTORS(FDUtils);
48};
49
50} // namespace bin
51} // namespace dart
52
53#endif // RUNTIME_BIN_FDUTILS_H_
int count
Definition: FontMgrTest.cpp:50
static intptr_t AvailableBytes(intptr_t fd)
static bool SetCloseOnExec(intptr_t fd)
static bool SetBlocking(intptr_t fd)
static bool IsBlocking(intptr_t fd, bool *is_blocking)
static bool SetNonBlocking(intptr_t fd)
static void SaveErrorAndClose(intptr_t fd)
static ssize_t ReadFromBlocking(int fd, void *buffer, size_t count)
static ssize_t WriteToBlocking(int fd, const void *buffer, size_t count)
Definition: dart_vm.cc:33
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126