src/xcalls/x_dup.c File Reference

x_dup implementation. More...

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

Go to the source code of this file.

Classes

struct  x_dup_undo_args_s

Typedefs

typedef x_dup_undo_args_s x_dup_undo_args_t

Functions

int XCALL_DEF() x_dup (int oldfd, int *result)
 Duplicates a file descriptor.


Detailed Description

x_dup implementation.

Definition in file x_dup.c.


Function Documentation

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


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