From d6aa3abb4faf78264d317e2ce48415fd41ea13ee Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 22 Oct 2014 19:03:02 +0000 Subject: [PATCH] * common.din (stime): Export. * times.cc (stime): New function. * include/cygwin/time.h (stime): Declare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/common.din | 1 + winsup/cygwin/include/cygwin/time.h | 2 ++ winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/release/1.7.33 | 2 ++ winsup/cygwin/times.cc | 8 ++++++++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 04f73f839..e76964a9d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2014-10-22 Yaakov Selkowitz + + * common.din (stime): Export. + * times.cc (stime): New function. + * include/cygwin/time.h (stime): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + 2014-10-21 Corinna Vinschen * sec_auth.cc (get_user_groups): Remove experimental exception handler diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index 1c2304631..95d6a7d98 100644 --- a/winsup/cygwin/common.din +++ b/winsup/cygwin/common.din @@ -1109,6 +1109,7 @@ sscanf SIGFE stat SIGFE statfs SIGFE statvfs SIGFE +stime SIGFE stpcpy NOSIGFE stpncpy NOSIGFE strcasecmp NOSIGFE diff --git a/winsup/cygwin/include/cygwin/time.h b/winsup/cygwin/include/cygwin/time.h index 3dbc372a3..6a82ae657 100644 --- a/winsup/cygwin/include/cygwin/time.h +++ b/winsup/cygwin/include/cygwin/time.h @@ -26,6 +26,8 @@ time_t __cdecl timegm (struct tm *); #ifndef __STRICT_ANSI__ +extern int stime (const time_t *); + extern int daylight __asm__ (_SYMSTR (_daylight)); #ifndef __timezonefunc__ diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index fab6f641c..813220e61 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -454,12 +454,13 @@ details. */ 276: Export ffsl, ffsll. 277: Add setsockopt(SO_PEERCRED). 278: Add quotactl. + 279: Export stime. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 278 +#define CYGWIN_VERSION_API_MINOR 279 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/release/1.7.33 b/winsup/cygwin/release/1.7.33 index 08df1435e..5a542a85d 100644 --- a/winsup/cygwin/release/1.7.33 +++ b/winsup/cygwin/release/1.7.33 @@ -24,6 +24,8 @@ What's new: - New APIs: ffsl, ffsll (glibc extensions). +- New API: stime (SVr4). + What changed: ------------- diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index cbff13c77..bd8f1cf0e 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -139,6 +139,14 @@ settimeofday (const struct timeval *tv, const struct timezone *tz) return res; } +/* stime: SVr4 */ +extern "C" int +stime (const time_t *t) +{ + struct timeval tv = { *t, 0 }; + return settimeofday(&tv, NULL); +} + /* timezone: standards? */ extern "C" char * timezone (void)