src/xcalls/x_socket.c File Reference

x_socket implementation. More...

#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <misc/debug.h>
#include <core/tx.h>
#include <core/config.h>
#include <core/koa.h>
#include <core/buffer.h>
#include <core/txdesc.h>
#include <core/stats.h>
#include <libc/syscalls.h>
#include <xcalls/xcalls.h>

Go to the source code of this file.

Classes

struct  x_socket_undo_args_s

Typedefs

typedef x_socket_undo_args_s x_socket_undo_args_t

Functions

int XCALL_DEF() x_socket (int domain, int type, int protocol, int *result)
 Creates an endpoint for communication.


Detailed Description

x_socket implementation.

Definition in file x_socket.c.


Function Documentation

int XCALL_DEF() x_socket ( int  domain,
int  type,
int  protocol,
int *  result 
)

Creates an endpoint for communication.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] domain Communication domain; this selects the protocol family which will be used for communication. These families are defined in <sys/socket.h>.
[in] type Specifies communication semantics. Currently we support:
  • SOCK_DGRAM: Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
[in] protocol Specifies a particular protocol to be used with the socket.
[out] result Where to store any asynchronous failures.
Returns:
A new file descriptor for the new socket, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).
Todo:
Implement SOCK_STREAM.

Definition at line 76 of file x_socket.c.

References txc_tx_s::buffer_linear, x_socket_undo_args_s::fd, x_socket_undo_args_s::koa, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_attach_fd(), txc_koa_create(), TXC_KOA_CREATE_UNDO_ACTION_ORDER, txc_koa_get_sentinel(), TXC_KOA_IS_SOCK_DGRAM, txc_koa_lock_fd(), txc_koa_unlock_fd(), TXC_R_SUCCESS, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), and x_socket().


Generated on Wed Dec 9 20:32:41 2009 for xCalls by  doxygen 1.4.7