Пример #1
0
/*
 * In the original eventfd() the portable_flags were unused up to
 * linux 2.6.26 and had to be zero. Android simply uses the
 * new eventfd2 system call number, so it likely best to just use
 * the Android eventfd() for both eventfd and eventfd2 system calls.
 */
int WRAP(eventfd)(unsigned int initval, int portable_flags) {
    int rv;
    int native_flags;

    ALOGV(" ");
    ALOGV("%s(initval:%u, portable_flags:%d) {", __func__,
              initval,    portable_flags);

    native_flags = efd_flags_pton(portable_flags);

    rv = REAL(eventfd)(initval, native_flags);
    if (rv >= 0) {
        if (native_flags & EFD_CLOEXEC) {
            filefd_CLOEXEC_enabled(rv);
        }
        filefd_opened(rv, EVENT_FD_TYPE);
    }

    ALOGV("%s: return(rv:%d); }", __func__, rv);
    return rv;
}
Пример #2
0
int inotify_init1_portable(int portable_flags) {
    int rv;
    int native_flags;

    ALOGV(" ");
    ALOGV("%s(portable_flags:%d) {", __func__,
              portable_flags);

    native_flags = in_flags_pton(portable_flags);

    rv = syscall(__NR_inotify_init1, native_flags);
    if (rv >= 0) {
        if (native_flags & IN_CLOEXEC) {
            filefd_CLOEXEC_enabled(rv);
        }
        filefd_opened(rv, INOTIFY_FD_TYPE);
    }

    ALOGV("%s: return(rv:%d); }", __func__, rv);
    return rv;
}