1 --- ghex-46.1/meson.build.orig
2 +++ ghex-46.1/meson.build
9 foreach h : check_headers_direct
10 cc.has_header(h, required: true)
11 --- ghex-46.1/src/hex-buffer-direct.h.orig
12 +++ ghex-46.1/src/hex-buffer-direct.h
16 #include <sys/ioctl.h>
21 +#include <sys/dkio.h>
22 +#include <sys/vtoc.h>
27 --- ghex-46.1/src/hex-buffer-direct.c.orig
28 +++ ghex-46.1/src/hex-buffer-direct.c
31 gint64 block_file_size;
34 if (ioctl (tmp_fd, BLKGETSIZE64, &block_file_size) != 0)
36 set_error (self, _("Error attempting to read block device"));
41 + struct dk_minfo dkmp;
43 + if (ioctl (tmp_fd, DKIOCGMEDIAINFO, &dkmp) != 0)
45 + set_error (self, _("Error attempting to read block device"));
48 + block_file_size = dkmp.dki_capacity * dkmp.dki_lbsize;
50 bytes = block_file_size;