diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-06-06 08:11:19 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-06-06 08:11:19 +0000 |
commit | 54152c7e7ed656c969fe4536f17f66360cd8d971 (patch) | |
tree | 458098c0f911a990200369579ba4cb845e16c5c8 | |
parent | b0ad6f2ba5308778b0ce6ab3563d349fb5f919be (diff) | |
download | newlib-54152c7e7ed656c969fe4536f17f66360cd8d971.zip newlib-54152c7e7ed656c969fe4536f17f66360cd8d971.tar.gz newlib-54152c7e7ed656c969fe4536f17f66360cd8d971.tar.bz2 |
* cygwin.din: Add vsyslog.
* fhandler.cc (fhandler_base::write): Only make file sparse if the
seeked area is >= 128K.
* syslog.cc (vsyslog): New function, overtaking functionality from
syslog.
(syslog): Just call vsyslog.
* include/cygwin/version.h: Bump API minor.
* include/sys/syslog.h: Add vsyslog declaration.
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/cygwin.din | 1 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/syslog.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/syslog.cc | 15 |
6 files changed, 28 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fdce9f4..1588f36 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2003-06-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add vsyslog. + * fhandler.cc (fhandler_base::write): Only make file sparse if the + seeked area is >= 128K. + * syslog.cc (vsyslog): New function, overtaking functionality from + syslog. + (syslog): Just call vsyslog. + * include/cygwin/version.h: Bump API minor. + * include/sys/syslog.h: Add vsyslog declaration. + 2003-06-05 Christopher Faylor <cgf@redhat.com> * cygthread.cc (cygthread::terminate_thread): Change system_printf to diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din index 7cfe275..4deddb8 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -1300,6 +1300,7 @@ sysconf _sysconf = sysconf syslog _syslog = syslog +vsyslog system _system = system tan diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index ac0dfd5..8142cfa 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -629,7 +629,7 @@ fhandler_base::write (const void *ptr, size_t len) if (current_position > actual_length) { if ((get_fs_flags (FILE_SUPPORTS_SPARSE_FILES)) - && current_position >= actual_length + (64 * 1024)) + && current_position >= actual_length + (128 * 1024)) { /* If the file systemn supports sparse files and the application is writing after a long seek beyond EOF, convert the file to diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 50646dc..6caafea 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -206,12 +206,13 @@ details. */ official release has been made so far. This change removes exported symbols like fopen64, which might confuse configure. 86: Export ftok + 87: Export vsyslog */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 86 +#define CYGWIN_VERSION_API_MINOR 87 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/syslog.h b/winsup/cygwin/include/sys/syslog.h index f319517..a37b042 100644 --- a/winsup/cygwin/include/sys/syslog.h +++ b/winsup/cygwin/include/sys/syslog.h @@ -12,6 +12,8 @@ details. */ #define _SYS_LOG_H #include <sys/cdefs.h> +#include <stdarg.h> + #define LOG_EMERG 0 #define LOG_ALERT 1 #define LOG_CRIT 2 @@ -76,6 +78,7 @@ void closelog (void); void openlog (const char *, int, int); int setlogmask (int); void syslog (int, const char *, ...); +void vsyslog (int, const char *, va_list ap); __END_DECLS diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc index b396405..b87ff66 100644 --- a/winsup/cygwin/syslog.cc +++ b/winsup/cygwin/syslog.cc @@ -208,7 +208,7 @@ pass_handler::print_va (const char *fmt, va_list list) */ extern "C" void -syslog (int priority, const char *message, ...) +vsyslog (int priority, const char *message, va_list ap) { debug_printf ("%x %s", priority, message); /* If the priority fails the current mask, reject */ @@ -281,8 +281,6 @@ syslog (int priority, const char *message, ...) output, then do it again to a malloc'ed string. This is ugly, slow, but prevents core dumps :-). */ - va_list ap; - pass_handler pass; for (int pass_number = 0; pass_number < 2; ++pass_number) { @@ -341,10 +339,8 @@ syslog (int priority, const char *message, ...) } /* Print out the variable part */ - va_start (ap, message); if (pass.print_va (message, ap) == -1) return; - va_end (ap); } const char *msg_strings[1]; @@ -409,6 +405,15 @@ syslog (int priority, const char *message, ...) } extern "C" void +syslog (int priority, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + vsyslog (priority, message, ap); + va_end (ap); +} + +extern "C" void closelog (void) { ; |