diff --git a/src/system/libroot/posix/sys/Jamfile b/src/system/libroot/posix/sys/Jamfile index 992a516e3f..a71576c48a 100644 --- a/src/system/libroot/posix/sys/Jamfile +++ b/src/system/libroot/posix/sys/Jamfile @@ -18,5 +18,6 @@ MergeObject posix_sys.o : uio.c umask.c uname.c + utimes.c wait.c ; diff --git a/src/system/libroot/posix/sys/utimes.c b/src/system/libroot/posix/sys/utimes.c new file mode 100644 index 0000000000..00b442b48c --- /dev/null +++ b/src/system/libroot/posix/sys/utimes.c @@ -0,0 +1,25 @@ +/* + * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include +#include + + +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); +} +