MySQL 9.0.0
Source Code Documentation
task_os.h File Reference
#include "xcom/result.h"
#include "xcom/task_debug.h"
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define DIR_SEP   '/'
 
#define IPPROTO_TCP   SOL_TCP
 
#define SOCK_EINTR   EINTR
 
#define SOCK_EAGAIN   EAGAIN
 
#define SOCK_EWOULDBLOCK   EWOULDBLOCK
 
#define SOCK_EINPROGRESS   EINPROGRESS
 
#define SOCK_EALREADY   EALREADY
 
#define SOCK_ECONNREFUSED   ECONNREFUSED
 
#define SOCK_ECONNRESET   ECONNRESET
 
#define SOCK_ERRNO   task_errno
 
#define SOCK_OPT_REUSEADDR   SO_REUSEADDR
 
#define GET_OS_ERR   errno
 
#define SET_OS_ERR(x)   errno = (x)
 
#define CLOSESOCKET(x)   close(x)
 
#define SOCK_SHUT_RDWR   (SHUT_RD | SHUT_WR)
 
#define SOCK_SHUT_RW   SHUT_WR
 
#define SOCK_SHUT_RD   SHUT_RD
 

Typedefs

typedef struct pollfd pollfd
 

Functions

static int hard_connect_err (int err)
 
static int hard_select_err (int err)
 
static int is_socket_error (int x)
 
void remove_and_wakeup (int fd)
 
static void shutdown_socket (int *sock)
 
static int xcom_getpeername (int s, struct sockaddr *name, socklen_t *namelen)
 
static result xcom_close_socket (int *sock)
 
static result xcom_shut_close_socket (int *sock)
 

Macro Definition Documentation

◆ CLOSESOCKET

#define CLOSESOCKET (   x)    close(x)

◆ DIR_SEP

#define DIR_SEP   '/'

◆ GET_OS_ERR

#define GET_OS_ERR   errno

◆ IPPROTO_TCP

#define IPPROTO_TCP   SOL_TCP

◆ SET_OS_ERR

#define SET_OS_ERR (   x)    errno = (x)

◆ SOCK_EAGAIN

#define SOCK_EAGAIN   EAGAIN

◆ SOCK_EALREADY

#define SOCK_EALREADY   EALREADY

◆ SOCK_ECONNREFUSED

#define SOCK_ECONNREFUSED   ECONNREFUSED

◆ SOCK_ECONNRESET

#define SOCK_ECONNRESET   ECONNRESET

◆ SOCK_EINPROGRESS

#define SOCK_EINPROGRESS   EINPROGRESS

◆ SOCK_EINTR

#define SOCK_EINTR   EINTR

◆ SOCK_ERRNO

#define SOCK_ERRNO   task_errno

◆ SOCK_EWOULDBLOCK

#define SOCK_EWOULDBLOCK   EWOULDBLOCK

◆ SOCK_OPT_REUSEADDR

#define SOCK_OPT_REUSEADDR   SO_REUSEADDR

◆ SOCK_SHUT_RD

#define SOCK_SHUT_RD   SHUT_RD

◆ SOCK_SHUT_RDWR

#define SOCK_SHUT_RDWR   (SHUT_RD | SHUT_WR)

◆ SOCK_SHUT_RW

#define SOCK_SHUT_RW   SHUT_WR

Typedef Documentation

◆ pollfd

typedef struct pollfd pollfd

Function Documentation

◆ hard_connect_err()

static int hard_connect_err ( int  err)
inlinestatic

◆ hard_select_err()

static int hard_select_err ( int  err)
inlinestatic

◆ is_socket_error()

static int is_socket_error ( int  x)
inlinestatic

◆ remove_and_wakeup()

void remove_and_wakeup ( int  fd)

◆ shutdown_socket()

static void shutdown_socket ( int *  sock)
inlinestatic

◆ xcom_close_socket()

static result xcom_close_socket ( int *  sock)
inlinestatic

◆ xcom_getpeername()

static int xcom_getpeername ( int  s,
struct sockaddr name,
socklen_t *  namelen 
)
inlinestatic

◆ xcom_shut_close_socket()

static result xcom_shut_close_socket ( int *  sock)
inlinestatic