[*] UNIX: Attempt to peek pipe read-available if in ptr is null with FIONREAD when available

This commit is contained in:
Reece Wilson 2022-05-01 20:35:46 +01:00
parent b9414f09d6
commit 7613af2280

View File

@ -143,6 +143,22 @@ namespace Aurora::IPC
::fcntl(handle, F_SETFL, control);
}
if (!write.ptr)
{
#if defined(FIONREAD)
int available {};
if (ioctl(ref, FIONREAD, &available) < 0)
{
return false;
}
write.outVariable = available;
return true;
#else
return false;
#endif
}
int tmp;
do
{