#include <lunaix/syscall.h>
#include <lunaix/syscall_utils.h>
-#include <klibc/stdio.h>
+#include <klibc/strfmt.h>
#include <klibc/string.h>
static DEFINE_LLIST(root_list);
void
device_setname_vargs(struct device* dev, char* fmt, va_list args)
{
- size_t strlen =
- __ksprintf_internal(dev->name_val, fmt, DEVICE_NAME_SIZE, args);
+ size_t strlen = ksnprintfv(dev->name_val, fmt, DEVICE_NAME_SIZE, args);
dev->name = HSTR(dev->name_val, strlen);
llist_init_head(&dev->children);
mutex_init(&dev->lock);
+ iopoll_init_evt_q(&dev->pollers);
}
struct device*
return NULL;
}
+void
+device_alert_poller(struct device* dev, int poll_evt)
+{
+ dev->poll_evflags = poll_evt;
+ iopoll_wake_pollers(&dev->pollers);
+}
+
__DEFINE_LXSYSCALL3(int, ioctl, int, fd, int, req, va_list, args)
{
int errno = -1;