diff options
Diffstat (limited to 'testing/sg_tst_ioctl.c')
-rw-r--r-- | testing/sg_tst_ioctl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/testing/sg_tst_ioctl.c b/testing/sg_tst_ioctl.c index 180db0a1..e7127597 100644 --- a/testing/sg_tst_ioctl.c +++ b/testing/sg_tst_ioctl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 D. Gilbert + * Copyright (C) 2018-2019 D. Gilbert * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) @@ -23,6 +23,8 @@ #include <sys/socket.h> /* For passing fd_s via Unix sockets */ +#ifndef HAVE_LINUX_SG_V4_HDR + /* Kernel uapi header contain __user decorations on user space pointers * to indicate they are unsafe in the kernel space. However glibc takes * all those __user decorations out from headers in /usr/include/linux . @@ -38,16 +40,20 @@ #include "uapi_sg.h" /* local copy of include/uapi/scsi/sg.h */ +#else +#define __user +#endif /* end of: ifndef HAVE_LINUX_SG_V4_HDR */ + #include "sg_lib.h" #include "sg_io_linux.h" #include "sg_linux_inc.h" #include "sg_pr2serr.h" -/* This program tests ioctl() calls added and modified in version 3.9 and +/* This program tests ioctl() calls added and modified in version 4.0 and * later of the Linux sg driver. */ -static const char * version_str = "Version: 1.01 20181216"; +static const char * version_str = "Version: 1.02 20190106"; #define INQ_REPLY_LEN 96 #define INQ_CMD_LEN 6 @@ -104,7 +110,7 @@ usage(void) " -w write (submit) only then exit\n"); } -/* This function taken from Keith Parkard's blog dated 2101205 */ +/* This function taken from Keith Parkard's blog dated 20121005 */ static ssize_t sock_fd_write(int sock, const void *buf, ssize_t buflen, int fd) { |