diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-12 01:28:46 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-12 01:28:46 +0100 |
commit | f1404aa9484e1a38b0924f74ac8b5796faf5c77a (patch) | |
tree | be571507f54f885aca4eddd0a8bc03f2ada4ee04 /LibC | |
parent | 18e3ddf6058d86f22df9fd90f6ad7f3a3833909f (diff) | |
download | serenity-f1404aa9484e1a38b0924f74ac8b5796faf5c77a.zip |
Add primitive FIFO and hook it up to sys$pipe().
It's now possible to do this in bash:
cat kernel.map | fgrep List
This is very cool! :^)
Diffstat (limited to 'LibC')
-rw-r--r-- | LibC/stdio.cpp | 1 | ||||
-rw-r--r-- | LibC/termcap.cpp | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index 86adf972eb..d53eb50311 100644 --- a/LibC/stdio.cpp +++ b/LibC/stdio.cpp @@ -45,7 +45,6 @@ void __stdio_init() int setvbuf(FILE* stream, char* buf, int mode, size_t size) { - fprintf(stderr, "setvbuf(%p [fd=%d], %p, %d, %u)\n", stream, stream->fd, buf, mode, size); if (mode != _IONBF && mode != _IOLBF && mode != _IOFBF) { errno = EINVAL; return -1; diff --git a/LibC/termcap.cpp b/LibC/termcap.cpp index 9dbd7a7dc3..d422d47697 100644 --- a/LibC/termcap.cpp +++ b/LibC/termcap.cpp @@ -5,6 +5,8 @@ #include <AK/HashMap.h> #include <AK/String.h> +//#define TERMCAP_DEBUG + extern "C" { char PC; @@ -13,7 +15,9 @@ char* BC; int tgetent(char* bp, const char* name) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetent: bp=%p, name='%s'\n", bp, name); +#endif if (!strcmp(name, "ansi")) { PC = '\0'; BC = const_cast<char*>("\033[D"); @@ -60,7 +64,9 @@ void ensure_caps() char* tgetstr(char* id, char** area) { ensure_caps(); - fprintf(stderr, "tgetstr: id='%s', area=%p", id, area); +#ifdef TERMCAP_DEBUG + fprintf(stderr, "tgetstr: id='%s'\n", id); +#endif auto it = caps->find(id); if (it != caps->end()) { char* ret = *area; @@ -74,7 +80,9 @@ char* tgetstr(char* id, char** area) int tgetflag(char* id) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetflag: '%s'\n", id); +#endif auto it = caps->find(id); if (it != caps->end()) return 1; @@ -83,11 +91,12 @@ int tgetflag(char* id) int tgetnum(char* id) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetnum: '%s'\n", id); +#endif auto it = caps->find(id); - if (it != caps->end()) { + if (it != caps->end()) return atoi((*it).value); - } assert(false); } |