[OpenIndiana-discuss] recompiling a program for openindiana

Alexander Pyhalov alp at rsu.ru
Mon Nov 20 08:01:46 UTC 2017


On 11/20/17 12:02 PM, Marc Lobelle wrote:
> Hello,
> 
> I am trying to recompile a program called srm (available on sourceforge 
> ) for openindiana. It works as rm but makes sure that there is no trace 
> of the destroyed file in the blocks of the free list.
> This program uses #if defined (__linux__) and  #if defined (__OpenBSD__) 
> and I should replace this code with something appropriate for openindiana.
> __linux__ etc are predifines preprocessor macros, presented in
> 
> https://sourceforge.net/p/predef/wiki/OperatingSystems/
> 
> However, I do not see openindiana in there, so what should I use ?
> 

Hello.
Well, we still pretend to be Solaris. So there's nothing better than
#if defined(__sun)

__sun__ seems to be GCC-specific and "sun" is not defined when using c99 
and later C standards.

The answer, which people like to give is 'test for features, not for 
operating system'. For example, illumos got pthread_attr_get_np() 
interface in 2016. So, you can't say if the current system, which you 
use to build software, has this specific feature without testing for it.
But I think it's not necessary the correct answer, more an attempt to 
hide an issue that there's no such thing as 'illumos releases/versions'.

-- 
Best regards,
Alexander Pyhalov,
system administrator of Southern Federal University IT department



More information about the openindiana-discuss mailing list