return true;
}
-static int gdbserver_open_socket(const char *path, Error **errp)
+static int gdbserver_open_socket(const char *path)
{
g_autoptr(GString) buf = g_string_new("");
+ struct sockaddr_un sockaddr = {};
const char *pid_placeholder;
+ int fd, ret;
pid_placeholder = strstr(path, "%d");
if (pid_placeholder != NULL) {
path = buf->str;
}
- return unix_listen(path, errp);
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ perror("create socket");
+ return -1;
+ }
+
+ sockaddr.sun_family = AF_UNIX;
+ pstrcpy(sockaddr.sun_path, sizeof(sockaddr.sun_path) - 1, path);
+ ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
+ if (ret < 0) {
+ perror("bind socket");
+ close(fd);
+ return -1;
+ }
+ ret = listen(fd, 1);
+ if (ret < 0) {
+ perror("listen socket");
+ close(fd);
+ return -1;
+ }
+
+ return fd;
}
static bool gdb_accept_tcp(int gdb_fd)
if (port > 0) {
gdb_fd = gdbserver_open_port(port, errp);
} else {
- gdb_fd = gdbserver_open_socket(port_or_path, errp);
+ gdb_fd = gdbserver_open_socket(port_or_path);
}
if (gdb_fd < 0) {
return false;
util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c'))
util_ss.add(files(f'coroutine-@coroutine_backend@.c'))
util_ss.add(files('thread-pool.c', 'qemu-timer.c'))
-endif
-if have_block or have_ga or have_user
util_ss.add(files('qemu-sockets.c'))
endif
if have_block