<AWT Dev> Request for review - change two include header files according to POSIX.1-2008

Charles Lee littlee at linux.vnet.ibm.com
Wed Oct 12 00:52:50 PDT 2011


On 10/12/2011 03:36 PM, David Holmes wrote:
> On 12/10/2011 5:23 PM, Charles Lee wrote:
>> On 10/12/2011 03:12 PM, David Holmes wrote:
>>> On 12/10/2011 4:26 PM, Charles Lee wrote:
>>>> sys/unistd.h, sys/fcntl.h are not supported in AIX. And according 
>>>> to the
>>>> POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699919799/), I 
>>>> have
>>>> changed them to unistd.h and fcntl.h. The patch has been tested on 
>>>> both
>>>> linux and aix.
>>>>
>>>> I also change the header file in solaris, though I do not have a 
>>>> solaris
>>>> machine on the hand. Hope it will not break the build :-)
>>>
>>> unistd.h and fcntl.h are already used extensively on Solaris
>>>
>>>> The patch and webrev has been attached.
>>>
>>> Looks like they were stripped of the email. (And of the second 
>>> attempt.)
>>>
>>> By grepping I assume the splashscreen_config.h file is one place this
>>> was fixed for unistd.h. It is interesting to note that in some cases
>>> at least (eg splashscreen_sys.c) the C file includes <unistd.h> anyway.
>>
>> Yes. Only splashscreen_config.h has <sys/unistd.h>
>
> Ok. I've cc'ed awt-dev as this is awt code.
>
>>>
>>> We'll need to verify the changes for <sys/fcntl.h> in the
>>> genUnixConstants code. There tends to be a reason (often historical
>>> and possibly no longer applicable) for using the sys variants (though
>>> sometimes it was just that the non-sys version didn't exist at some
>>> point in time).
>>>
>>
>> By grep, only genUnixConstants.c and genSolarisConstants.c use
>> <sys/fcntl.h> in the jdk repository. And more than 20 files use 
>> <fcntl.h>
>
> Yep. And the fcntl manpage on Solaris says to #include <unistd.h> and 
> <fcntl.h> - so I think we're okay there. I suspect Solaris 8 may be a 
> different story but that's only an issue for JDK6.
>
> David
>
>>> Cheers,
>>> David Holmes
>>
>> Trying to attach a plain diff file again and again....
>>
> Patch inlined for AWT-dev folk to see.
>
> diff --git 
> src/solaris/native/sun/awt/splashscreen/splashscreen_config.h 
> src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
> index bb03165..e312c2b 100644
> --- src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
> +++ src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
> @@ -32,7 +32,7 @@
>  #include <X11/Xutil.h>
>  #include <X11/extensions/shape.h>
>  #include <sys/types.h>
> -#include <sys/unistd.h>
> +#include <unistd.h>
>  #include <pthread.h>
>  #include <signal.h>
>  #include <inttypes.h>
> diff --git src/solaris/native/sun/nio/fs/genSolarisConstants.c 
> src/solaris/native/sun/nio/fs/genSolarisConstants.c
> index df46398..346bfbb 100644
> --- src/solaris/native/sun/nio/fs/genSolarisConstants.c
> +++ src/solaris/native/sun/nio/fs/genSolarisConstants.c
> @@ -27,7 +27,7 @@
>  #include <errno.h>
>  #include <unistd.h>
>  #include <sys/acl.h>
> -#include <sys/fcntl.h>
> +#include <fcntl.h>
>  #include <sys/stat.h>
>
>  /**
> diff --git src/solaris/native/sun/nio/fs/genUnixConstants.c 
> src/solaris/native/sun/nio/fs/genUnixConstants.c
> index ea48d4d..56984a7 100644
> --- src/solaris/native/sun/nio/fs/genUnixConstants.c
> +++ src/solaris/native/sun/nio/fs/genUnixConstants.c
> @@ -26,7 +26,7 @@
>  #include <stdio.h>
>  #include <errno.h>
>  #include <unistd.h>
> -#include <sys/fcntl.h>
> +#include <fcntl.h>
>  #include <sys/stat.h>
>
>  /**
>
Wow. Thank you David.

-- 
Yours Charles




More information about the awt-dev mailing list