cppthread 1.1.16
C++ Thread Library
Functions
has_vdso.cpp File Reference

Check whether the vDSO is used on this computer. More...

#include <cppthread/thread.h>
#include <libexcept/file_inheritance.h>
#include <iostream>
#include <string.h>
#include <snapdev/poison.h>
Include dependency graph for has_vdso.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 
void usage (char *progname)
 

Detailed Description

This tool is expected to be used in your scripts to know whether a given process may fail because it is off time wise (i.e. the process uses the time(2) function which can be off by up to 1 second).

You can simply use it in an if statement like so:

if ! has-vdso -q
then
echo "warning: our process won't work right on this platform..."
fi
Note
I seem to have such an issue on an ARM64 CPU. So the test above may also require you to test the architecture. I don't recall ever having such an issue on an Intel based computer (I nearly only used computers with Intel processors since I stopped using my SGI computers).
See also
https://man7.org/linux/man-pages/man7/vdso.7.html

Definition in file has_vdso.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 80 of file has_vdso.cpp.

◆ usage()

void usage ( char *  progname)

Definition at line 70 of file has_vdso.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.