libshit

Just some random shit
git clone https://git.neptards.moe/neptards/libshit.git
Log | Files | Refs | Submodules | README | LICENSE

qemu_vdso_fix_linux_amd64.c (565B)


      1 /* Workaround qemu-x86_64 not supporting either of vdso/vsyscall and old glibc
      2  * versions unconditionally using vsyscall when vdso is not available (no
      3  * syscall fallback). */
      4 
      5 /* Compile:
      6  * clang -O2 -shared -o tools/qemu_vdso_fix_linux_amd64.so tools/qemu_vdso_fix_linux_amd64.c
      7  */
      8 
      9 #ifndef _GNU_SOURCE
     10 #define _GNU_SOURCE
     11 #endif
     12 
     13 #include <sys/syscall.h>
     14 #include <sys/time.h>
     15 #include <unistd.h>
     16 
     17 int gettimeofday(struct timeval* tv, void* tz)
     18 {
     19   return syscall(SYS_gettimeofday, tv, tz);
     20 }
     21 
     22 time_t time(time_t* tloc)
     23 {
     24   return syscall(SYS_time, tloc);
     25 }