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

_______________________________________________
openindiana-discuss mailing list
[email protected]
https://openindiana.org/mailman/listinfo/openindiana-discuss

Reply via email to