Added utimes() implementation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0354c3c2d5
commit
21470984c8
@ -18,5 +18,6 @@ MergeObject posix_sys.o :
|
||||
uio.c
|
||||
umask.c
|
||||
uname.c
|
||||
utimes.c
|
||||
wait.c
|
||||
;
|
||||
|
25
src/system/libroot/posix/sys/utimes.c
Normal file
25
src/system/libroot/posix/sys/utimes.c
Normal 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user