Re: [PATCH 2 of 2] make _IO macros available on Solaris

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 17, 2011 at 10:00:35PM +0100, Fabian Groffen wrote:
> The _IO macro is defined in sys/ioccom.h on various platforms.  However,
> on Solaris it isn't included by ioctl.h, so include it explicitly if
> available.
> 
> Signed-off-by: Fabian Groffen <grobian@xxxxxxxxxx>
> 
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -129,6 +129,7 @@
>  	sys/disk.h \
>  	sys/disklabel.h \
>  	sys/ioctl.h \
> +	sys/ioccom.h \
>  	sys/io.h \
>  	sys/time.h \
>  	sys/mkdev.h \
> diff --git a/include/blkdev.h b/include/blkdev.h
> --- a/include/blkdev.h
> +++ b/include/blkdev.h
> @@ -1,8 +1,15 @@
>  #ifndef BLKDEV_H
>  #define BLKDEV_H
>  
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif

 it seems unnecessary, config.h is always included by 
 
    gcc ... -include config.h

 for all compiled files.

> +#ifdef HAVE_SYS_IOCCOM_H
> +#include <sys/ioccom.h> /* for _IO macro on e.g. Solaris */
> +#endif
>  #include <fcntl.h>
>  #include <unistd.h>
>  
> diff --git a/shlibs/blkid/src/topology/evms.c b/shlibs/blkid/src/topology/evms.c
> --- a/shlibs/blkid/src/topology/evms.c
> +++ b/shlibs/blkid/src/topology/evms.c
> @@ -16,6 +16,9 @@
>  #include <stdlib.h>
>  #include <string.h>
>  #include <sys/ioctl.h>
> +#ifdef HAVE_SYS_IOCCOM_H
> +#include <sys/ioccom.h>
> +#endif

 again, it would be better to resolve all portability issues in
 blkdev.h only.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux