Skip to content

Commit

Permalink
Merge pull request #9 from djs55/64bit
Browse files Browse the repository at this point in the history
Fix the build on x86_64
  • Loading branch information
andreil committed Jun 26, 2012
2 parents 6308041 + 3b6897f commit e43e8a6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions vhd/lib/libvhdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,18 +1425,26 @@ __lxstat64(int version, const char *path, struct stat64 *buf)
return ret;
}

#ifdef __x86_64__
#define IOCTL_REQUEST long long
#define IOCTL_REQUEST_FMT "%Lx"
#else
#define IOCTL_REQUEST int
#define IOCTL_REQUEST_FMT "%x"
#endif

int
ioctl(int fd, int request, char *argp)
ioctl(int fd, IOCTL_REQUEST request, char *argp)
{
vhd_fd_context_t *vhd_fd;
static int (*_std_ioctl)(int, int, char *);
static int (*_std_ioctl)(int, IOCTL_REQUEST, char *);

_RESOLVE(_std_ioctl);
vhd_fd = _libvhd_io_map_get(fd);
if (!vhd_fd)
return _std_ioctl(fd, request, argp);

LOG("%s 0x%x 0x%x %p\n", __func__, fd, request, argp);
LOG("%s 0x%x 0x" IOCTL_REQUEST_FMT " %p\n", __func__, fd, request, argp);

#ifdef BLKGETSIZE64
if (request == BLKGETSIZE64) {
Expand Down

0 comments on commit e43e8a6

Please sign in to comment.