RFR: JDK-8001619: Remove usage of _ALLBSD_SOURCE in bsd files

Staffan Larsen staffan.larsen at oracle.com
Mon Oct 29 05:40:44 PDT 2012


I agree that the usage of __APPLE__ and _ALLBSD_SOURCE is confusing. I've assumed that _ALLBSD_SOURCE is always defined in the src/os/bsd folders, but that __APPLE__ is not always defined there (or at least that there exists forks where it makes sense for __APPLE__ not be defined).

/Staffan 

On 29 okt 2012, at 12:23, David Holmes <David.Holmes at oracle.com> wrote:

> On 29/10/2012 7:30 PM, Staffan Larsen wrote:
>> Here's a version with the zero changes as well: http://cr.openjdk.java.net/~sla/8001619/webrev.02/
>> 
>> If it looks good, I'll push this version instead.
> 
> Some of the conditionals are puzzling to me given this was all done for the MacOSX port:
> 
> 326 #ifdef __APPLE__
> ...
> 331 #elif defined(__OpenBSD__)
> ...
> 342 #elif defined(_ALLBSD_SOURCE)
> ...
> 
> I would have expected __APPLE__ to always be defined (else it is redundant everywhere else!), but then that would preclude the _ALLBSD_SOURCE code from being used.
> 
> Maybe it is best to leave this after all - sorry :(
> 
> David
> 
> 
> 
>> /Staffan
>> 
>> On 27 okt 2012, at 01:59, David Holmes<David.Holmes at oracle.com>  wrote:
>> 
>>> On 26/10/2012 10:03 PM, Staffan Larsen wrote:
>>>> Oh... and new webrev at: http://cr.openjdk.java.net/~sla/8001619/webrev.01/
>>> 
>>> Thumbs up.
>>> 
>>> But for completeness I would have liked to see the zero code cleaned up too. I'm not sure how the contact is. I'm tempted to say do it anyway as it seems simple enough and if it happens to break zero someone will shout and we do a fix. Otherwise the chances that this cleanup will get applied to the zero code seem very low.
>>> 
>>> David
>>> 
>>>> 
>>>> On 26 okt 2012, at 13:58, Staffan Larsen<staffan.larsen at oracle.com
>>>> <mailto:staffan.larsen at oracle.com>>  wrote:
>>>> 
>>>>> 
>>>>> On 26 okt 2012, at 13:35, David Holmes<David.Holmes at oracle.com
>>>>> <mailto:David.Holmes at oracle.com>>  wrote:
>>>>> 
>>>>>> On 26/10/2012 8:47 PM, Staffan Larsen wrote:
>>>>>>> This is an attempt at cleaning up the source in src/os/bsd by
>>>>>>> removing the usage of _ALLBSD_SOURCE in these files. Since the
>>>>>>> define is always set when compiling these files it is not necessary
>>>>>>> to use it in the source files. The usage was originally added during
>>>>>>> the porting to make it easier to see changes against the base linux
>>>>>>> version.
>>>>>>> 
>>>>>>> http://cr.openjdk.java.net/~sla/8001619/webrev.00/
>>>>>> 
>>>>>> Generally looks okay (though now I see some of the actual BSD code it
>>>>>> makes me a little nervous!). A couple of minor things:
>>>>> 
>>>>> Thanks.
>>>>> 
>>>>>> 
>>>>>> os_bsd.cpp:
>>>>>> 
>>>>>> 977 }
>>>>>> 978 #elif
>>>>>> 
>>>>>> 3957 return true;
>>>>>> 3958 #elif
>>>>>> 3959 return false;
>>>>>> 
>>>>>> Shouldn't the elif's have become an else?
>>>>>> 
>>>>>> Ditto for os_bsd_x86.cpp:
>>>>>> 
>>>>>> 850 #elif
>>>>> 
>>>>> You are right. I've fixed this.
>>>>> 
>>>>>> Also you can probably do the same thing for bsd_zero:
>>>>>> /src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp. Just check with the zero folk.
>>>>> 
>>>>> I didn't touch the zero files since I wasn't sure who maintains it.
>>>>> I'm not sure how to build it so I didn't want to do changes.
>>>>> 
>>>>> /Staffan
>>>>> 
>>>>> 
>>>>>> 
>>>>>> David
>>>>>> -----
>>>>>> 
>>>>>>> Thanks,
>>>>>>> /Staffan
>>>>> 
>>>> 
>> 



More information about the hotspot-dev mailing list