src/xcalls/x_write.c File Reference

x_write_seq, x_write_ignore, x_write_ovr 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_write_undo_args_s

Defines

#define TXC_WRITE_SEQ   0x1
#define TXC_WRITE_OVR_SAVE   0x2
#define TXC_WRITE_OVR_IGNORE   0x3

Typedefs

typedef x_write_undo_args_s x_write_undo_args_t

Functions

ssize_t XCALL_DEF() x_write_seq (int fd, const void *buf, size_t nbyte, int *result)
 Write appends to a file.
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_ovr_save (int fd, const void *buf, size_t nbyte, int *result)
 Alias of x_write_ovr.
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.


Detailed Description

x_write_seq, x_write_ignore, x_write_ovr implementation.

Definition in file x_write.c.


Function Documentation

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_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