summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-21 21:43:37 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-21 21:43:37 +0200
commitaf81645a2a085ab6b6f44098d54231e48d575852 (patch)
tree59fee931c640f98eb4d615abaab641298f758949 /Libraries/LibC
parent0ef13e60b01975f23b9597f378704d3e19644ad5 (diff)
downloadserenity-af81645a2a085ab6b6f44098d54231e48d575852.zip
Kernel+LibC: Add a dbgputstr() syscall for sending strings to debug output.
This is very handy for the DebugLogStream implementation, among others. :^)
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/stdio.cpp6
-rw-r--r--Libraries/LibC/stdio.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp
index 2ce4a8ab5b..b1288a5780 100644
--- a/Libraries/LibC/stdio.cpp
+++ b/Libraries/LibC/stdio.cpp
@@ -488,6 +488,12 @@ void dbgputch(char ch)
syscall(SC_dbgputch, ch);
}
+int dbgputstr(const char* characters, int length)
+{
+ int rc = syscall(SC_dbgputstr, characters, length);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
+
char* tmpnam(char*)
{
ASSERT_NOT_REACHED();
diff --git a/Libraries/LibC/stdio.h b/Libraries/LibC/stdio.h
index dd166acf20..18214fb0e8 100644
--- a/Libraries/LibC/stdio.h
+++ b/Libraries/LibC/stdio.h
@@ -79,6 +79,7 @@ int fprintf(FILE*, const char* fmt, ...);
int printf(const char* fmt, ...);
int dbgprintf(const char* fmt, ...);
void dbgputch(char);
+int dbgputstr(const char*, ssize_t);
int sprintf(char* buffer, const char* fmt, ...);
int snprintf(char* buffer, size_t, const char* fmt, ...);
int putchar(int ch);