#include <sys/socket.h>
+#include <uk/config.h>
+
struct posix_socket_driver;
struct posix_socket_node {
struct sockaddr *addr,
socklen_t *addr_len, int flags);
+#if CONFIG_LIBPOSIX_FDTAB
int uk_sys_socket(int family, int type, int protocol);
int uk_sys_socketpair(int family, int type, int protocol, int sv[2]);
int uk_sys_accept(const struct uk_file *sock, int blocking,
struct sockaddr *addr, socklen_t *addr_len, int flags);
+#endif /* CONFIG_LIBPOSIX_FDTAB */
#endif /* __UK_SOCKET__ */
#include <uk/socket.h>
#include <uk/file.h>
#include <uk/file/nops.h>
-#include <uk/posix-fdtab.h>
#include <uk/posix-fd.h>
#include <uk/errptr.h>
#include <uk/print.h>
#include <uk/essentials.h>
#include <errno.h>
+#if CONFIG_LIBPOSIX_FDTAB
+#include <uk/posix-fdtab.h>
+#endif /* CONFIG_LIBPOSIX_FDTAB */
+
#include "events.h"
#endif /* CONFIG_LIBPOSIX_SOCKET_EVENTS */
};
-
+#if CONFIG_LIBPOSIX_FDTAB
static struct uk_ofile *socketfd_get(int fd)
{
struct uk_ofile *of = uk_fdtab_get(fd);
}
return of;
}
-
+#endif /* CONFIG_LIBPOSIX_FDTAB */
static ssize_t
socket_read(const struct uk_file *sock,
}
/* Internal API & Syscalls */
-
+#if CONFIG_LIBPOSIX_FDTAB
int uk_sys_socket(int family, int type, int protocol)
{
int fd;
return ret;
}
+#endif /* CONFIG_LIBPOSIX_FDTAB */
const struct uk_file *uk_socket_accept(const struct uk_file *sock, int blocking,
struct sockaddr *addr,
return &al->f;
}
+#if CONFIG_LIBPOSIX_FDTAB
int uk_sys_accept(const struct uk_file *sock, int blocking,
struct sockaddr *addr, socklen_t *addr_len, int flags)
{
}
#endif /* UK_LIBC_SYSCALLS */
+#endif /* CONFIG_LIBPOSIX_FDTAB */
+
int uk_socketpair_create(int family, int type, int protocol,
const struct uk_file *sv[2])
return ret;
}
+#if CONFIG_LIBPOSIX_FDTAB
int uk_sys_socketpair(int family, int type, int protocol, int sv[2])
{
int ret;
trace_posix_socket_socketpair_ret(ret);
return ret;
}
+#endif /* CONFIG_LIBPOSIX_FDTAB */