- Fix to include sys/ioctl.h.
- Define the ioctls we use if they are not defined, as it is done in device.c. (Logical change 1.336)edge.strict_endians
parent
ba5eb0d651
commit
60231ba412
|
@ -18,6 +18,7 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
# include <sys/vfs.h>
|
||||
#endif
|
||||
|
@ -41,6 +42,13 @@
|
|||
#include "runlist.h"
|
||||
#include "utils.h"
|
||||
|
||||
#if defined(linux) && defined(_IO) && !defined(BLKGETSIZE)
|
||||
#define BLKGETSIZE _IO(0x12,96) /* Get device size in 512-byte blocks. */
|
||||
#endif
|
||||
#if defined(linux) && defined(_IOR) && !defined(BLKGETSIZE64)
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* Get device size in bytes. */
|
||||
#endif
|
||||
|
||||
static const char *EXEC_NAME = "ntfsclone";
|
||||
|
||||
struct {
|
||||
|
@ -910,7 +918,7 @@ static s64 device_size_get(int fd)
|
|||
Dprintf("BLKGETSIZE64 nr bytes = %llu (0x%llx)\n",
|
||||
(unsigned long long)size,
|
||||
(unsigned long long)size);
|
||||
return (s64)size / block_size;
|
||||
return (s64)size;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue