src/xcalls/x_lseek.c File Reference

x_lseek 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/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_lseek_undo_args_s

Typedefs

typedef x_lseek_undo_args_s x_lseek_undo_args_t

Functions

off_t XCALL_DEF() x_lseek (int fd, off_t offset, int whence, int *result)
 Repositions read/write file offset.


Detailed Description

x_lseek implementation.

Definition in file x_lseek.c.


Function Documentation

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


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