1 /* @(#)futimesat.c	1.2 13/10/30 Copyright 2013 J. Schilling */
2 /*
3  *	Emulate the behavior of futimesat(int fd, const char *name,
4  *					const struct timeval times[2])
5  *
6  *	Note that emulation methods that do not use the /proc filesystem are
7  *	not MT safe. In the non-MT-safe case, we do:
8  *
9  *		savewd()/fchdir()/open(name)/restorewd()
10  *
11  *	Errors may force us to abort the program as our caller is not expected
12  *	to know that we do more than a simple open() here and that the
13  *	working directory may be changed by us.
14  *
15  *	Copyright (c) 2013 J. Schilling
16  */
17 /*
18  * The contents of this file are subject to the terms of the
19  * Common Development and Distribution License, Version 1.0 only
20  * (the "License").  You may not use this file except in compliance
21  * with the License.
22  *
23  * See the file CDDL.Schily.txt in this distribution for details.
24  * A copy of the CDDL is also available via the Internet at
25  * http://www.opensource.org/licenses/cddl1.txt
26  *
27  * When distributing Covered Code, include this CDDL HEADER in each
28  * file and include the License file CDDL.Schily.txt from this distribution.
29  */
30 
31 #include <schily/unistd.h>
32 #include <schily/types.h>
33 #include <schily/time.h>
34 #include <schily/fcntl.h>
35 #include <schily/maxpath.h>
36 #include <schily/errno.h>
37 #include <schily/standard.h>
38 #include <schily/schily.h>
39 #include "at-defs.h"
40 
41 #ifndef	HAVE_FUTIMESAT
42 
43 /* CSTYLED */
44 #define	PROTO_DECL	, const struct timeval times[2]
45 #define	KR_DECL		const struct timeval times[2];
46 /* CSTYLED */
47 #define	KR_ARGS		, times
48 #define	FUNC_CALL(n)	utimes(n, times)
49 #define	FLAG_CHECK()
50 #define	FUNC_NAME	futimesat
51 #define	FUNC_RESULT	int
52 
53 #include "at-base.c"
54 
55 #endif	/* HAVE_FUTIMESAT */
56