Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
bin
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
11
namespace
dart
{
12
namespace
bin {
13
14
class
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_
count
int count
Definition
FontMgrTest.cpp:50
builtin.h
dart::bin::FDUtils
Definition
fdutils.h:14
dart::bin::FDUtils::AvailableBytes
static intptr_t AvailableBytes(intptr_t fd)
dart::bin::FDUtils::SetCloseOnExec
static bool SetCloseOnExec(intptr_t fd)
dart::bin::FDUtils::SetBlocking
static bool SetBlocking(intptr_t fd)
dart::bin::FDUtils::IsBlocking
static bool IsBlocking(intptr_t fd, bool *is_blocking)
dart::bin::FDUtils::SetNonBlocking
static bool SetNonBlocking(intptr_t fd)
dart::bin::FDUtils::SaveErrorAndClose
static void SaveErrorAndClose(intptr_t fd)
dart::bin::FDUtils::ReadFromBlocking
static ssize_t ReadFromBlocking(int fd, void *buffer, size_t count)
dart::bin::FDUtils::WriteToBlocking
static ssize_t WriteToBlocking(int fd, const void *buffer, size_t count)
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
dart
Definition
dart_vm.cc:33
globals.h
DISALLOW_IMPLICIT_CONSTRUCTORS
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition
globals.h:593
Generated on Fri Apr 26 2024 06:14:41 for Flutter Engine by
1.9.8