tMaybe it will run on SunOS 5.8 now. - plan9port - [fork] Plan 9 from user space (HTM) git clone git://src.adamsgaard.dk/plan9port (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit dc305d03681e150b97acf4631a514868acd4b276 (DIR) parent dd4afdf4eb411c2899f792cb11380877af065b1d (HTM) Author: rsc <devnull@localhost> Date: Tue, 8 Feb 2005 18:01:04 +0000 Maybe it will run on SunOS 5.8 now. Diffstat: M bin/9l | 13 +++++++++++++ M src/cmd/9term/SunOS.c | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) --- (DIR) diff --git a/bin/9l b/bin/9l t@@ -205,6 +205,19 @@ case "$tag" in ;; esac done + case "${SYSVERSION:-`uname -r`}" in + 5.[67]) + echo do not know how to link right thread library on "$tag" 1>&2 + ;; + 5.8) + # Some trickery is needed to force use of + # alternate thread lib from /usr/lib/lwp + # Likely, this only works with sun cc, + # for other compiler/loader we would need other flags. + ld="$ld -i" + extralibs="$extralibs /usr/lib/lwp/libthread.so -R/usr/lib/lwp:/usr/lib" + ;; + esac ;; *) echo do not know how to link on "$tag" 1>&2 (DIR) diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c t@@ -9,8 +9,14 @@ int getpts(int fd[], char *slave) { + void (*f)(int); + int r; + fd[1] = open("/dev/ptmx", ORDWR); - if ((grantpt(fd[1]) < 0) || (unlockpt(fd[1]) < 0)) + f = signal(SIGCLD, SIG_DFL); + r = grantpt(fd[1]); + signal(SIGCLD, f); + if(r < 0 || unlockpt(fd[1]) < 0) return -1; fchmod(fd[1], 0622);