This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

unistd.h ifdefs on OS


Hi

In looking at unistd.h for the next restrict patch,
I noticed blocks like this:

#if defined(__CYGWIN__) || defined(__rtems__)
int     _EXFUN(setegid, (gid_t __gid ));
int     _EXFUN(seteuid, (uid_t __uid ));
#endif

These are POSIX methods which are not specific to RTEMS
or Cygwin. We just happen to be two targets that support
them.

In other cases, newlib prototypes methods with no concern
whether they are implemented or not.

I know this was done historically but is there any reason
non-OS specific POSIX methods like these should be wrapped
by OS specific conditionals?

I rather like the idea of having POSIX .h files with methods
for which an implementation may not have the body. It avoids
a lot of unnecessary and ugly conditionals.

Comments? Thoughts?

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]