mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Add pseudoteletypewriter to emulator
https://justine.storage.googleapis.com/emulator628.mp4
This commit is contained in:
parent
e86cff8ba0
commit
5aabacb361
94 changed files with 3245 additions and 2179 deletions
|
@ -17,6 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "dsp/tty/tty.h"
|
||||
#include "libc/alg/arraylist2.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
|
@ -57,12 +58,5 @@ void AppendFmt(struct Buffer *b, const char *fmt, ...) {
|
|||
* Writes buffer until completion, interrupt, or error occurs.
|
||||
*/
|
||||
ssize_t WriteBuffer(struct Buffer *b, int fd) {
|
||||
size_t i;
|
||||
ssize_t rc;
|
||||
for (i = 0; i < b->i; i += rc) {
|
||||
if ((rc = write(fd, b->p + i, b->i - i)) == -1) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
return ttywrite(fd, b->p, b->i);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue