Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/ioctl.h |
| diff --git a/native_client_sdk/src/libraries/nacl_io/ioctl.h b/native_client_sdk/src/libraries/nacl_io/ioctl.h |
| index 1d27c61eb5f07c55006cae2cf02a907de49e40a8..d12b853a9dc6e3a98884bda2334af172224d1bdc 100644 |
| --- a/native_client_sdk/src/libraries/nacl_io/ioctl.h |
| +++ b/native_client_sdk/src/libraries/nacl_io/ioctl.h |
| @@ -5,21 +5,27 @@ |
| #ifndef LIBRARIES_NACL_IO_IOCTL_H_ |
| #define LIBRARIES_NACL_IO_IOCTL_H_ |
| -/* ioctl to tell a tty mount to prefix every message with a particular |
| - * null-terminated string. Accepts a pointer to a C string which will |
| - * be the prefix. |
| - */ |
| -#define TIOCNACLPREFIX 0xadcd01 |
| - |
| -/* ioctl to feed input to a tty mount. Accepts a pointer to the following |
| +/* |
| + * ioctl to feed input to a tty node. Accepts a pointer to the following |
| * struct (tioc_nacl_input_string), which contains a pointer to an array |
| * of characters. |
| */ |
| #define TIOCNACLINPUT 0xadcd02 |
| +/* |
| + * ioctl to register an output handler with the tty node. Will fail |
| + * with EALREADY if a handler is already registered. Call with NULL |
|
binji
2013/08/22 18:09:36
Why fail if already set? It could just overwrite i
Sam Clegg
2013/08/22 19:52:25
Just so the user knows when they do that. Its pro
|
| + * to unregister handler. |
|
binji
2013/08/22 18:09:36
document the thread that gets the callback: the th
Sam Clegg
2013/08/22 19:52:25
Done.
|
| + */ |
| +#define TIOCNACLOUTPUT 0xadcd03 |
| + |
| struct tioc_nacl_input_string { |
| size_t length; |
| const char* buffer; |
| }; |
| + |
| +typedef int (*nacl_io_tty_output_handler_t)(const char* buf, int count); |
|
binji
2013/08/22 18:09:36
size_t for consistency with tioc_nacl_input_tstrin
binji
2013/08/22 18:09:36
tioc prefix?
binji
2013/08/22 18:09:36
document that the return value is the number of by
binji
2013/08/22 18:09:36
Make this a struct containing the function pointer
Sam Clegg
2013/08/22 19:52:25
Done.
Sam Clegg
2013/08/22 19:52:25
Done.
Sam Clegg
2013/08/22 19:52:25
Done.
Sam Clegg
2013/08/22 19:52:25
Done.
|
| + |
| + |
| #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ |