dosfstools  4.2
About: dosfstools are utilities to create, check and label (MS-DOS) FAT filesystems.
  Fossies Dox: dosfstools-4.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

blkdev.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include "blkdev.h"
#include "linux_version.h"
Include dependency graph for blkdev.c:

Go to the source code of this file.

Functions

static long blkdev_valid_offset (int fd, off_t offset)
 
int is_blkdev (int fd)
 
off_t blkdev_find_size (int fd)
 
int blkdev_get_size (int fd, unsigned long long *bytes)
 
int blkdev_get_sectors (int fd, unsigned long long *sectors)
 
int blkdev_get_sector_size (int fd, int *sector_size)
 
int blkdev_get_physector_size (int fd, int *sector_size)
 
int blkdev_is_misaligned (int fd)
 
int blkdev_is_cdrom (int fd)
 
int blkdev_get_geometry (int fd, unsigned int *h, unsigned int *s)
 
int blkdev_get_start (int fd, dev_t rdev, unsigned long long *s)
 
const char * blkdev_scsi_type_to_name (int type)
 

Function Documentation

◆ blkdev_find_size()

off_t blkdev_find_size ( int  fd)

Definition at line 56 of file blkdev.c.

References blkdev_valid_offset(), and fd.

Referenced by blkdev_get_size().

◆ blkdev_get_geometry()

int blkdev_get_geometry ( int  fd,
unsigned int *  h,
unsigned int *  s 
)

Definition at line 288 of file blkdev.c.

References fd, hd_geometry::heads, and hd_geometry::sectors.

Referenced by get_block_geometry().

◆ blkdev_get_physector_size()

int blkdev_get_physector_size ( int  fd,
int *  sector_size 
)

Definition at line 231 of file blkdev.c.

References DEFAULT_SECTOR_SIZE, fd, and sector_size.

◆ blkdev_get_sector_size()

int blkdev_get_sector_size ( int  fd,
int *  sector_size 
)

Definition at line 204 of file blkdev.c.

References DEFAULT_SECTOR_SIZE, fd, and sector_size.

Referenced by get_sector_size().

◆ blkdev_get_sectors()

int blkdev_get_sectors ( int  fd,
unsigned long long *  sectors 
)

Definition at line 186 of file blkdev.c.

References blkdev_get_size(), and fd.

◆ blkdev_get_size()

int blkdev_get_size ( int  fd,
unsigned long long *  bytes 
)

Definition at line 86 of file blkdev.c.

References blkdev_find_size(), fd, get_linux_version(), and KERNEL_VERSION.

Referenced by blkdev_get_sectors(), and get_block_device_size().

◆ blkdev_get_start()

int blkdev_get_start ( int  fd,
dev_t  rdev,
unsigned long long *  s 
)

Definition at line 323 of file blkdev.c.

References fd, and hd_geometry::start.

Referenced by get_block_geometry().

◆ blkdev_is_cdrom()

int blkdev_is_cdrom ( int  fd)

Definition at line 265 of file blkdev.c.

References fd.

◆ blkdev_is_misaligned()

int blkdev_is_misaligned ( int  fd)

Definition at line 247 of file blkdev.c.

References fd.

◆ blkdev_scsi_type_to_name()

◆ blkdev_valid_offset()

static long blkdev_valid_offset ( int  fd,
off_t  offset 
)
static

Definition at line 39 of file blkdev.c.

References fd.

Referenced by blkdev_find_size().

◆ is_blkdev()

int is_blkdev ( int  fd)

Definition at line 49 of file blkdev.c.

References fd.