fix: make KF6 Pty build on Redox

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-07 08:06:59 +01:00
parent 52954456f2
commit d8d26eaff3
3 changed files with 36 additions and 8 deletions
+16 -1
View File
@@ -439,7 +439,7 @@ void KPty::setCTty()
setsid();
// make our slave pty the new controlling terminal.
ioctl(d->slaveFd, TIOCSCTTY, 0);
ioctl(d->slaveFd, TIOCSCTTY, nullptr);
// make our new process group the foreground group on the pty
int pgrp = getpid();
@@ -448,6 +448,15 @@ void KPty::setCTty()
void KPty::login(const char *user, const char *remotehost)
{
#ifdef __redox__
// Redox provides PTY allocation and terminal attributes, but it does not yet
// expose a utmp/wtmp database API. Keep KPty functional while making login
// accounting an explicit no-op on this target rather than referencing
// incomplete libc utmp declarations.
Q_UNUSED(user);
Q_UNUSED(remotehost);
return;
#else
#ifdef UTEMPTER_PATH
Q_D(KPty);
@@ -533,10 +542,15 @@ void KPty::login(const char *user, const char *remotehost)
#endif
#endif
#endif
#endif
}
void KPty::logout()
{
#ifdef __redox__
// See KPty::login(): there is no Redox utmp/wtmp backend to update yet.
return;
#else
#ifdef UTEMPTER_PATH
Q_D(KPty);
@@ -612,6 +626,7 @@ void KPty::logout()
#endif
#endif
#endif
#endif
}
bool KPty::tcGetAttr(struct ::termios *ttmode) const