From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Dec 2020 01:06:18 +0100 Subject: [PATCH] Implement getprogname() --- lib/getprogname.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/getprogname.c b/lib/getprogname.c index 9f69f5a..e5adb23 100644 --- a/lib/getprogname.c +++ b/lib/getprogname.c @@ -51,6 +51,10 @@ # include #endif +#ifdef __serenity__ +# include +#endif + #include "dirname.h" #ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ @@ -245,6 +249,12 @@ getprogname (void) } } return NULL; +# elif defined __serenity__ + char* buffer = malloc(1024); + if (get_process_name(buffer, 1024) < 0) + return NULL; + return buffer; + # else # error "getprogname module not ported to this OS" # endif