[*] UNIX: Attempt to peek pipe read-available if in ptr is null with FIONREAD when available
This commit is contained in:
parent
b9414f09d6
commit
7613af2280
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user