From: Theo Buehler Subject: Re: x11/qt6/qtbase: getexecpath(3) To: Rafael Sadowski Cc: ports@openbsd.org Date: Thu, 10 Sep 2026 21:56:37 +0200 On Thu, Sep 10, 2026 at 09:52:56PM +0200, Rafael Sadowski wrote: > Add getexecpath(3) support. OK? > > diff --git a/x11/qt6/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp b/x11/qt6/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp > new file mode 100644 > index 00000000000..227afb89e9e > --- /dev/null > +++ b/x11/qt6/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp > @@ -0,0 +1,18 @@ > +Index: src/corelib/kernel/qcoreapplication.cpp > +--- src/corelib/kernel/qcoreapplication.cpp.orig > ++++ src/corelib/kernel/qcoreapplication.cpp > +@@ -2435,6 +2435,14 @@ static QString qAppFileName() > + # elif defined(Q_OS_LINUX) > + // this includes the Embedded Android builds > + return QFile::decodeName(qt_readlink("/proc/self/exe")); > ++# elif defined(__OpenBSD__) Should/can this not use Q_OS_OPENBSD instead of __OpenBSD__? Other than that this reads ok > ++ char buffer[PATH_MAX]; > ++ qsizetype len = 0; > ++ if (getexecpath(buffer, sizeof buffer) == 0) { > ++ len = strlen(buffer); > ++ return QFile::decodeName(QByteArray::fromRawData(buffer, len)); > ++ } > ++ return QString(); > + # elif defined(AT_EXECPATH) > + // seen on FreeBSD, but I suppose the other BSDs could adopt this API > + char execfn[PATH_MAX]; >