#ifndef NUCLEIC_CVSOCK_H
#define NUCLEIC_CVSOCK_H

#include <stdint.h>

// Create + bind + listen an AF_VSOCK stream socket on `port`, listening on any CID (inside a macOS
// guest the guest's CID is assigned by the hypervisor; the host connects via VZVirtioSocketDevice).
// Returns the listening fd (>= 0), or -errno on failure. Lives in C because Swift's Darwin overlay
// does not surface `struct sockaddr_vm` from <sys/vsock.h>.
int nucleic_vsock_listen(uint32_t port, int backlog);

#endif
