diff options
author | Denis Kozadaev <denis@dilos.org> | 2023-05-18 21:41:25 +0300 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-05-23 10:14:51 +0900 |
commit | d984205f2e2e53941bce2efb99252feb6a4c046e (patch) | |
tree | 71092a76f19990d9072233a2c02e687ee518da64 /twin/client.cpp | |
parent | f3f71a018f383fe1cdf2d7e402c95325ba81c6a3 (diff) | |
download | tdebase-d984205f.tar.gz tdebase-d984205f.zip |
SunOS specific patches
Signed-off-by: Denis Kozadaev <denis@dilos.org>
(cherry picked from commit 4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685)
Diffstat (limited to 'twin/client.cpp')
-rw-r--r-- | twin/client.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/twin/client.cpp b/twin/client.cpp index b57cab35f..a58fd22f2 100644 --- a/twin/client.cpp +++ b/twin/client.cpp @@ -27,6 +27,11 @@ License. See the file "COPYING" for the exact licensing terms. #include <tdelocale.h> #include <stdlib.h> +#ifdef Q_OS_SOLARIS +#include <procfs.h> +#include <libgen.h> +#endif /* SunOS */ + #include "bridge.h" #include "group.h" #include "workspace.h" @@ -1860,15 +1865,30 @@ bool Client::isSuspendable() const } else { +#ifdef Q_OS_SOLARIS + TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid)); +#else /* default */ TQFile procStatFile(TQString("/proc/%1/stat").arg(pid)); +#endif if (procStatFile.open(IO_ReadOnly)) { TQByteArray statRaw = procStatFile.readAll(); procStatFile.close(); +#ifdef Q_OS_SOLARIS + lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data(); + char tbuf[PATH_MAX]; + TQString tcomm; + TQString state(TQChar(inf->pr_sname)); + + readlink(TQString("/proc/%1/path/a.out").arg(pid).latin1(), + tbuf, sizeof(tbuf)); + tcomm = basename(tbuf); +#else /* default */ TQString statString(statRaw); TQStringList statFields = TQStringList::split(" ", statString, TRUE); TQString tcomm = statFields[1]; TQString state = statFields[2]; +#endif /* default */ if( state != "T" ) { // Make sure no windows of this process are special @@ -1921,15 +1941,24 @@ bool Client::isResumeable() const } else { +#ifdef Q_OS_SOLARIS + TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid)); +#else /* default */ TQFile procStatFile(TQString("/proc/%1/stat").arg(pid)); +#endif if (procStatFile.open(IO_ReadOnly)) { TQByteArray statRaw = procStatFile.readAll(); procStatFile.close(); +#ifdef Q_OS_SOLARIS + lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data(); + TQString state(TQChar(inf->pr_sname)); +#else /* default */ TQString statString(statRaw); TQStringList statFields = TQStringList::split(" ", statString, TRUE); TQString tcomm = statFields[1]; TQString state = statFields[2]; +#endif /* default */ if( state == "T" ) { return true; |