#include <stdio.h>
#include <unistd.h>
#include <ipc/bd.h>
#include <async.h>
#include <as.h>
#include <fibril_synch.h>
#include <devmap.h>
#include <sys/types.h>
#include <sys/typefmt.h>
#include <errno.h>
#include <bool.h>
#include <task.h>
#include <macros.h>
Go to the source code of this file.
Defines | |
#define | DEFAULT_BLOCK_SIZE 512 |
#define | NAME "file_bd" |
Functions | |
static void | file_bd_connection (ipc_callid_t iid, ipc_call_t *icall) |
static int | file_bd_init (const char *fname) |
static int | file_bd_read_blocks (uint64_t ba, size_t cnt, void *buf) |
Read blocks from the device. | |
static int | file_bd_write_blocks (uint64_t ba, size_t cnt, const void *buf) |
Write blocks to the device. | |
int | main (int argc, char **argv) |
static void | print_usage (void) |
Variables | |
static size_t | block_size |
static fibril_mutex_t | dev_lock |
static devmap_handle_t | devmap_handle |
static FILE * | img |
static aoff64_t | num_blocks |
Allows accessing a file as a block device. Useful for, e.g., mounting a disk image.
Definition in file file_bd.c.