From: Juho S. <js...@ik...> - 2006-08-18 06:58:16
|
Nikodemus Siivola <nik...@ra...> writes: > Sidney Markowitz <si...@si...> writes: > > > I tried to minimize the amount of change from the original code. I leave it up > > to someone who knows why the test case was written as it was to decide if the > > use of synonym-streams is supposed to be part of the test, or if it can be > > removed as superfluous now that the test can work without it. > > Many thanks for puzzling the issues here out! > > I'll merge this in a while, plus add a few comments on the motivation to > help future explorers. Note that :PTY T won't currently work on systems that use unix98 ptys (for example many Linux distributions). There SB-IMPL:FIND-A-PTY needs to look something like this: (define-alien-routine ptsname c-string (fd int)) (define-alien-routine grantpt boolean (fd int)) (define-alien-routine unlockpt boolean (fd int)) (defun find-a-pty () (let* ((master-name (coerce (format nil "/dev/ptmx") 'base-string)) (master-fd (sb-unix:unix-open master-name sb-unix:o_rdwr #o666))) (when master-fd (grantpt master-fd) (unlockpt master-fd) (let* ((slave-name (ptsname master-fd)) (slave-fd (sb-unix:unix-open slave-name sb-unix:o_rdwr #o666))) (when slave-fd (return-from find-a-pty (values master-fd slave-fd slave-name))) (sb-unix:unix-close master-fd)))) (error "could not find a pty")) -- Juho Snellman |