Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

TTY support #85

Open
niklauslee opened this issue Aug 19, 2017 · 3 comments
Open

TTY support #85

niklauslee opened this issue Aug 19, 2017 · 3 comments

Comments

@niklauslee
Copy link

Hello,

I'm developing JavaScript REPL with Jerryscript and libtuv on NuttX platform. However, It seems that TTY functions are not ported in libtuv.

I've tried to include the tty.c source file when building, but it fails to link to symbols: ttyname_r, cfmakeraw, and uv__dup2_cloexec. (ttyname_r and cfmakeraw are not found in any source files in NuttX)

Do you have any plans to support TTY?

Thanks.

@glistening
Copy link

glistening commented Aug 21, 2017

@niklauslee We currently don't have plan to use tty.c in iotjs for now. So we commented out tty.c in option_unix_common.cmake.

@niklauslee
Copy link
Author

Ok. I'll try to port myself.

One more question. I noticed that buffer size is allocated 64K in NuttX when reading from TTY and I found the related code in stream.c as follow:

#if defined(__NUTTX__) || defined(__TIZENRT__)
    stream->alloc_cb((uv_handle_t*)stream, 64 * 1024, &buf);
#else
    stream->alloc_cb((uv_handle_t*)stream, 2 * 1024, &buf);
#endif

It try to alloc 64K for NuttX and 2K for other platforms. I think that it's reversed. Or, do you have any other intensions for this?

@LaszloLango
Copy link
Contributor

@niklauslee yes, it looks like those lines should be swapped.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants