-
-
Save cwen0/eee60159277cf027eeeb33be3deb95b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <dlfcn.h> | |
ssize_t read(int fd, void *buf, size_t count) { | |
ssize_t (*origin_read)(int, void*, size_t) = dlsym(RTLD_NEXT, "read"); | |
sleep(5); | |
printf("read sleep 5s\n"); | |
return origin_read(fd, buf, count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment