mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Noux: add F_GETFL handling to terminal_io_channel
There are certain programms which check if an fd is open by calling fcntl(fd, F_GETFL, ...). So to keep them happy we return true if such an request was done to our terminal fd's.
This commit is contained in:
parent
7dfbd9e191
commit
343266b06e
@ -108,6 +108,33 @@ namespace Noux {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fcntl(Sysio *sysio)
|
||||
{
|
||||
/**
|
||||
* Actually it is "inappropiate" to use fcntl() directly on terminals
|
||||
* (atleast according to the Open Group Specification). We do it anyway
|
||||
* since in our case stdout/in/err is directly connected to the terminal.
|
||||
*
|
||||
* Some GNU programms check if stdout is open by calling fcntl(stdout, F_GETFL, ...).
|
||||
*/
|
||||
switch (sysio->fcntl_in.cmd) {
|
||||
|
||||
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
|
||||
{
|
||||
sysio->fcntl_out.result = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fstat(Sysio *sysio)
|
||||
{
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user