Replies: 3 comments
-
|
This behavior can also be observed if the following path is applied, package pty
-import "os"
+import (
+ "os"
+ "time"
+)
func ioctl(f *os.File, cmd, ptr uintptr) error {
+ time.Sleep(time.Microsecond)
return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io.
}Somehow, adding a small delay also causes this. I can not find anything about |
Beta Was this translation helpful? Give feedback.
-
|
@creack Do you have time to take a look at this? |
Beta Was this translation helpful? Give feedback.
-
|
I believe it's the result of incorrect usage of conversion between Per the docs for
By manually hacking the function signature and converting the type to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After #167 was reverted, I found something about some peculiarities I want to share,
import "os" func ioctl(f *os.File, cmd, ptr uintptr) error { - return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io. -} - -// NOTE: Unused. Keeping for reference. -func ioctlNonblock(f *os.File, cmd, ptr uintptr) error { sc, e := f.SyscallConn() if e != nil { return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io (old behavior). }If this patch is applied, sometimes I can observe
pingis written out to the outputIt's actually written here
pty/doc_test.go
Lines 42 to 44 in edfbf75
Somehow, the slave device to my current terminal is opened.
I added some debug output here, and found out no error is returned and n is not changed. The resulting path
/dev/pts/0does refer to my terminal.pty/pty_linux.go
Lines 41 to 48 in edfbf75
I added some retries here that if
n == 0retry and the tests passed. But I feel this is a hack. I wonder why the syscall succeeded but the parameter passed didn't change?Beta Was this translation helpful? Give feedback.
All reactions