2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-06-07 12:49:03 +03:00
|
|
|
#include <errno.h>
|
2020-01-06 14:23:30 +03:00
|
|
|
#include <string.h>
|
2021-02-05 14:16:30 +03:00
|
|
|
#include <syscall.h>
|
2019-06-07 12:49:03 +03:00
|
|
|
#include <utime.h>
|
2018-12-19 23:14:55 +03:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
int utime(char const* pathname, const struct utimbuf* buf)
|
2018-12-19 23:14:55 +03:00
|
|
|
{
|
2020-01-06 14:23:30 +03:00
|
|
|
if (!pathname) {
|
|
|
|
errno = EFAULT;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
int rc = syscall(SC_utime, pathname, strlen(pathname), buf);
|
2018-12-19 23:14:55 +03:00
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
|
|
}
|
|
|
|
}
|