Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. */ | 3 * found in the LICENSE file. */ |
| 4 | 4 |
| 5 #ifndef LIBRARIES_NACL_IO_IOCTL_H_ | 5 #ifndef LIBRARIES_NACL_IO_IOCTL_H_ |
| 6 #define LIBRARIES_NACL_IO_IOCTL_H_ | 6 #define LIBRARIES_NACL_IO_IOCTL_H_ |
| 7 | 7 |
| 8 /* ioctl to tell a tty mount to prefix every message with a particular | 8 /* |
| 9 * null-terminated string. Accepts a pointer to a C string which will | 9 * ioctl to feed input to a tty node. Accepts a pointer to the following |
| 10 * be the prefix. | |
| 11 */ | |
| 12 #define TIOCNACLPREFIX 0xadcd01 | |
| 13 | |
| 14 /* ioctl to feed input to a tty mount. Accepts a pointer to the following | |
| 15 * struct (tioc_nacl_input_string), which contains a pointer to an array | 10 * struct (tioc_nacl_input_string), which contains a pointer to an array |
| 16 * of characters. | 11 * of characters. |
| 17 */ | 12 */ |
| 18 #define TIOCNACLINPUT 0xadcd02 | 13 #define TIOCNACLINPUT 0xadcd02 |
| 19 | 14 |
| 15 /* | |
| 16 * ioctl to register an output handler with the tty node. Will fail | |
| 17 * 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
| |
| 18 * 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.
| |
| 19 */ | |
| 20 #define TIOCNACLOUTPUT 0xadcd03 | |
| 21 | |
| 20 struct tioc_nacl_input_string { | 22 struct tioc_nacl_input_string { |
| 21 size_t length; | 23 size_t length; |
| 22 const char* buffer; | 24 const char* buffer; |
| 23 }; | 25 }; |
| 24 | 26 |
| 27 | |
| 28 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.
| |
| 29 | |
| 30 | |
| 25 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ | 31 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ |
| OLD | NEW |