Added utimes() implementation.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-01 11:02:32 +00:00
parent 0354c3c2d5
commit 21470984c8
2 changed files with 26 additions and 0 deletions

View File

@ -18,5 +18,6 @@ MergeObject posix_sys.o :
uio.c
umask.c
uname.c
utimes.c
wait.c
;

View File

@ -0,0 +1,25 @@
/*
* Copyright 2006, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include <sys/time.h>
#include <utime.h>
int
utimes(const char *file, const struct timeval times[2])
{
struct utimbuf buffer, *timeBuffer;
if (times != NULL) {
timeBuffer = &buffer;
buffer.actime = times[0].tv_sec + times[0].tv_usec / 1000000LL;
buffer.modtime = times[1].tv_sec + times[1].tv_usec / 1000000LL;
} else
timeBuffer = NULL;
return utime(file, timeBuffer);
}