On Sun, 7 Apr 2024 12:21:14 -0400
George Koehler <kernigh@gmail.com> wrote:
> On Sun, 7 Apr 2024 15:57:26 +0200
> Rob Schmersel <rob.schmersel@bahnhof.se> wrote:
>
> > I tracked it down to the use of syscall in the tcell package file
> > tscreen_bsd.go (line 46)
> >
> >
> > > fd = uintptr(t.out.(*os.File).Fd())
> > > if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc,
> > > tios, 0, 0, 0); e1 != 0 { e = e1
> > > goto failed
> > > }
>
> Joel Sing patched our lang/go to allow SYS_IOCTL in Syscall, but not
> in Syscall6. I tried changing Syscall6 to Syscall in tscreen_bsd.go.
> The "function not implemented" error stopped appearing, but
>
I think there is a reason why Syscall6 was used instead of Syscall
(i.e. number of arguments). Just removing the last 3 arguments now
makes the last argument (tios) be a pointer (at least according to the
syscall package description) which I'm not sure is the intention and
probably the reason for the black screen :)
So I guess I need to look at the syscall package to figure what changes
where made for Syscall. Will give it go later today.
> - micro got stuck on a black screen; I needed to close the terminal.
Got the same after patching
> - I can't add my patch to the port, because "make update-patches"
> doesn't see it. The file is outside WRKSRC, in
> WRKDIR/go/pkg/mod/github.com/zyedidia/tcell/v2@v2.0.10
>
Yeah, the tcell package is a dependency that gets pulled in during
compilation. We need to request upstream to patch or get tcell as an
own package once it is figured out what is the cause (it definitely
used to work before :))
> --- tscreen_bsd.go.orig.port Sun Apr 7 11:53:03 2024
> +++ tscreen_bsd.go Sun Apr 7 11:57:57 2024
> @@ -43,7 +43,7 @@
> tios = uintptr(unsafe.Pointer(t.tiosp))
> ioc = uintptr(syscall.TIOCGETA)
> fd = uintptr(t.out.(*os.File).Fd())
> - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc,
> tios, 0, 0, 0); e1 != 0 {
> + if _, _, e1 := syscall.Syscall(syscall.SYS_IOCTL, fd, ioc,
> tios); e1 != 0 { e = e1
> goto failed
> }
> @@ -61,7 +61,7 @@
> tios = uintptr(unsafe.Pointer(&newtios))
>
> ioc = uintptr(syscall.TIOCSETA)
> - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc,
> tios, 0, 0, 0); e1 != 0 {
> + if _, _, e1 := syscall.Syscall(syscall.SYS_IOCTL, fd, ioc,
> tios); e1 != 0 { e = e1
> goto failed
> }
> @@ -94,7 +94,7 @@
> fd := uintptr(t.out.(*os.File).Fd())
> ioc := uintptr(syscall.TIOCSETAF)
> tios := uintptr(unsafe.Pointer(t.tiosp))
> - syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios,
> 0, 0, 0)
> + syscall.Syscall(syscall.SYS_IOCTL, fd, ioc, tios)
> t.out.(*os.File).Close()
> }
> if t.in != nil {
> @@ -108,8 +108,8 @@
> dim := [4]uint16{}
> dimp := uintptr(unsafe.Pointer(&dim))
> ioc := uintptr(syscall.TIOCGWINSZ)
> - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL,
> - fd, ioc, dimp, 0, 0, 0); err != 0 {
> + if _, _, err := syscall.Syscall(syscall.SYS_IOCTL,
> + fd, ioc, dimp); err != 0 {
> return -1, -1, err
> }
> return int(dim[1]), int(dim[0]), nil
>
No comments:
Post a Comment