--- nono/host/hostdevice.cpp 2026/04/29 17:05:11 1.1.1.1 +++ nono/host/hostdevice.cpp 2026/04/29 17:05:18 1.1.1.2 @@ -10,11 +10,10 @@ #include "hostdevice.h" #include "scheduler.h" -#include "signalthread.h" // コンストラクタ -HostDevice::HostDevice(const std::string& objname_) - : inherited(objname_) +HostDevice::HostDevice(int objid_) + : inherited(objid_) { } @@ -31,6 +30,10 @@ HostDevice::Init() int fds[2]; int r; + if (inherited::Init() == false) { + return false; + } + kq = kqueue(); if (kq < 0) { putmsg(0, "kqueue: %s", strerror(errno)); @@ -81,22 +84,6 @@ HostDevice::DelOuter(int fd) return kevent_add(kq, fd, EVFILT_READ, EV_DELETE, DATA_FROM_OUTER); } -// シグナルスレッドからのパイプを登録 -int -HostDevice::AddSignal(int rfd, int wfd) -{ - int r; - - r = kevent_add(kq, rfd, EVFILT_READ, EV_ADD, DATA_FROM_SIGNAL); - if (r < 0) { - return r; - } - // シグナルスレッドに登録。 - gSignalThread->AddPipe(wfd); - - return 0; -} - // Listen ソケットを登録 int HostDevice::AddListen(int ls, int action) @@ -225,7 +212,7 @@ HostDevice::putlogn(const char *fmt, ... va_list ap; int len; - uint64 vt = gScheduler->GetVirtTime(); + uint64 vt = scheduler->GetVirtTime(); len = snprintf(buf, sizeof(buf), "%4d.%03d'%03d'%03d %s ", (int)(vt / 1000 / 1000 / 1000), (int)((vt / 1000 / 1000) % 1000),