Skip to content

Commit c585e09

Browse files
committed
Processing (Haiku): support exe path detection
1 parent 464e00d commit c585e09

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/common/processing_linux.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <sys/sysctl.h>
3131
#elif defined(__HAIKU__)
3232
#include <OS.h>
33+
#include <image.h>
3334
#endif
3435

3536
enum { FF_PIPE_BUFSIZ = 8192 };
@@ -312,6 +313,21 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
312313
}
313314
kvm_close(kd);
314315

316+
#elif defined(__HAIKU__)
317+
318+
if (exePath)
319+
{
320+
image_info info;
321+
int32 cookie = 0;
322+
323+
while (get_next_image_info(pid, &cookie, &info) == B_OK)
324+
{
325+
if (info.type != B_APP_IMAGE) continue;
326+
ffStrbufSetS(exePath, info.name);
327+
break;
328+
}
329+
}
330+
315331
#endif
316332

317333
if(exe->length == 0)
@@ -488,6 +504,8 @@ const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, i
488504
*ppid = info.parent;
489505
}
490506

507+
FF_UNUSED(tty);
508+
491509
#else
492510

493511
return "Unsupported platform";

0 commit comments

Comments
 (0)