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)  

device_info.c File Reference
#include <limits.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
#include <unistd.h>
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "blkdev.h"
#include "device_info.h"
Include dependency graph for device_info.c:

Go to the source code of this file.

Functions

static void get_block_device_size (struct device_info *info, int fd)
 
static void get_block_geometry (struct device_info *info, int fd, dev_t rdev)
 
static void get_sector_size (struct device_info *info, int fd)
 
int get_device_info (int fd, struct device_info *info)
 
int is_device_mounted (const char *path)
 

Variables

static const struct device_info device_info_clueless
 
int device_info_verbose
 

Function Documentation

◆ get_block_device_size()

static void get_block_device_size ( struct device_info info,
int  fd 
)
static

Definition at line 71 of file device_info.c.

References blkdev_get_size(), fd, and device_info::size.

Referenced by get_device_info().

◆ get_block_geometry()

static void get_block_geometry ( struct device_info info,
int  fd,
dev_t  rdev 
)
static

◆ get_device_info()

int get_device_info ( int  fd,
struct device_info info 
)

◆ get_sector_size()

static void get_sector_size ( struct device_info info,
int  fd 
)
static

Definition at line 96 of file device_info.c.

References blkdev_get_sector_size(), fd, device_info::sector_size, and device_info::size.

Referenced by get_device_info().

◆ is_device_mounted()

int is_device_mounted ( const char *  path)

Definition at line 321 of file device_info.c.

Referenced by check_mount().

Variable Documentation

◆ device_info_clueless

const struct device_info device_info_clueless
static
Initial value:
= {
.type = TYPE_UNKNOWN,
.partition = -1,
.has_children = -1,
.geom_heads = -1,
.geom_sectors = -1,
.geom_start = -1,
.geom_size = -1,
.sector_size = -1,
.size = -1,
}
@ TYPE_UNKNOWN
Definition: device_info.h:5

Definition at line 1 of file device_info.c.

Referenced by get_device_info().

◆ device_info_verbose

int device_info_verbose

Definition at line 68 of file device_info.c.

Referenced by main().