WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] stubdom: add v?errx? and v?warnx? functio

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] stubdom: add v?errx? and v?warnx? functions
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Aug 2008 11:24:03 -0700
Delivery-date: Wed, 27 Aug 2008 11:25:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1219845471 -3600
# Node ID 7a28400271f7b1c8f4a162ba1352d269389067fa
# Parent  03bdbb7e7add2885ab1ec20e0b1eb0817d8dee64
stubdom: add v?errx? and v?warnx? functions

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 extras/mini-os/include/posix/err.h |   15 ++++++++
 extras/mini-os/lib/sys.c           |   62 +++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff -r 03bdbb7e7add -r 7a28400271f7 extras/mini-os/include/posix/err.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/posix/err.h        Wed Aug 27 14:57:51 2008 +0100
@@ -0,0 +1,15 @@
+#ifndef _POSIX_ERR_H
+#define _POSIX_ERR_H
+
+#include <stdarg.h>
+
+void err(int eval, const char *fmt, ...);
+void errx(int eval, const char *fmt, ...);
+void warn(const char *fmt, ...);
+void warnx(const char *fmt, ...);
+void verr(int eval, const char *fmt, va_list args);
+void verrx(int eval, const char *fmt, va_list args);
+void vwarn(const char *fmt, va_list args);
+void vwarnx(const char *fmt, va_list args);
+
+#endif /* _POSIX_ERR_H */
diff -r 03bdbb7e7add -r 7a28400271f7 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Wed Aug 27 14:57:23 2008 +0100
+++ b/extras/mini-os/lib/sys.c  Wed Aug 27 14:57:51 2008 +0100
@@ -1035,6 +1035,68 @@ void closelog(void)
     syslog_ident = NULL;
 }
 
+void vwarn(const char *format, va_list ap)
+{
+    int the_errno = errno;
+    printk("stubdom: ");
+    if (format) {
+        print(0, format, ap);
+        printk(", ");
+    }
+    printk("%s", strerror(the_errno));
+}
+
+void warn(const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    vwarn(format, ap);
+    va_end(ap);
+}
+
+void verr(int eval, const char *format, va_list ap)
+{
+    vwarn(format, ap);
+    exit(eval);
+}
+
+void err(int eval, const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    verr(eval, format, ap);
+    va_end(ap);
+}
+
+void vwarnx(const char *format, va_list ap)
+{
+    printk("stubdom: ");
+    if (format)
+        print(0, format, ap);
+}
+
+void warnx(const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    vwarnx(format, ap);
+    va_end(ap);
+}
+
+void verrx(int eval, const char *format, va_list ap)
+{
+    vwarnx(format, ap);
+    exit(eval);
+}
+
+void errx(int eval, const char *format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    verrx(eval, format, ap);
+    va_end(ap);
+}
+
 int nanosleep(const struct timespec *req, struct timespec *rem)
 {
     s_time_t start = NOW();

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] stubdom: add v?errx? and v?warnx? functions, Xen patchbot-unstable <=