feat(c/libuv): Add GetIoWatcherFd func using LLGoFiles

This commit is contained in:
hackerchai
2024-08-07 14:48:15 +08:00
parent 3cd62994c7
commit 8848222728
3 changed files with 11 additions and 0 deletions

5
c/libuv/_wrap/libuv.c Normal file
View File

@@ -0,0 +1,5 @@
#include <uv.h>
int uv_tcp_get_io_watcher_fd (uv_tcp_t* handle) {
return handle->io_watcher.fd;
}

View File

@@ -9,6 +9,7 @@ import (
const (
LLGoPackage = "link: $(pkg-config --libs libuv); -luv"
LLGoFiles = "$(pkg-config --cflags libuv): _wrap/libuv.c"
)
// ----------------------------------------------

View File

@@ -378,6 +378,11 @@ func (tcp *Tcp) CloseReset(closeCb CloseCb) c.Int {
return 0
}
// llgo:link (*Tcp).GetIoWatcherFd C.uv_tcp_get_io_watcher_fd
func (tcp *Tcp) GetIoWatcherFd() c.Int {
return 0
}
//go:linkname TcpConnect C.uv_tcp_connect
func TcpConnect(req *Connect, tcp *Tcp, addr *net.SockAddr, connectCb ConnectCb) c.Int