ladybird/Userland/Libraries/LibC/utime.cpp

24 lines
448 B
C++
Raw Normal View History

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