incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Far...@kyiv.vdiweb.com>
Subject Mt tests
Date Thu, 09 Nov 2006 16:00:55 GMT
  The idea of the multithreaded tests is running of the self executable
as another process with additional parameters.

  It is not a problem on windows because argv[0] is full path to the
executable on MSVC. Even if it's not always true,
the function GetModuleFileName() returns that path. On unix it is not
guaranteed that argv[0] is full path to the executable.

  In the beginning I thought to use fork() to create a child copy of the
process and call main() with new parameters and
then call exit() with returned value from main(), but I not sure that is
correct. Another issue is that static and global variables
will not be initialized and will contain will the previous values.

  I found that reading of the symlink /proc/self/exe is may return the
path to the executable, but there is no strict guarantee of it.

  Whether there is a reliable way to get this path?

Farid.

Mime
View raw message