int WRAP(read)(int fd, void *buf, size_t count) { int rv; enum filefd_type fd_type; ALOGV(" "); ALOGV("%s(fd:%d, buf:0x%p, count:%d) {", __func__, fd, buf, count); fd_type = filefd_mapped_file[fd]; ALOGV("%s:fd_type:%d", __func__, fd_type); switch (fd_type) { /* Reads on these descriptors are portable; no need to be mapped. */ case UNUSED_FD_TYPE: case EVENT_FD_TYPE: case INOTIFY_FD_TYPE: case TIMER_FD_TYPE: rv = REAL(read)(fd, buf, count); break; /* The read() of a signalfd() file descriptor needs to be mapped. */ case SIGNAL_FD_TYPE: if (filefd_enabled) { rv = read_signalfd_mapper(fd, buf, count); } else { rv = REAL(read)(fd, buf, count); } break; default: ALOGE("Unknown fd_type:%d!", fd_type); rv = REAL(read)(fd, buf, count); break; } ALOGV("%s: return(rv:%d); }", __func__, rv); return rv; }
int WRAP(read)(int fd, void *buf, size_t count) { int rv; enum filefd_type fd_type; ALOGV(" "); ALOGV("%s(fd:%d, buf:0x%p, count:%d) {", __func__, fd, buf, count); fd_type = filefd_mapped_file[fd]; ALOGV("%s:fd_type:%d", __func__, fd_type); switch (fd_type) { case UNUSED_FD_TYPE: case EVENT_FD_TYPE: case INOTIFY_FD_TYPE: case TIMER_FD_TYPE: rv = REAL(read)(fd, buf, count); break; case SIGNAL_FD_TYPE: if (filefd_enabled) { rv = read_signalfd_mapper(fd, buf, count); } else { rv = REAL(read)(fd, buf, count); } break; default: ALOGE("Unknown fd_type:%d!", fd_type); rv = REAL(read)(fd, buf, count); break; } ALOGV("%s: return(rv:%d); }", __func__, rv); return rv; }