> Gesendet: Donnerstag, 17. April 2014 um 11:33 Uhr
> Von: [email protected]
> An: "Helge Deller" <[email protected]>
> Cc: [email protected], "Mike Frysinger" <[email protected]>
> Betreff: Re: [LTP] [PATCH] fix fanotify syscall check on compat kernel
>
> Hi!
> >  #ifndef    __FANOTIFY_H__
> >  #define    __FANOTIFY_H__
> >  
> > +#include <sys/types.h>
> > +#include <endian.h>
> > +#include "config.h"
> > +#include "linux_syscall_numbers.h"
> > +
> >  /* fanotify(7) wrappers */
> >  
> >  #define    myfanotify_init(flags, event_f_flags) \
> >     syscall(__NR_fanotify_init, flags, event_f_flags)
> >  
> > -#define    myfanotify_mark(fd, flags, mask, dfd, pathname) \
> > -   syscall(__NR_fanotify_mark, fd, flags, mask, dfd, pathname)
> > +long myfanotify_mark(int fd, unsigned int flags, unsigned long long mask, 
> > int dfd, const char *pathname)
> > +{
> > +#if __WORDSIZE == 64
> > +   return ltp_syscall(__NR_fanotify_mark, fd, flags, mask, dfd, pathname);
> > +#else
> > +   return ltp_syscall(__NR_fanotify_mark, fd, flags,
> > +                    __LONG_LONG_PAIR((unsigned long) (mask >> 32),
> > +                                     (unsigned long) mask),
> > +                    dfd, (unsigned long) pathname);
> > +#endif
> > +}
> 
> I think that the x32 ABI should be handled here as well (as in the
> fallocate.h). Mike can you confirm?

Yes, I think so.
I even thought of changing the #if to C-Coding like 
  if ((sizeof(void*) == 8)
    call 64bit_syscall
   else
    call 32bit_syscall_wrapper;

I'm not sure if this can avoid the ifdefs though...

> Also I've been unable to make the testcases work with -m32 on x86_64
> both with and without the patch and even when using glibc wrappers from
> sys/fallocate.h, in all cases the error is EINVAL which suggets that the
> parameters are passed wrongly somewhere on the way.

Does it work on the same kernel with -m64 ?
In any case, for the tests to work the kernel needs to have been compiled with 
the
kernel option CONFIG_FANOTIFY_ACCESS_PERMISSIONS set. In my initial tests this
option wasn't set and I got EINVAL too.

Helge

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to