Ich lerne etwas über VDSO und habe eine einfache Anwendung geschrieben, die gettimeofday() aufruft
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
struct timeval current_time;
if (gettimeofday(¤t_time, NULL) == -1)
printf("gettimeofday");
getchar();
exit(EXIT_SUCCESS);
}
ldd auf der Binärdatei zeigt ‘linux-vdso’
$ ldd ./prog
linux-vdso.so.1 (0x00007ffce147a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ef9e8e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6efa481000)
Ich habe nach der libvdso-Bibliothek gesucht und in meinem Dateisystem ist keine solche Bibliothek vorhanden.
sudo find / -name 'linux-vdso.so*'
Wo ist die Bibliothek präsent?
Siehe auch: unix.stackexchange.com/a/397014/43390
– 0 _
20. November 2020 um 13:13 Uhr