• Michael Kerrisk's avatar
    inotify: fix type errors in interfaces · 4ae8978c
    Michael Kerrisk authored
    The problems lie in the types used for some inotify interfaces, both at the kernel level and at the glibc level. This mail addresses the kernel problem. I will follow up with some suggestions for glibc changes.
    
    For the sys_inotify_rm_watch() interface, the type of the 'wd' argument is
    currently 'u32', it should be '__s32' .  That is Robert's suggestion, and
    is consistent with the other declarations of watch descriptors in the
    kernel source, in particular, the inotify_event structure in
    include/linux/inotify.h:
    
    struct inotify_event {
            __s32           wd;             /* watch descriptor */
            __u32           mask;           /* watch mask */
            __u32           cookie;         /* cookie to synchronize two events */
            __u32           len;            /* length (including nulls) of name */
            char            name[0];        /* stub for possible name */
    };
    
    The patch makes the changes needed for inotify_rm_watch().
    Signed-off-by: default avatarMichael Kerrisk <mtk.manpages@googlemail.com>
    Cc: Robert Love <rlove@google.com>
    Cc: Vegard Nossum <vegard.nossum@gmail.com>
    Cc: Ulrich Drepper <drepper@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    4ae8978c
syscalls.h 27.7 KB