diff options
Diffstat (limited to 'debian/patches/0006-libshouldbeinlibc-provide-mach_print-XXX.patch')
-rw-r--r-- | debian/patches/0006-libshouldbeinlibc-provide-mach_print-XXX.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/debian/patches/0006-libshouldbeinlibc-provide-mach_print-XXX.patch b/debian/patches/0006-libshouldbeinlibc-provide-mach_print-XXX.patch new file mode 100644 index 00000000..fdf3969a --- /dev/null +++ b/debian/patches/0006-libshouldbeinlibc-provide-mach_print-XXX.patch @@ -0,0 +1,80 @@ +From 383f73297a9b1658c4c1fb2112a1d47e3e8e3c14 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Tue, 13 Jan 2015 17:18:17 +0100 +Subject: [PATCH hurd 06/11] libshouldbeinlibc: provide `mach_print' XXX + +* libshouldbeinlibc/mach-print.c: New file. +* libshouldbeinlibc/mach-print.h: Likewise. +* libshouldbeinlibc/Makefile: Add `mach-print.{c,h}'. +--- + libshouldbeinlibc/Makefile | 2 ++ + libshouldbeinlibc/mach-print.c | 30 ++++++++++++++++++++++++++++++ + libshouldbeinlibc/mach-print.h | 2 ++ + 3 files changed, 34 insertions(+) + create mode 100644 libshouldbeinlibc/mach-print.c + create mode 100644 libshouldbeinlibc/mach-print.h + +diff --git a/libshouldbeinlibc/Makefile b/libshouldbeinlibc/Makefile +index 633d60e..7a17d0e 100644 +--- a/libshouldbeinlibc/Makefile ++++ b/libshouldbeinlibc/Makefile +@@ -29,10 +29,12 @@ SRCS = termsize.c timefmt.c exec-reauth.c maptime-funcs.c \ + ugids-auth.c ugids-xinl.c ugids-merge.c ugids-imply.c ugids-posix.c \ + ugids-verify-auth.c nullauth.c \ + refcount.c \ ++ mach-print.c \ + + installhdrs = idvec.h timefmt.h maptime.h \ + wire.h portinfo.h portxlate.h cacheq.h ugids.h nullauth.h \ + refcount.h \ ++ mach-print.h \ + + installhdrsubdir = . + +diff --git a/libshouldbeinlibc/mach-print.c b/libshouldbeinlibc/mach-print.c +new file mode 100644 +index 0000000..2b31dca +--- /dev/null ++++ b/libshouldbeinlibc/mach-print.c +@@ -0,0 +1,30 @@ ++#include <stdio.h> ++#include <stdarg.h> ++ ++#define BUFFER_SIZE 1024 ++ ++void ++mach_print(const char *msg) ++{ ++ // XXX check architecture ++ asm (" pop %%eax;" ++ " push %0;" ++ " push %%eax;" ++ " mov $0xffffffe2, %%eax;" ++ " lcall $0x7, $0x0;" ++ : /* No outputs. */ ++ : "r" (msg) ++ : "eax"); ++} ++ ++void ++mach_printf (const char *format, ...) ++{ ++ va_list ap; ++ char buf[BUFFER_SIZE]; ++ ++ va_start(ap, format); ++ vsnprintf(buf, sizeof(buf), format, ap); ++ mach_print(buf); ++ va_end(ap); ++} +diff --git a/libshouldbeinlibc/mach-print.h b/libshouldbeinlibc/mach-print.h +new file mode 100644 +index 0000000..a733939 +--- /dev/null ++++ b/libshouldbeinlibc/mach-print.h +@@ -0,0 +1,2 @@ ++void mach_print(const char *); ++void mach_printf(const char *format, ...); // XXX attribute printf +-- +2.1.4 + |