mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Rename FileDescriptor::has_data_available_for_reading() -> can_read().
This commit is contained in:
parent
a8baee4dcd
commit
8ad2dfb6e1
4 changed files with 6 additions and 6 deletions
|
@ -1076,7 +1076,7 @@ ssize_t Process::sys$read(int fd, void* outbuf, size_t nread)
|
|||
if (!descriptor)
|
||||
return -EBADF;
|
||||
if (descriptor->is_blocking()) {
|
||||
if (!descriptor->has_data_available_for_reading(*this)) {
|
||||
if (!descriptor->can_read(*this)) {
|
||||
m_blocked_fd = fd;
|
||||
block(BlockedRead);
|
||||
sched_yield();
|
||||
|
@ -1964,7 +1964,7 @@ int Process::sys$select(const Syscall::SC_select_params* params)
|
|||
memset(readfds, 0, sizeof(fd_set));
|
||||
auto bitmap = Bitmap::wrap((byte*)readfds, FD_SETSIZE);
|
||||
for (int fd : m_select_read_fds) {
|
||||
if (m_fds[fd].descriptor->has_data_available_for_reading(*this)) {
|
||||
if (m_fds[fd].descriptor->can_read(*this)) {
|
||||
bitmap.set(fd, true);
|
||||
++markedfds;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ bool Scheduler::pick_next()
|
|||
if (process.state() == Process::BlockedRead) {
|
||||
ASSERT(process.m_blocked_fd != -1);
|
||||
// FIXME: Block until the amount of data wanted is available.
|
||||
if (process.m_fds[process.m_blocked_fd].descriptor->has_data_available_for_reading(process))
|
||||
if (process.m_fds[process.m_blocked_fd].descriptor->can_read(process))
|
||||
process.unblock();
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ bool Scheduler::pick_next()
|
|||
|
||||
if (process.state() == Process::BlockedSelect) {
|
||||
for (int fd : process.m_select_read_fds) {
|
||||
if (process.m_fds[fd].descriptor->has_data_available_for_reading(process)) {
|
||||
if (process.m_fds[fd].descriptor->can_read(process)) {
|
||||
process.unblock();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ bool FileDescriptor::can_write(Process& process)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool FileDescriptor::has_data_available_for_reading(Process& process)
|
||||
bool FileDescriptor::can_read(Process& process)
|
||||
{
|
||||
if (is_fifo()) {
|
||||
ASSERT(fifo_direction() == FIFO::Reader);
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
ssize_t write(Process&, const byte* data, size_t);
|
||||
int stat(Unix::stat*);
|
||||
|
||||
bool has_data_available_for_reading(Process&);
|
||||
bool can_read(Process&);
|
||||
bool can_write(Process&);
|
||||
|
||||
ssize_t get_dir_entries(byte* buffer, size_t);
|
||||
|
|
Loading…
Add table
Reference in a new issue