xref: /aosp_15_r20/external/ltp/m4/ltp-utimensat.m4 (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Workerdnl SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Workerdnl Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
3*49cdfc7eSAndroid Build Coastguard Worker
4*49cdfc7eSAndroid Build Coastguard WorkerAC_DEFUN([LTP_CHECK_SYSCALL_UTIMENSAT],[
5*49cdfc7eSAndroid Build Coastguard Worker	AC_MSG_CHECKING([for utimensat])
6*49cdfc7eSAndroid Build Coastguard Worker	AC_LINK_IFELSE([AC_LANG_SOURCE([
7*49cdfc7eSAndroid Build Coastguard Worker#include <stdlib.h>
8*49cdfc7eSAndroid Build Coastguard Worker#include <sys/stat.h>
9*49cdfc7eSAndroid Build Coastguard Worker#include <fcntl.h>
10*49cdfc7eSAndroid Build Coastguard Worker
11*49cdfc7eSAndroid Build Coastguard Workerint main(void) {
12*49cdfc7eSAndroid Build Coastguard Worker	long tv_nsec;
13*49cdfc7eSAndroid Build Coastguard Worker	tv_nsec = UTIME_NOW;
14*49cdfc7eSAndroid Build Coastguard Worker	tv_nsec = UTIME_OMIT;
15*49cdfc7eSAndroid Build Coastguard Worker
16*49cdfc7eSAndroid Build Coastguard Worker	return utimensat(AT_FDCWD, NULL, NULL, 0);
17*49cdfc7eSAndroid Build Coastguard Worker}])],[has_utimensat="yes"])
18*49cdfc7eSAndroid Build Coastguard Worker
19*49cdfc7eSAndroid Build Coastguard Workerif test "x$has_utimensat" = "xyes"; then
20*49cdfc7eSAndroid Build Coastguard Worker	AC_DEFINE(HAVE_UTIMENSAT, 1, [Define to 1 if you have utimensat(2)])
21*49cdfc7eSAndroid Build Coastguard Worker	AC_MSG_RESULT(yes)
22*49cdfc7eSAndroid Build Coastguard Workerelse
23*49cdfc7eSAndroid Build Coastguard Worker	AC_MSG_RESULT(no)
24*49cdfc7eSAndroid Build Coastguard Workerfi
25*49cdfc7eSAndroid Build Coastguard Worker])
26