cryptsetup  2.4.3
About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.
  Fossies Dox: cryptsetup-2.4.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

utils_io.c File Reference
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include "utils_io.h"
Include dependency graph for utils_io.c:

Go to the source code of this file.

Functions

static ssize_t _read_buffer (int fd, void *buf, size_t length, volatile int *quit)
 
ssize_t read_buffer (int fd, void *buf, size_t length)
 
ssize_t read_buffer_intr (int fd, void *buf, size_t length, volatile int *quit)
 
static ssize_t _write_buffer (int fd, const void *buf, size_t length, volatile int *quit)
 
ssize_t write_buffer (int fd, const void *buf, size_t length)
 
ssize_t write_buffer_intr (int fd, const void *buf, size_t length, volatile int *quit)
 
ssize_t write_blockwise (int fd, size_t bsize, size_t alignment, void *orig_buf, size_t length)
 
ssize_t read_blockwise (int fd, size_t bsize, size_t alignment, void *orig_buf, size_t length)
 
ssize_t write_lseek_blockwise (int fd, size_t bsize, size_t alignment, void *buf, size_t length, off_t offset)
 
ssize_t read_lseek_blockwise (int fd, size_t bsize, size_t alignment, void *buf, size_t length, off_t offset)
 

Function Documentation

◆ _read_buffer()

static ssize_t _read_buffer ( int  fd,
void *  buf,
size_t  length,
volatile int *  quit 
)
static

Definition at line 32 of file utils_io.c.

References quit.

Referenced by read_buffer(), and read_buffer_intr().

◆ _write_buffer()

static ssize_t _write_buffer ( int  fd,
const void *  buf,
size_t  length,
volatile int *  quit 
)
static

Definition at line 65 of file utils_io.c.

References quit.

Referenced by write_buffer(), and write_buffer_intr().

◆ read_blockwise()

ssize_t read_blockwise ( int  fd,
size_t  bsize,
size_t  alignment,
void *  orig_buf,
size_t  length 
)

Definition at line 150 of file utils_io.c.

References alignment(), NULL, and read_buffer().

Referenced by device_read_test(), LUKS_decrypt_from_storage(), and read_lseek_blockwise().

◆ read_buffer()

◆ read_buffer_intr()

ssize_t read_buffer_intr ( int  fd,
void *  buf,
size_t  length,
volatile int *  quit 
)

Definition at line 60 of file utils_io.c.

References _read_buffer(), and quit.

Referenced by tools_read_json_file().

◆ read_lseek_blockwise()

◆ write_blockwise()

ssize_t write_blockwise ( int  fd,
size_t  bsize,
size_t  alignment,
void *  orig_buf,
size_t  length 
)

Definition at line 98 of file utils_io.c.

References alignment(), NULL, read_buffer(), and write_buffer().

Referenced by LUKS_encrypt_to_storage(), wipe_block(), and write_lseek_blockwise().

◆ write_buffer()

ssize_t write_buffer ( int  fd,
const void *  buf,
size_t  length 
)

◆ write_buffer_intr()

ssize_t write_buffer_intr ( int  fd,
const void *  buf,
size_t  length,
volatile int *  quit 
)

Definition at line 93 of file utils_io.c.

References _write_buffer(), and quit.

Referenced by tools_write_json_file().

◆ write_lseek_blockwise()