* cygwin.din (futimes): Export.

(lutimes): Export.
	* times.cc (utimes_worker): Created from utimes, add nofollow flag
	to implement utimes and lutimes.
	(utimes): Just call utimes_worker.
	(lutimes): New function.
	(futimes): Ditto.
	* include/cygwin/version.h: Bump API minor version.
This commit is contained in:
Corinna Vinschen 2005-10-20 14:26:23 +00:00
parent af18e12c9f
commit 81bd1ca723
4 changed files with 47 additions and 5 deletions

View File

@ -1,3 +1,14 @@
2005-10-20 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din (futimes): Export.
(lutimes): Export.
* times.cc (utimes_worker): Created from utimes, add nofollow flag
to implement utimes and lutimes.
(utimes): Just call utimes_worker.
(lutimes): New function.
(futimes): Ditto.
* include/cygwin/version.h: Bump API minor version.
2005-10-19 Christopher Faylor <cgf@timesys.com>
* sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower.

View File

@ -1522,6 +1522,8 @@ utime SIGFE
_utime = utime SIGFE
utimes SIGFE
_utimes = utimes SIGFE
futimes SIGFE
lutimes SIGFE
utmpname SIGFE
_utmpname = utmpname SIGFE
utmpxname SIGFE

View File

@ -278,12 +278,13 @@ details. */
139: Start using POSIX definition of struct msghdr and WinSock2
IPPROTO_IP values.
140: Export mlock, munlock.
140: Export futimes, lutimes.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
#define CYGWIN_VERSION_API_MINOR 140
#define CYGWIN_VERSION_API_MINOR 141
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible

View File

@ -441,12 +441,11 @@ gmtime (const time_t *tim_p)
#endif /* POSIX_LOCALTIME */
/* utimes: POSIX/SUSv3 */
extern "C" int
utimes (const char *path, const struct timeval *tvp)
static int
utimes_worker (const char *path, const struct timeval *tvp, int nofollow)
{
int res = -1;
path_conv win32 (path, PC_SYM_FOLLOW);
path_conv win32 (path, nofollow ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW);
fhandler_base *fh = NULL;
bool fromfd = false;
@ -482,6 +481,35 @@ error:
return res;
}
/* utimes: POSIX/SUSv3 */
extern "C" int
utimes (const char *path, const struct timeval *tvp)
{
return utimes_worker (path, tvp, 0);
}
/* BSD */
extern "C" int
lutimes (const char *path, const struct timeval *tvp)
{
return utimes_worker (path, tvp, 1);
}
/* BSD */
extern "C" int
futimes (int fd, const struct timeval *tvp)
{
int res;
cygheap_fdget cfd (fd);
if (cfd < 0)
res = -1;
else
res = cfd->utimes (tvp);
syscall_printf ("%d = futimes (%d, %p)", res, fd, tvp);
return res;
}
/* utime: POSIX 5.6.6.1 */
extern "C" int
utime (const char *path, const struct utimbuf *buf)