mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Kernel: Make sure processes always start out with fds 0, 1 and 2 open.
If we don't have a TTY for the process, fall back to /dev/null.
This commit is contained in:
parent
7def86c86d
commit
111589a558
5 changed files with 46 additions and 15 deletions
|
@ -3,9 +3,18 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/kstdio.h>
|
||||
|
||||
static NullDevice* s_the;
|
||||
|
||||
NullDevice& NullDevice::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
NullDevice::NullDevice()
|
||||
: CharacterDevice(1, 3)
|
||||
{
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
NullDevice::~NullDevice()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue