src/xcalls/xcalls.h File Reference

xCalls' declarations. More...

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

Go to the source code of this file.

Defines

#define XCALL_DEF(xcall)   _TXC_##xcall
#define _XCALL(xcall)   _TXC_##xcall

Functions

int XCALL_DEF() x_close (int fildes, int *result)
 Closes a file descriptor.
int XCALL_DEF() x_create (const char *, mode_t, int *)
 Creates a file.
int XCALL_DEF() x_dup (int oldfd, int *result)
 Duplicates a file descriptor.
int XCALL_DEF() x_fsync (int fildes, int *result)
 Synchronizes a file in-core state with storage device.
off_t XCALL_DEF() x_lseek (int fd, off_t offset, int whence, int *result)
 Repositions read/write file offset.
int XCALL_DEF() x_open (const char *pathname, int flags, mode_t mode, int *result)
 Opens a file.
int XCALL_DEF() x_pipe (int fildes[2], int *result)
 Creates a pipe.
int XCALL_DEF() x_printf (const char *format,...)
 Formatted output conversion.
int XCALL_DEF() x_pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg, int *result)
 Creates a thread.
int XCALL_DEF() x_pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr, int *result)
int XCALL_DEF() x_pthread_mutex_lock (pthread_mutex_t *mutex, int *result)
 Locks a mutex.
int XCALL_DEF() x_pthread_mutex_unlock (pthread_mutex_t *mutex, int *result)
 Unlocks a mutex.
ssize_t XCALL_DEF() x_read (int fd, void *buf, size_t nbyte, int *result)
 Reads from a file.
ssize_t XCALL_DEF() x_read_pipe (int fd, void *buf, size_t nbyte, int *result)
 Reads from a pipe.
ssize_t XCALL_DEF() x_recvmsg (int s, struct msghdr *msg, int flags, int *result)
 Receives a message from a socket.
int XCALL_DEF() x_rename (const char *oldpath, const char *newpath, int *result)
 Changes the name or location of a file.
int XCALL_DEF() x_socket (int domain, int type, int protocol, int *result)
 Creates an endpoint for communication.
ssize_t XCALL_DEF() x_write_ovr (int fd, const void *buf, size_t nbyte, int *result)
 Writes to a file, while it saves any overwritten data.
ssize_t XCALL_DEF() x_write_ovr_save (int fd, const void *buf, size_t nbyte, int *result)
 Alias of x_write_ovr.
ssize_t XCALL_DEF() x_write_ovr_ignore (int fd, const void *buf, size_t nbyte, int *result)
 Writes to a file without saving any overwritten data.
ssize_t XCALL_DEF() x_write_pipe (int fd, const void *buf, size_t nbyte, int *result)
 Writes to a pipe.
ssize_t XCALL_DEF() x_sendmsg (int fd, const struct msghdr *msg, int flags, int *result)
 Sends a message to a socket.
ssize_t XCALL_DEF() x_write_seq (int fd, const void *buf, size_t nbyte, int *result)
 Write appends to a file.
int XCALL_DEF() x_unlink (const char *pathname, int *result)
 Deletes a name and possibly the file it refers to.


Detailed Description

xCalls' declarations.

The error codes returned by xCalls are the ones returned by the corresponding system call.

Todo:
Implement x_send by reusing code of x_sendmsg.

Implement x_recv by reusing code of x_recvmsg.

Definition in file xcalls.h.


Function Documentation

int XCALL_DEF() x_close ( int  fildes,
int *  result 
)

Closes a file descriptor.

Execution : deferred

Asynchronous failures: commit

Parameters:
[in] fildes File descriptor.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 74 of file x_close.c.

References x_close_commit_args_s::fd, x_close_commit_args_s::koa, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, TXC_KOA_DESTROY_COMMIT_ACTION_ORDER, txc_koa_detach_fd(), txc_koa_get_sentinel(), txc_koa_lock_alias_cache(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), and x_close().

int XCALL_DEF() x_create ( const char *  pathname,
mode_t  mode,
int *  result 
)

Creates a file.

Creates a file using the creation flags: O_CREAT| O_NOCTTY| O_TRUNC| O_RDWR. If a file already exists then it is renamed and removed if transaction finally commits.

Execution : in-place

Asynchronous failures : commit, abort

Parameters:
[in] pathname Path to the file to be created.
[in] mode Permissions.
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 150 of file x_create.c.

References x_create_case2_commit_undo_args_s::fd, x_create_case1_commit_undo_args_s::fd, x_create_case2_commit_undo_args_s::koa, x_create_case1_commit_undo_args_s::koa, x_create_case2_commit_undo_args_s::original_pathname, x_create_case1_commit_undo_args_s::pathname, x_create_case2_commit_undo_args_s::temp_pathname, TXC_ASSERT, txc_buffer_linear_malloc(), TXC_DEBUG_PRINT, TXC_DEBUG_XCALL, txc_g_koamgr, TXC_INTERNALERROR, txc_koa_alias_cache_lookup_inode(), txc_koa_attach_fd(), txc_koa_create(), TXC_KOA_CREATE_COMMIT_ACTION_ORDER, TXC_KOA_CREATE_UNDO_ACTION_ORDER, txc_koa_get_sentinel(), TXC_KOA_IS_FILE, txc_koa_lock_alias_cache(), txc_koa_lock_fd(), txc_koa_lock_fds_refby_koa(), txc_koa_path2inode(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fd(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_NOTEXISTS, TXC_R_SUCCESS, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), txc_tx_register_undo_action(), and x_create().

int XCALL_DEF() x_dup ( int  oldfd,
int *  result 
)

Duplicates a file descriptor.

The new file descriptor shares the sentinels of the original file descriptor.

Execution : in-place

Asynchronous failures: abort

Parameters:
[in] oldfd The original file descriptor to be duplicated.
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 67 of file x_dup.c.

References x_dup_undo_args_s::fd, x_dup_undo_args_s::koa, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_attach_fd(), txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lock_fds_refby_koa(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), TXC_TX_REGULAR_UNDO_ACTION_ORDER, and x_dup().

int XCALL_DEF() x_fsync ( int  fildes,
int *  result 
)

Synchronizes a file in-core state with storage device.

Execution : deferred

Asynchronous failures : commit

Parameters:
[in] fildes The file's file descriptor.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 78 of file x_fsync.c.

References x_fsync_commit_args_s::fd, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), TXC_TX_REGULAR_COMMIT_ACTION_ORDER, and x_fsync().

off_t XCALL_DEF() x_lseek ( int  fd,
off_t  offset,
int  whence,
int *  result 
)

Repositions read/write file offset.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] fd File descriptor.
[in] offset The new offset relative to whence.
[in] whence The absolute offset that the file offset is relatively repositioned to.
  • SEEK_SET: The offset is set to offset bytes.
  • SEEK_CUR: The offset is set to its current location plus offset bytes.
  • SEEK_END: The offset is set to the size of the file plus offset bytes.
[out] result Where to store any asynchronous failures.
Returns:
The resulting offset location as measured in bytes from the beginning of the file on success, or (off_t) -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 72 of file x_lseek.c.

References x_lseek_undo_args_s::fd, x_lseek_undo_args_s::old_position, txc_buffer_linear_free(), txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), TXC_TX_REGULAR_UNDO_ACTION_ORDER, and x_lseek().

int XCALL_DEF() x_open ( const char *  pathname,
int  flags,
mode_t  mode,
int *  result 
)

Opens a file.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] pathname 
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 69 of file x_open.c.

References x_open_undo_args_s::fd, x_open_undo_args_s::koa, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_alias_cache_lookup_inode(), txc_koa_attach_fd(), txc_koa_create(), TXC_KOA_CREATE_UNDO_ACTION_ORDER, txc_koa_detach_fd(), txc_koa_get_sentinel(), TXC_KOA_IS_FILE, txc_koa_lock_alias_cache(), txc_koa_lock_fd(), txc_koa_lock_fds_refby_koa(), txc_koa_path2inode(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fd(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_SUCCESS, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), and x_open().

int XCALL_DEF() x_pipe ( int  fildes[2],
int *  result 
)

Creates a pipe.

Creates a pair of file descriptors, pointing to a pipe inode.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in,out] fildes Array where to place the new file descriptors.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 79 of file x_pipe.c.

References x_pipe_undo_args_s::fd, x_pipe_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_PIPE_READ_END, TXC_KOA_IS_PIPE_WRITE_END, 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_pipe().

int XCALL_DEF() x_printf ( const char *  format,
  ... 
)

Formatted output conversion.

Execution : deferred

Asynchronous failures : abort

Parameters:
[out] result Where to store any asynchronous failures.
Returns:
The number of characters printed on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 24 of file x_printf.c.

References _XCALL, txc_stats_txstat_increment, txc_tx_get_txd(), x_printf(), and x_write_pipe().

int XCALL_DEF() x_pthread_create ( pthread_t *  thread,
const pthread_attr_t *  attr,
void *(*)(void *)  start_routine,
void *  arg,
int *  result 
)

Creates a thread.

Execution : in-place creation of the thread but deferred execution of the start_routine

Asynchronous failures : commit, abort

Parameters:
[out] thread The new thread's identifier.
[in] attr Creation attributes.
[in] start_routine The routine that the new thread executes.
[in] arg Parameter passed to start_routine
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 99 of file x_pthread_create.c.

References x_pthread_create_control_block_s::arg, MALLOC, x_pthread_create_control_block_s::start, x_pthread_create_control_block_s::start_lock, txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), txc_tx_register_undo_action(), TXC_TX_REGULAR_COMMIT_ACTION_ORDER, and TXC_TX_REGULAR_UNDO_ACTION_ORDER.

int XCALL_DEF() x_pthread_mutex_lock ( pthread_mutex_t *  mutex,
int *  result 
)

Locks a mutex.

It safely locks a mutex by releasing the lock if the transaction aborts.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] mutex The mutex to lock.
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 52 of file x_pthread_mutex_lock.c.

References x_undo_args_s::mutex, txc_buffer_linear_malloc(), TXC_INTERNALERROR, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), and TXC_TX_REGULAR_UNDO_ACTION_ORDER.

int XCALL_DEF() x_pthread_mutex_unlock ( pthread_mutex_t *  mutex,
int *  result 
)

Unlocks a mutex.

It safely unlocks a mutex by releasing the lock when the transaction commits.

Execution : deferred

Asynchronous failures : commit

Parameters:
[in] mutex The mutex to unlock.
[out] result Where to store any asynchronous failures.
Returns:
The new file descriptor on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 53 of file x_pthread_mutex_unlock.c.

References x_commit_args_s::mutex, txc_buffer_linear_malloc(), TXC_INTERNALERROR, txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), and TXC_TX_REGULAR_COMMIT_ACTION_ORDER.

ssize_t XCALL_DEF() x_read ( int  fd,
void *  buf,
size_t  nbyte,
int *  result 
)

Reads from a file.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] fd The file descriptor of the file to read from.
[in] buf The buffer where to store read data.
[in] nbyte The number of bytes to read.
[out] result Where to store any asynchronous failures.
Returns:
The number of read bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 65 of file x_read.c.

References x_read_undo_args_s::fd, x_read_undo_args_s::nbyte, txc_buffer_linear_free(), txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_undo_action(), TXC_TX_REGULAR_UNDO_ACTION_ORDER, and x_read().

ssize_t XCALL_DEF() x_read_pipe ( int  fd,
void *  buf,
size_t  nbyte,
int *  result 
)

Reads from a pipe.

The xCall buffers any read data so that in case of transaction abort read data are not consumed but stay present for the next pipe read.

Execution : in-place

Asynchronous failures : commit, abort

Parameters:
[in] fd The file descriptor of the pipe's read end.
[in] buf The buffer where to store read data.
[in] nbyte The number of bytes to read.
[out] result Where to store asynchronous failures.
Returns:
The number of read bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 257 of file x_read_pipe.c.

References TXC_INTERNALERROR, txc_tx_get_txd(), and txc_tx_get_xactstate().

ssize_t XCALL_DEF() x_recvmsg ( int  s,
struct msghdr *  msg,
int  flags,
int *  result 
)

Receives a message from a socket.

This xCall buffers any received data so that in case of transaction abort received data are not consumed but stay present for the next socket receive.

Execution : in-place

Asynchronous failures : commit, abort

Parameters:
[in] fd The file descriptor of the socket.
[in] msg Where to store the received message.
[in] flags See man recvmsg.
[out] result Where to store any asynchronous failures. failure occurred (in which case, errno is set appropriately).
Todo:
Find which flags of recvmsg can be used with x_recvmsg?

Definition at line 341 of file x_recvmsg.c.

References TXC_INTERNALERROR, txc_tx_get_txd(), and txc_tx_get_xactstate().

int XCALL_DEF() x_rename ( const char *  oldpath,
const char *  newpath,
int *  result 
)

Changes the name or location of a file.

If a file at the new location exists, then it is renamed to a temporary file and removed only when the transaction commits. This allows restoring the file in case the transaction aborts.

Execution : in-place

Asynchronous failures : commit, abort

Parameters:
[in] oldpath The old location of the file.
[in] oldpath The new location of the file.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 124 of file x_rename.c.

References x_rename_commit_undo_args_s::newpath, x_rename_commit_undo_args_s::newpath_koa, x_rename_commit_undo_args_s::newpath_koa_is_valid, x_rename_commit_undo_args_s::oldpath, x_rename_commit_undo_args_s::oldpath_koa, x_rename_commit_undo_args_s::temppath, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_alias_cache_lookup_inode(), txc_koa_attach(), txc_koa_create(), TXC_KOA_CREATE_COMMIT_ACTION_ORDER, TXC_KOA_CREATE_UNDO_ACTION_ORDER, txc_koa_detach(), txc_koa_get_sentinel(), TXC_KOA_IS_FILE, txc_koa_lock_alias_cache(), txc_koa_lock_fds_refby_koa(), txc_koa_path2inode(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_SUCCESS, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), txc_tx_register_undo_action(), and x_rename().

ssize_t XCALL_DEF() x_sendmsg ( int  fd,
const struct msghdr *  msg,
int  flags,
int *  result 
)

Sends a message to a socket.

Execution : deferred

Asynchronous failures : commit

Parameters:
[in] fd The file descriptor of the socket.
[in] msg The message to send.
[in] flags See man sendmsg.
[out] result Where to store any asynchronous failures.
Returns:
The number of sent characters on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).
Todo:
Find which flags of sendmsg can be used with x_sendmsg?

Definition at line 68 of file x_sendmsg.c.

References x_sendmsg_commit_args_s::fd, x_sendmsg_commit_args_s::flags, x_sendmsg_commit_args_s::msg, txc_buffer_linear_free(), txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), TXC_TX_REGULAR_COMMIT_ACTION_ORDER, and x_sendmsg().

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().

int XCALL_DEF() x_unlink ( const char *  pathname,
int *  result 
)

Deletes a name and possibly the file it refers to.

Execution : deferred

Asynchronous failures : commit

Parameters:
[in] pathname The location of the file.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 76 of file x_unlink.c.

References x_unlink_commit_args_s::koa, x_unlink_commit_args_s::pathname, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_alias_cache_lookup_inode(), txc_koa_attach(), txc_koa_create(), TXC_KOA_DESTROY_COMMIT_ACTION_ORDER, txc_koa_detach(), txc_koa_get_sentinel(), TXC_KOA_IS_FILE, txc_koa_lock_alias_cache(), txc_koa_lock_fds_refby_koa(), txc_koa_path2inode(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_SUCCESS, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), and x_unlink().

ssize_t XCALL_DEF() x_write_ovr ( int  fd,
const void *  buf,
size_t  nbyte,
int *  result 
)

Writes to a file, while it saves any overwritten data.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] fd The file descriptor of the file.
[in] buf The buffer that has the data to be written.
[in] nbyte The number of bytes to write.
[out] result Where to store any asynchronous failures.
Returns:
The number of written bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 326 of file x_write.c.

References TXC_WRITE_OVR_SAVE.

ssize_t XCALL_DEF() x_write_ovr_ignore ( int  fd,
const void *  buf,
size_t  nbyte,
int *  result 
)

Writes to a file without saving any overwritten data.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] fd The file descriptor of the file.
[in] buf The buffer that has the data to be written.
[in] nbyte The number of bytes to write.
[out] result Where to store any asynchronous failures.
Returns:
The number of written bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 295 of file x_write.c.

References TXC_WRITE_OVR_IGNORE.

ssize_t XCALL_DEF() x_write_pipe ( int  fd,
const void *  buf,
size_t  nbyte,
int *  result 
)

Writes to a pipe.

Execution : deferred

Asynchronous failures : commit

Parameters:
[in] fd The file descriptor of the pipe's write end.
[in] buf The buffer that has the data to write.
[in] nbyte The number of bytes to write.
[out] result Where to store any asynchronous failures.
Returns:
The number of written bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 65 of file x_write_pipe.c.

References x_write_commit_args_s::buf, x_write_commit_args_s::fd, x_write_commit_args_s::nbyte, txc_buffer_linear_free(), txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_get_sentinel(), txc_koa_lock_fd(), txc_koa_lookup_fd2koa(), txc_koa_unlock_fd(), TXC_R_BUSYSENTINEL, TXC_R_FAILURE, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), TXC_TX_REGULAR_COMMIT_ACTION_ORDER, and x_write_pipe().

ssize_t XCALL_DEF() x_write_seq ( int  fd,
const void *  buf,
size_t  nbyte,
int *  result 
)

Write appends to a file.

Execution : in-place

Asynchronous failures : abort

Parameters:
[in] fd The file descriptor of the file.
[in] buf The buffer that has the data to be written.
[in] nbyte The number of bytes to write.
[out] result Where to store any asynchronous failures.
Returns:
The number of written bytes on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 274 of file x_write.c.

References TXC_WRITE_SEQ.


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