Skip to content

ioctl() terminal window syscalls not implemented #6463

Closed
@DataKinds

Description

@DataKinds

Hey, I was trying to compile libreadline to JavaScript, but to no avail. Upon successful compilation and inclusion, the program using libreadline fails to load due to an unimplemented syscall -- syscall 0x00005414, usually implemented in /usr/include/asm-generic/termios.h. Screenshot relevant and attached.

syscall screenshot

If this is my fault compiling readline incorrectly, please point me in the right direction or close this ticket.

Activity

kripken

kripken commented on Apr 20, 2018

@kripken
Member

Doing a grep for that ioctl code in our system code (under system/), looks like it's TIOCSWINSZ, and reading some online docs for that, it seems to be setting the window size?

We don't have much terminal window support right now, but in principle we could add it. The first question is what does "window" mean here - our default html contains a textarea, which I suppose would be the natural thing to refer it to? Then the question is whether HTML textareas support is enough for this purpose (or would we need a canvas?). Once that's figured out, the main implementation for this would go in src/library_syscall.js, see for example #6466 for a recent PR implementing another syscall thing.

changed the title [-]ioctl() syscall 0x00005414 not implemented[/-] [+]ioctl() terminal window syscalls not implemented[/+] on Apr 20, 2018
DataKinds

DataKinds commented on Apr 21, 2018

@DataKinds
ContributorAuthor

I'll try and get on this once I get a minute tonight. Is there anything special I have to be aware of when using emsdk with a custom version of emscripten?

DataKinds

DataKinds commented on Apr 21, 2018

@DataKinds
ContributorAuthor

Not 100% sure how GitHub works with PRs and all that so I'm going to link the PR here as well. Here's a fix for this issue by adding TIOCSWINSZ (which is defined in system/lib/libc/musl/arch/emscripten/bits/ioctl.h) to struct_info and handling the terminal window corner case inside of ioctl(). #6468

stale

stale commented on Sep 19, 2019

@stale

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

xloem

xloem commented on Mar 19, 2020

@xloem
Contributor

I'm working on terminal support for things like this a little at https://github.com/xloem/emterm.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kripken@xloem@DataKinds

        Issue actions

          ioctl() terminal window syscalls not implemented · Issue #6463 · emscripten-core/emscripten