Noux: implement the 'F_GETFL' 'fcntl()' command for pipes

Fixes #1513
This commit is contained in:
Christian Prochaska 2015-05-11 21:13:12 +02:00 committed by Christian Helmuth
parent e7f869611c
commit 5bf538de0c
1 changed files with 26 additions and 0 deletions

View File

@ -252,6 +252,19 @@ namespace Noux {
return true;
}
bool fcntl(Sysio *sysio) override
{
switch (sysio->fcntl_in.cmd) {
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
sysio->fcntl_out.result = Sysio::OPEN_MODE_WRONLY;
return true;
default:
return false;
}
}
bool fstat(Sysio *sysio) override
{
sysio->fstat_out.st.mode = Sysio::STAT_MODE_CHARDEV;
@ -315,6 +328,19 @@ namespace Noux {
return true;
}
bool fcntl(Sysio *sysio) override
{
switch (sysio->fcntl_in.cmd) {
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
sysio->fcntl_out.result = Sysio::OPEN_MODE_RDONLY;
return true;
default:
return false;
}
}
bool fstat(Sysio *sysio) override
{
sysio->fstat_out.st.mode = Sysio::STAT_MODE_CHARDEV;