libnx  v4.7.0
Data Structures | Functions | Variables
bsd.h File Reference

BSD sockets (bsd:u/s) service IPC wrapper. More...

#include <sys/socket.h>
#include <sys/select.h>
#include <poll.h>
#include "../types.h"
#include "../kernel/tmem.h"
#include "../sf/service.h"

Go to the source code of this file.

Data Structures

struct  BsdInitConfig
 Configuration structure for bsdInitalize. More...
 

Functions

const BsdInitConfigbsdGetDefaultInitConfig (void)
 Fetch the default configuration for bsdInitialize.
 
Result bsdInitialize (const BsdInitConfig *config, u32 num_sessions, u32 service_type)
 Initialize the BSD service.
 
void bsdExit (void)
 Exit the BSD service.
 
ServicebsdGetServiceSession (void)
 Gets the Service object for the actual BSD service session.
 
int bsdSocket (int domain, int type, int protocol)
 Creates a socket.
 
int bsdSocketExempt (int domain, int type, int protocol)
 Like bsdSocket but the newly created socket is immediately shut down.
 
int bsdOpen (const char *pathname, int flags)
 
int bsdSelect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
 
int bsdPoll (struct pollfd *fds, nfds_t nfds, int timeout)
 
int bsdSysctl (const int *name, unsigned int namelen, void *oldp, size_t *oldlenp, const void *newp, size_t newlen)
 
ssize_t bsdRecv (int sockfd, void *buf, size_t len, int flags)
 
ssize_t bsdRecvFrom (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
 
ssize_t bsdSend (int sockfd, const void *buf, size_t len, int flags)
 
ssize_t bsdSendTo (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
 
int bsdAccept (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int bsdBind (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 
int bsdConnect (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 
int bsdGetPeerName (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int bsdGetSockName (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int bsdGetSockOpt (int sockfd, int level, int optname, void *optval, socklen_t *optlen)
 
int bsdListen (int sockfd, int backlog)
 
int bsdIoctl (int fd, int request, void *data)
 Made non-variadic for convenience.
 
int bsdFcntl (int fd, int cmd, int flags)
 Made non-variadic for convenience.
 
int bsdSetSockOpt (int sockfd, int level, int optname, const void *optval, socklen_t optlen)
 
int bsdShutdown (int sockfd, int how)
 
int bsdShutdownAllSockets (int how)
 
ssize_t bsdWrite (int fd, const void *buf, size_t count)
 
ssize_t bsdRead (int fd, void *buf, size_t count)
 
int bsdClose (int fd)
 
int bsdDuplicateSocket (int sockfd)
 Duplicate a socket (bsd:s).
 
int bsdRecvMMsg (int sockfd, void *buf, size_t size, unsigned int vlen, int flags, struct timespec *timeout)
 
int bsdSendMMsg (int sockfd, void *buf, size_t size, unsigned int vlen, int flags)
 

Variables

__thread Result g_bsdResult
 Last Switch "result", per-thread.
 
__thread int g_bsdErrno
 Last errno, per-thread.
 

Detailed Description

BSD sockets (bsd:u/s) service IPC wrapper.

Please use the standard <sys/socket.h> interface instead.

Author
plutoo
TuxSH