Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-11-07 00:31:24 +0300
committerCorinna Vinschen <corinna@vinschen.de>2003-11-07 00:31:24 +0300
commit3e68e19f056aa97f40dce239f0475bebc88441d7 (patch)
tree8869e9aa5574653dc80b7c00e999199b55286ff7 /winsup
parent6ef3b76be2d7620e8f495cf5654f0359a1ca178d (diff)
* bsdlib.cc (_vwarnx): New function.
(vwarn): Ditto. (vwarnx): Ditto. (warn): Ditto. (warnx): Ditto. (verr): Ditto. (verrx): Ditto. (err): Ditto. (errx): Ditto. * cygwin.din: Export above functions. * include/err.h: New file. * include/cygwin/version.h: Bump API minor number.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog15
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/include/err.h33
-rw-r--r--winsup/cygwin/libc/bsdlib.cc73
4 files changed, 123 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a27b21573..02446f9a0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,20 @@
2003-11-06 Corinna Vinschen <corinna@vinschen.de>
+ * bsdlib.cc (_vwarnx): New function.
+ (vwarn): Ditto.
+ (vwarnx): Ditto.
+ (warn): Ditto.
+ (warnx): Ditto.
+ (verr): Ditto.
+ (verrx): Ditto.
+ (err): Ditto.
+ (errx): Ditto.
+ * cygwin.din: Export above functions.
+ * include/err.h: New file.
+ * include/cygwin/version.h: Bump API minor number.
+
+2003-11-06 Corinna Vinschen <corinna@vinschen.de>
+
* syscalls.cc (getshmlba): New function.
* external.cc (cygwin_internal): Add CW_GET_SHMLBA handling.
* mmap.cc (mmap64): Call getshmlba to evaluate granularity.
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index d26ec4bc8..d692a397e 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -225,13 +225,14 @@ details. */
98: Export _tmpfile64.
99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc.
100: CW_GET_SHMLBA addition to external.cc.
+ 101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 100
+#define CYGWIN_VERSION_API_MINOR 101
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/err.h b/winsup/cygwin/include/err.h
new file mode 100644
index 000000000..d1002c527
--- /dev/null
+++ b/winsup/cygwin/include/err.h
@@ -0,0 +1,33 @@
+/* err.h
+
+ Copyright 2003 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _ERR_H
+#define _ERR_H
+
+#include <sys/cdefs.h>
+#include <stdarg.h>
+
+__BEGIN_DECLS
+
+extern void warn (const char *fmt, ...);
+extern void warnx (const char *fmt, ...);
+
+extern void err (int eval, const char *fmt, ...);
+extern void errx (int eval, const char *fmt, ...);
+
+extern void vwarn (const char *fmt, va_list ap);
+extern void vwarnx (const char *fmt, va_list ap);
+
+extern void verr (int eval, const char *fmt, va_list ap);
+extern void verrx (int eval, const char *fmt, va_list ap);
+
+__END_DECLS
+
+#endif /* _ERR_H */
diff --git a/winsup/cygwin/libc/bsdlib.cc b/winsup/cygwin/libc/bsdlib.cc
index acf43adbf..6d2375331 100644
--- a/winsup/cygwin/libc/bsdlib.cc
+++ b/winsup/cygwin/libc/bsdlib.cc
@@ -31,7 +31,9 @@
*/
#include "winsup.h"
+#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <utmp.h>
#include <unistd.h>
#include <sys/termios.h>
@@ -163,3 +165,74 @@ forkpty (int *amaster, char *name, struct termios *termp, struct winsize *winp)
return pid;
}
+extern "C" char *__progname;
+
+static void
+_vwarnx (const char *fmt, va_list ap)
+{
+ fprintf (stderr, "%s: ", __progname);
+ vfprintf (stderr, fmt, ap);
+}
+
+extern "C" void
+vwarn (const char *fmt, va_list ap)
+{
+ _vwarnx (fmt, ap);
+ fprintf (stderr, ": %s", strerror (get_errno ()));
+ fputc ('\n', stderr);
+}
+
+extern "C" void
+vwarnx (const char *fmt, va_list ap)
+{
+ _vwarnx (fmt, ap);
+ fputc ('\n', stderr);
+}
+
+extern "C" void
+warn (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vwarn (fmt, ap);
+}
+
+extern "C" void
+warnx (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vwarnx (fmt, ap);
+}
+
+extern "C" void
+verr (int eval, const char *fmt, va_list ap)
+{
+ vwarn (fmt, ap);
+ exit (eval);
+}
+
+extern "C" void
+verrx (int eval, const char *fmt, va_list ap)
+{
+ vwarnx (fmt, ap);
+ exit (eval);
+}
+
+extern "C" void
+err (int eval, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vwarn (fmt, ap);
+ exit (eval);
+}
+
+extern "C" void
+errx (int eval, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vwarnx (fmt, ap);
+ exit (eval);
+}