DilOS: use illumos specific /proc path for an executable file

Signed-off-by: Denis Kozadaev <denis@dilos.org>
pull/146/head
Denis Kozadaev 4 years ago committed by TDE Gitea
parent 953eb33118
commit 44e4d3ce6b

@ -338,7 +338,11 @@ int main( int argc, char **argv )
int len;
char procpath[PATH_MAX];
char fullpath[PATH_MAX];
#if defined(__dilos__)
snprintf(procpath, sizeof(procpath), "/proc/%d/path/a.out", pid);
#else /* !__dilos__ */
snprintf(procpath, sizeof(procpath), "/proc/%d/exe", pid);
#endif /* __dilos__ */
len = readlink( procpath, fullpath, sizeof(fullpath) );
if (len >= 0) {
fullpath[len] = 0;

Loading…
Cancel
Save