IRC.
[hurd-web.git] / microkernel / mach / gnumach / interface / syscall / mach_print / main.c
diff --git a/microkernel/mach/gnumach/interface/syscall/mach_print/main.c b/microkernel/mach/gnumach/interface/syscall/mach_print/main.c
new file mode 100644 (file)
index 0000000..23b9fc8
--- /dev/null
@@ -0,0 +1,21 @@
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void mach_print(char *);
+
+int
+main(int argc, char *argv[])
+{
+    int size;
+    char *s;
+
+    size = snprintf(NULL, 0, "%s\n", argv[1]);
+    assert(size > 0);
+    s = malloc(size);
+    assert(s != NULL);
+    sprintf(s, "%s\n", argv[1]);
+    mach_print(s);
+    free(s);
+    return EXIT_SUCCESS;
+}