aboutsummaryrefslogtreecommitdiff
path: root/src/io/io_darwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/io_darwin.cpp')
-rw-r--r--src/io/io_darwin.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/io/io_darwin.cpp b/src/io/io_darwin.cpp
index fff41d373..61e3f1624 100644
--- a/src/io/io_darwin.cpp
+++ b/src/io/io_darwin.cpp
@@ -43,6 +43,20 @@ extern "C" mach_port_t io_darwin_create_machport(uint64_t wakeup, int32_t fd,
}
}
+extern "C" bool getaddrinfo_send_reply(mach_port_t port,
+ void (*sendReply)(void *)) {
+ mach_msg_empty_rcv_t msg;
+ mach_msg_return_t status;
+
+ status = mach_msg(&msg.header, MACH_RCV_MSG, 0, sizeof(msg), port,
+ MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (status != MACH_MSG_SUCCESS) {
+ return false;
+ }
+ sendReply(&msg);
+ return true;
+}
+
extern "C" bool io_darwin_schedule_wakeup(mach_port_t waker) {
mach_msg_empty_send_t message{};
message.header.msgh_size = sizeof(message);