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

Signed-off-by: Denis Kozadaev <denis@dilos.org>
(cherry picked from commit 44e4d3ce6b)
pull/182/head
Denis Kozadaev 4 years ago committed by Slávek Banko
parent 8109d12093
commit 8fc36c4ae2
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -330,7 +330,11 @@ int main( int argc, char **argv )
int len;
char procpath[PATH_MAX];
char fullpath[PATH_MAX];
snprintf(procpath, sizeof(procpath), "/proc/%d/exe", pid);
#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