Skip to content

Commit 683f056

Browse files
committed
unix: fix IoctlGetPtmget get empty ptsname on NetBSD.
On NetBSD, because the size of the Ptmget structure does not match the value of TIOCPTSNAME, IoctlGetPtmget uses an incorrect structure internally, resulting in empty ptsname. See https://github.com/NetBSD/src/blob/trunk/sys/sys/ttycom.h Fixes #66871
1 parent 9a28524 commit 683f056

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

unix/syscall_netbsd_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ func TestIoctlPtmget(t *testing.T) {
3838
t.Fatalf("IoctlGetPtmget: %v\n", err)
3939
}
4040

41-
t.Logf("sfd = %v, ptsname = %v", ptm.Sfd, unix.ByteSliceToString(ptm.Sn[:]))
41+
ptsname := unix.ByteSliceToString(ptm.Sn[:])
42+
if ptsname == "" {
43+
t.Fatalf("IoctlGetPtmget: ptsname is empty string\n")
44+
}
45+
46+
t.Logf("sfd = %v, ptsname = %v", ptm.Sfd, ptsname)
4247
}
4348

4449
func TestStatvfs(t *testing.T) {

unix/ztypes_netbsd_386.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_netbsd_amd64.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_netbsd_arm64.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)