|
Packit Service |
c30d13 |
/* Set the access and modification time of an open fd.
|
|
Packit Service |
c30d13 |
Copyright (C) 2009-2018 Free Software Foundation, Inc.
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
c30d13 |
it under the terms of the GNU General Public License as published by
|
|
Packit Service |
c30d13 |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
c30d13 |
(at your option) any later version.
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
c30d13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
c30d13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
c30d13 |
GNU General Public License for more details.
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
You should have received a copy of the GNU General Public License
|
|
Packit Service |
c30d13 |
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
/* written by Eric Blake */
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
#include <config.h>
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
#include <sys/stat.h>
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
#include "utimens.h"
|
|
Packit Service |
c30d13 |
|
|
Packit Service |
c30d13 |
/* Set the access and modification timestamps of FD to be
|
|
Packit Service |
c30d13 |
TIMESPEC[0] and TIMESPEC[1], respectively.
|
|
Packit Service |
c30d13 |
Fail with ENOSYS on systems without futimes (or equivalent).
|
|
Packit Service |
c30d13 |
If TIMESPEC is null, set the timestamps to the current time.
|
|
Packit Service |
c30d13 |
Return 0 on success, -1 (setting errno) on failure. */
|
|
Packit Service |
c30d13 |
int
|
|
Packit Service |
c30d13 |
futimens (int fd, struct timespec const times[2])
|
|
Packit Service |
c30d13 |
{
|
|
Packit Service |
c30d13 |
/* fdutimens also works around bugs in native futimens, when running
|
|
Packit Service |
c30d13 |
with glibc compiled against newer headers but on a Linux kernel
|
|
Packit Service |
c30d13 |
older than 2.6.32. */
|
|
Packit Service |
c30d13 |
return fdutimens (fd, NULL, times);
|
|
Packit Service |
c30d13 |
}
|