diff options
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 3ba2f56b..f0a4f53a 100644 --- a/src/library.js +++ b/src/library.js @@ -5154,6 +5154,37 @@ LibraryManager.library = { }, // ========================================================================== + // termios.h + // ========================================================================== + tcgetattr: function(fildes, termios_p) { + // http://pubs.opengroup.org/onlinepubs/009695399/functions/tcgetattr.html + var stream = FS.getStream(fildes); + if (!stream) { + ___setErrNo(ERRNO_CODES.EBADF); + return -1; + } + if (!stream.tty) { + ___setErrNo(ERRNO_CODES.ENOTTY); + return -1; + } + return 0; + }, + + tcsetattr: function(fildes, optional_actions, termios_p) { + // http://pubs.opengroup.org/onlinepubs/7908799/xsh/tcsetattr.html + var stream = FS.getStream(fildes); + if (!stream) { + ___setErrNo(ERRNO_CODES.EBADF); + return -1; + } + if (!stream.tty) { + ___setErrNo(ERRNO_CODES.ENOTTY); + return -1; + } + return 0; + }, + + // ========================================================================== // time.h // ========================================================================== |