11 Commits

Author SHA1 Message Date
Guillaume J. Charmes
8efd70af93 Revert #167 to avoid race on Linux. 2023-11-09 10:50:21 -05:00
Guillaume J. Charmes
219f7e0db9 Add more test helpers, cleanup existing tests. Add editorconfig and golangci config, comply with golangci rules. 2023-10-31 10:52:38 -04:00
Vitaly Potyarkin
418593def3 Restore support for older Go versions
When compiled with go older than 1.12 creack/pty will not include a fix
for blocking Read() and will be prone to data races - but at least it will work

For more information see issues: #88 #114 #156 #162
2023-04-28 10:16:36 +00:00
Vitaly Potyarkin
87d82d3af0 Rename ioctl.go back
This filename trick forces git to render previous commit diff
in a more comprehensible form
2023-04-28 09:34:49 +00:00
Vitaly Potyarkin
291695431f Do not set file descriptor into blocking mode
(*os.File).Fd() implicitly sets file descriptor into blocking mode [1], [2]
We avoid that by calling (*os.File).SyscallConn instead.
This method was added in go1.12 (released on 2019-02-25)

[1]: https://pkg.go.dev/os#File.Fd
[2]: https://cs.opensource.google/go/go/+/refs/tags/go1.20.3:src/os/file_unix.go;l=80-87
2023-04-28 09:24:09 +00:00
Guillaume J. Charmes
d301b27172 fix aix compile error (#144)
* Fix windows compilation

* Fix compilation for AIX. Relates to #139

* Remove unused import for windows
2022-03-27 10:49:54 -07:00
Fraser Waters
7de28cee0d Add GHA workflow to run test_crosscompile and go test (#141)
* Add GHA workflow to run test_crosscompile and go test
* crosscompile job doesn't need setup-go
* Test more go versions
* Test 1.6
* Remove 1.13 and add comment of testing strategy
2022-03-27 08:14:20 -04:00
Guillaume J. Charmes
f73a158a9a Simplify solaris implementation. (#120)
Remove golang.org/x/sys/unix dependency for solaris
Add new go build tag directives
2021-05-29 18:39:47 -04:00
Fazal Majid
d584804c77 support for Solaris (#64)
* first draft of Solaris support

* implemented new APIs for Solaris

* fixes for Solaris ioctls, tested using github.com/yudai/gotty as a test bed
2019-06-29 11:02:41 -04:00
Steve Sanders
fe7bf43396 Don't attempt to build on windows 2015-11-04 12:44:15 -08:00
Yuval Pavel Zholkover
88e4fdb5b4 Portable ioctl calls
Add _IOC macros (<sys/ioccom.h>, <asm-generic/ioctl.h>) for linux and bsd's, unify ioctl() calls.
FreeBSD: use modern pts(4) interface instead of the old pty(4) one
2014-03-14 17:28:51 +02:00