Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ioctl() terminal window syscalls not implemented #6463

Closed
DataKinds opened this issue Apr 20, 2018 · 5 comments
Closed

ioctl() terminal window syscalls not implemented #6463

DataKinds opened this issue Apr 20, 2018 · 5 comments

Comments

@DataKinds
Copy link
Contributor

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.

@kripken
Copy link
Member

kripken commented Apr 20, 2018

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.

@kripken kripken changed the title ioctl() syscall 0x00005414 not implemented ioctl() terminal window syscalls not implemented Apr 20, 2018
@DataKinds
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link

stale bot commented Sep 19, 2019

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.

@stale stale bot added the wontfix label Sep 19, 2019
@stale stale bot closed this as completed Sep 26, 2019
@xloem
Copy link
Contributor

xloem commented Mar 19, 2020

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
Projects
None yet
Development

No branches or pull requests

3 participants