Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 10 May 2013 7:24:04 -0400
From:  <jfoug@....net>
To: john-dev@...ts.openwall.com
Subject: os.h usage

Shouldn't we add to this?  I think another area where there is a lot of OS dependent stuff, is in includes.

I was just wondering if the os.h file is 'open' for modifications?  There already is one issue that I know of in the os.h. That is in the FLOCK section.  The whole flock section should be wrapped with a #if defined (_MSC_VER)  setting OS_FLOCK to 0 for it.  There is no <sys/file.h> for VC

But I think a lot of the very ugliness in the #include block, can be hidden with 'less' ugly defines.

So instead of:

#if !defined (_MSC_VER) && !defined (__MINGW32__) && !defined (__SOME_OTHER_OS__)
#include <somefile.h>
#endif

We could have:

#if HAS_SOMEFILE_H
#include <somefile.h>
#endif

Then set the HAS_SOMEFILE_H in os.h using the OS specific defines.

Still not the most elegant, but at least it hides some of the ugliness.


Also, I am really not sold on the 'NEEDS_OS_TIMER', 'NEEDS_OS_FLOCK', .....  Would it not be better to simply set all of the defined constants, whenever os.h is loaded? 

Jim.

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ