On Feb  8 13:24, Yaakov Selkowitz wrote:
> On 2016-02-08 08:10, Corinna Vinschen wrote:
> >Alternatively we could allow to use the Solaris ACL functions even if
> >only including sys/acl.h, given some macro:
> >
> >   sys/acl.h:
> >
> >     #ifdef __USE_OLD_SOLARIS_ACL_FUNCTIONS
> >     # include <cygwin/acl.h>
> >     #else
> >       [...POSIX definitions...]
> >     #endif
> 
> Do the functions or typedefs conflict in any way?

No, they don't.  However, I encountered a problem when exposing the
Solaris API at the same time as the POSIX API via sys/acl.h.  Vim's
autoconf test failed to recognize support for the POSIX API.  Try
this entirely harmless (from the POSIX POV) piece of code:

  #include <sys/types.h>
  #include <sys/acl.h>

  acl_t acl;

  int main ()
  {
    acl = acl_get_file("foo", ACL_TYPE_ACCESS);
    return 0;
  }

Works fine, but now try this with an additional

  #include <cygwin.acl.h>

You'll get an error message:

$ gcc -c acl.c
acl.c:5:7: error: ‘acl’ redeclared as different kind of symbol
   acl_t acl;
         ^
In file included from acl.c:2:0:
/usr/include/cygwin/acl.h:76:13: note: previous declaration of ‘acl’ was here
 extern int  acl (const char *__path, int __cmd, int __nentries,
             ^

The existence of the functions acl and facl is entirely unexpected in
the POSIX context.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature

Reply via email to