summaryrefslogtreecommitdiffstats
path: root/twin/client.cpp
diff options
context:
space:
mode:
authorDenis Kozadaev <[email protected]>2023-05-18 21:41:25 +0300
committerSlávek Banko <[email protected]>2023-05-22 20:07:54 +0200
commit4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685 (patch)
tree564b7622f7025d976f0a0ac1cd9ed82ea14239dd /twin/client.cpp
parentbd5494bc81ed0034cde41a34e6a6e8b813b7814b (diff)
downloadtdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.tar.gz
tdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.zip
SunOS specific patches
Signed-off-by: Denis Kozadaev <[email protected]>
Diffstat (limited to 'twin/client.cpp')
-rw-r--r--twin/client.cpp29
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;