chzyer / readline

Readline is a pure go(golang) implementation for GNU-Readline kind library
MIT License
2.06k stars 273 forks source link

Perform ioctl system calls through x/sys/unix #232

Open jrick opened 8 months ago

jrick commented 8 months ago

OpenBSD is removing the syscall(2) interface soon and ioctl operations using syscall.Syscall6 will fail to link at runtime:

$ go test
tmpdir: /tmp
readline.test:/tmp/go-build2875288623/b001/readline.test: undefined symbol 'syscall' ld.so: readline.test: lazy binding failed!
signal: killed
FAIL    github.com/chzyer/readline  0.008s

These calls must instead be performed using the golang.org/x/sys/unix package, which links to the ioctl(2) libc stub instead of the generic syscall(2) interface.

wader commented 8 months ago

@slingamn something for https://github.com/ergochat/readline?

jrick commented 8 months ago

@wader @slingamn that fork works correctly already.

wader commented 8 months ago

@jrick 👍 aha great, was fixed in some other way? code seems quite different

jrick commented 8 months ago

it already performs ioctls through a recent enough version of golang.org/x/sys/unix