17 Commits

Author SHA1 Message Date
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
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
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
Keith Rarick
7dc38fb350 remove deprecated nomenclature
The words "master" and "slave" in this context are both
harmful and, as a technical matter, confusing and
misleading. It was never my intention to use those terms
in this library, but they snuck in while I wasn't paying
attention.

This change replaces them with "pty" and "tty",
respectively, to be consistent with the other files in
this package and with the device names on BSD platforms.
These terms are not harmful (to the best of my
knowledge) and they're more specific.

In editing the comment in pty_linux.go, this patch also
corrects a factual error. The ioctl argument is not
"zero valued", it is a nonzero pointer to the number 0.
2019-01-30 17:10:33 -08:00
Guillaume J. Charmes
282ce0e532 Improve error management for openpty (#57)
Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net>
2018-01-13 13:08:13 -05:00
Yohei Ueda
9cf8a72e81 Remove uintptr(...)
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2014-12-04 22:21:03 +09:00
Yohei Ueda
e615e17b3e Remove ioctl_* constants on Linux
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2014-12-03 22:25:00 +09:00
Yohei Ueda
b1c5cc8377 Use syscall.TIOCGPTN and syscall.TIOCSPTLCK for ioctl
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2014-11-25 10:32:31 +00:00
Yuval Pavel Zholkover
67e2db24c8 add generated ztypes_arm.go and ztypes_freebsd_arm.go
Tidy unused ioctl arguments
2014-03-16 09:51:15 +02: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
Cameron Stewart
3b1f6487b7 Add no NOCTTY, required for when there is no controlling terminal 2013-09-27 01:57:47 +10:00
Keith Rarick
27435c699b factor out docs 2013-03-16 18:30:08 -07:00
Keith Rarick
3b1c6581cb go fmt 2012-02-01 21:41:44 -08:00
Sherjil Ozair
9e03abc5be Some changes to make the code compile with GO version 1.0.1. However, there would be also be some changes in functionality. This is due to changes in the type of cmd.Stdin and cmd.Stdout, and their inability to write as well read. The example given in readme.md doesn't work. I'm figuring out a way to make changes in the example so that it works. 2012-06-13 13:29:54 +01:00
Keith Rarick
227762de52 gofix for release.r57.1 2011-05-24 12:08:43 -07:00
Keith Rarick
12319125d6 initial 2011-05-03 14:24:49 -07:00