mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:52:43 +00:00 
			
		
		
		
	 8a854ba309
			
		
	
	
		8a854ba309
		
	
	
	
	
		
			
			Implement futimes() in terms of utimensat(). Now, utimensat() strays from POSIX compliance because it also accepts a combination of a file descriptor of a regular file and an empty path. utimensat() then uses this file descriptor instead of the path to update the last access and/or modification time of a file. That being said, its prior behavior remains intact. With the new behavior of utimensat(), `path` must point to a valid string; given a null pointer instead of an empty string, utimensat() sets `errno` to `EFAULT` and returns a failure.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			768 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			768 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <Kernel/API/POSIX/sys/stat.h>
 | |
| #include <sys/cdefs.h>
 | |
| #include <sys/types.h>
 | |
| #include <time.h>
 | |
| 
 | |
| __BEGIN_DECLS
 | |
| 
 | |
| mode_t umask(mode_t);
 | |
| int chmod(char const* pathname, mode_t);
 | |
| int fchmodat(int fd, char const* path, mode_t mode, int flag);
 | |
| int fchmod(int fd, mode_t);
 | |
| int mkdir(char const* pathname, mode_t);
 | |
| int mkfifo(char const* pathname, mode_t);
 | |
| int fstat(int fd, struct stat* statbuf);
 | |
| int lstat(char const* path, struct stat* statbuf);
 | |
| int stat(char const* path, struct stat* statbuf);
 | |
| int fstatat(int fd, char const* path, struct stat* statbuf, int flags);
 | |
| int futimens(int fd, struct timespec const times[2]);
 | |
| 
 | |
| __END_DECLS
 |