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]

Re: Adding POSIX 1003.26 posix_devctl()


Hi Joel,

On Dec  1 10:13, Joel Sherrill wrote:
> Hi
> 
> I am starting to add posix_devctl() support to RTEMS.
> The POSIX 1003.26 standard defines only this single
> method and the requirements boil down to the following:
> 
> The posix_devctl() method is defined by POSIX 1003.26-2003. Aside
> from the single method, it adds the following requirements:
> 
> 1. define _POSIX_26_VERSION to 200312L
> 2. add _SC_POSIX_26_VERSION in unistd.h. Return _POSIX_26_VERSION
> 3. application must define _POSIX_26_C_SOURCE to use posix_devctl().
> 4. posix_devctl() is prototyped in <devctl.h>
> 5. provide implementation of posix_devctl().:)
> 
> Based on requirements 1,2 and 4, I think the new .h
> file and modifications to existing .h files need to be
> done in newlib.
> 
> The implementation would go in RTEMS.
> 
> I have attached an initial cut at the patch. I think it
> is close but it is untested.
> 
> Comments and thoughts appreciated.

One nit.

> --- a/newlib/libc/include/sys/unistd.h
> +++ b/newlib/libc/include/sys/unistd.h
> @@ -459,6 +459,9 @@ int	_EXFUN(unlinkat, (int, const char *, int));
>  #define _SC_LEVEL4_CACHE_SIZE           137
>  #define _SC_LEVEL4_CACHE_ASSOC          138
>  #define _SC_LEVEL4_CACHE_LINESIZE       139
> +#ifdef _POSIX_26_VERSION
> +#define _SC_POSIX_26_VERSION            140
> +#endif

Do not #ifdef this definition.  Just define it.  It's either supported
by the implementation or not.  We shopuld avoid different _SC_ macros
for different targets.

With that, please commit.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


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