Emscripten: ioctl() terminal window syscalls not implemented

Created on 20 Apr 2018  路  5Comments  路  Source: emscripten-core/emscripten

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.

help wanted wontfix

Most helpful comment

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

All 5 comments

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.

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?

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(). https://github.com/kripken/emscripten/pull/6468

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HolgerStrauss picture HolgerStrauss  路  4Comments

napalm272 picture napalm272  路  4Comments

lokpoi888 picture lokpoi888  路  4Comments

hcomere picture hcomere  路  3Comments

kripken picture kripken  路  4Comments