mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
parent
527c8047fe
commit
f48feae0b2
44 changed files with 184 additions and 146 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "MasterPTY.h"
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Singleton.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
|
||||
//#define PTMX_DEBUG
|
||||
|
@ -35,18 +36,16 @@
|
|||
namespace Kernel {
|
||||
|
||||
static const unsigned s_max_pty_pairs = 8;
|
||||
static PTYMultiplexer* s_the;
|
||||
static auto s_the = make_singleton<PTYMultiplexer>();
|
||||
|
||||
PTYMultiplexer& PTYMultiplexer::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
PTYMultiplexer::PTYMultiplexer()
|
||||
: CharacterDevice(5, 2)
|
||||
{
|
||||
s_the = this;
|
||||
m_freelist.ensure_capacity(s_max_pty_pairs);
|
||||
for (int i = s_max_pty_pairs; i > 0; --i)
|
||||
m_freelist.unchecked_append(i - 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue