File: arch-generic.c

package info (click to toggle)
diskscan 0.14.1-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 800 kB
  • ctags: 465
  • sloc: ansic: 3,696; sh: 3,565; python: 155; makefile: 41
file content (20 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "config.h"
#include "arch.h"

#include <sys/types.h>
#include <unistd.h>

#include "arch-posix.c"

int disk_dev_read_cap(disk_dev_t *dev, uint64_t *size_bytes, uint64_t *sector_size)
{
	off_t end = lseek(dev->fd, 0, SEEK_END);

	if (end == (off_t)-1)
		return -1;

	*size_bytes = end;
	*sector_size = 512;

	return 0;
}