Skip to contentSkip to conversation

configure.ac: Simplify the check for libc function implementations

PATCH New Xiao Yang 2 participants 5 messages Apr 5, 2019 – Apr 8, 2019

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH v3 1/3 configure.ac: Simplify the check for libc function implementations

Use AC_CHECK_HEADERS() directly if only libc function implementations need to be checked.

---
 configure.ac              | 44 ++++++++++++++++++++++----------------------
 m4/ltp-epoll_pwait.m4     | 25 -------------------------
 m4/ltp-execveat.m4        | 25 -------------------------
 m4/ltp-fallocate.m4       | 25 -------------------------
 m4/ltp-fchownat.m4        | 25 -------------------------
 m4/ltp-fstatat.m4         | 26 --------------------------
 m4/ltp-kcmp.m4            | 23 -----------------------
 m4/ltp-mkdirat.m4         | 25 -------------------------
 m4/ltp-mknodat.m4         | 25 -------------------------
 m4/ltp-openat.m4          | 25 -------------------------
 m4/ltp-preadv.m4          | 23 -----------------------
 m4/ltp-preadv2.m4         |  9 ---------
 m4/ltp-pwritev.m4         | 23 -----------------------
 m4/ltp-pwritev2.m4        |  9 ---------
 m4/ltp-readlinkat.m4      | 25 -------------------------
 m4/ltp-renameat.m4        | 25 -------------------------
 m4/ltp-renameat2.m4       | 27 ---------------------------
 m4/ltp-splice.m4          | 25 -------------------------
 m4/ltp-sync_file_range.m4 | 10 ----------
 m4/ltp-syncfs.m4          | 10 ----------
 m4/ltp-tee.m4             | 25 -------------------------
 m4/ltp-unshare.m4         | 25 -------------------------
 m4/ltp-vmsplice.m4        | 25 -------------------------
 23 files changed, 22 insertions(+), 507 deletions(-)
 delete mode 100644 m4/ltp-epoll_pwait.m4
 delete mode 100644 m4/ltp-execveat.m4
 delete mode 100644 m4/ltp-fallocate.m4
 delete mode 100644 m4/ltp-fchownat.m4
 delete mode 100644 m4/ltp-fstatat.m4
 delete mode 100644 m4/ltp-kcmp.m4
 delete mode 100644 m4/ltp-mkdirat.m4
 delete mode 100644 m4/ltp-mknodat.m4
 delete mode 100644 m4/ltp-openat.m4
 delete mode 100644 m4/ltp-preadv.m4
 delete mode 100644 m4/ltp-preadv2.m4
 delete mode 100644 m4/ltp-pwritev.m4
 delete mode 100644 m4/ltp-pwritev2.m4
 delete mode 100644 m4/ltp-readlinkat.m4
 delete mode 100644 m4/ltp-renameat.m4
 delete mode 100644 m4/ltp-renameat2.m4
 delete mode 100644 m4/ltp-splice.m4
 delete mode 100644 m4/ltp-sync_file_range.m4
 delete mode 100644 m4/ltp-syncfs.m4
 delete mode 100644 m4/ltp-tee.m4
 delete mode 100644 m4/ltp-unshare.m4
 delete mode 100644 m4/ltp-vmsplice.m4
configure.ac +22 -22
index d71d832..bc5ba74 100644
@@ -60,8 +60,30 @@ AC_CHECK_HEADERS([ \
 ])
 
 AC_CHECK_FUNCS([ \
+    epoll_pwait \
+    execveat \
+    fallocate \
+    fchownat \
+    fstatat \
+    kcmp \
+    mkdirat \
+    mknodat \
+    openat \
+    preadv \
+    preadv2 \
     profil \
+    pwritev \
+    pwritev2 \
+    readlinkat \
+    renameat \
+    renameat2 \
+    splice \
+    syncfs \
+    sync_file_range \
+    tee \
+    unshare \
     ustat \
+    vmsplice \
 ])
 
 # Tools knobs
@@ -182,7 +204,6 @@ LTP_CHECK_SYSCALL_EVENTFD
 LTP_CHECK_SYSCALL_MODIFY_LDT
 LTP_CHECK_SYSCALL_QUOTACTL
 LTP_CHECK_SYSCALL_SIGNALFD
-LTP_CHECK_SYSCALL_UNSHARE
 LTP_CHECK_SYSCALL_UTIMENSAT
 LTP_CHECK_TASKSTATS
 LTP_CHECK_TIME
@@ -193,36 +214,17 @@ LTP_CHECK_MREMAP_FIXED
 LTP_CHECK_KERNEL_DEVEL
 LTP_CHECK_XFS_QUOTACTL
 LTP_CHECK_CLONE_SUPPORTS_7_ARGS
-LTP_CHECK_MKDIRAT
-LTP_CHECK_FCHOWNAT
-LTP_CHECK_FSTATAT
-LTP_CHECK_MKNODAT
-LTP_CHECK_READLINKAT
-LTP_CHECK_OPENAT
-LTP_CHECK_EXECVEAT
-LTP_CHECK_RENAMEAT
-LTP_CHECK_RENAMEAT2
 LTP_CHECK_STATX
-LTP_CHECK_FALLOCATE
 LTP_CHECK_SYSCALL_FCNTL
 LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
 if test "x$with_tirpc" = xyes; then
 LTP_CHECK_TIRPC
 fi
-LTP_CHECK_TEE
-LTP_CHECK_SPLICE
-LTP_CHECK_VMSPLICE
 LTP_CHECK_TIMERFD
 LTP_CHECK_IOVEC
 LTP_CHECK_LINUXRANDOM
 LTP_CHECK_IF_LINK
-LTP_CHECK_KCMP
 LTP_CHECK_KCMP_TYPE
-LTP_CHECK_PREADV
-LTP_CHECK_PWRITEV
-LTP_CHECK_PREADV2
-LTP_CHECK_PWRITEV2
-LTP_CHECK_EPOLL_PWAIT
 LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_SYNC_ADD_AND_FETCH
 LTP_CHECK_BUILTIN_CLEAR_CACHE
@@ -234,8 +236,6 @@ LTP_CHECK_TPACKET_V3
 LTP_CHECK_RLIMIT64
 LTP_DETECT_HOST_CPU
 LTP_CHECK_PERF_EVENT
-LTP_CHECK_SYNCFS
-LTP_CHECK_SYNC_FILE_RANGE
 LTP_CHECK_FTS_H
 LTP_CHECK_FIDEDUPE
 
m4/ltp-epoll_pwait.m4 deleted +0 -25
deleted file mode 100644
index e918110..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) 2016 Fujitsu Ltd.
-dnl Author: Guangwen Feng <[email protected]>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program.
-dnl
-
-dnl
-dnl LTP_CHECK_EPOLL_PWAIT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_EPOLL_PWAIT],[
-AC_CHECK_FUNCS(epoll_pwait,,)
-])
m4/ltp-execveat.m4 deleted +0 -25
deleted file mode 100644
index 8cb6147..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_EXECVEAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_EXECVEAT],[
-AC_CHECK_FUNCS(execveat,,)
-])
m4/ltp-fallocate.m4 deleted +0 -25
deleted file mode 100644
index c7d509e..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_FALLOCATE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_FALLOCATE],[
-AC_CHECK_FUNCS(fallocate,,)
-])
m4/ltp-fchownat.m4 deleted +0 -25
deleted file mode 100644
index a46a397..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_FCHOWNAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_FCHOWNAT],[
-AC_CHECK_FUNCS(fchownat,,)
-])
m4/ltp-fstatat.m4 deleted +0 -26
deleted file mode 100644
index 8814ade..0000000
@@ -1,26 +0,0 @@
-dnl
-dnl Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
-dnl
-dnl Author: Alexey Kodanev <[email protected]>
-dnl
-
-dnl
-dnl LTP_CHECK_FSTATAT
-dnl -----------------
-dnl
-AC_DEFUN([LTP_CHECK_FSTATAT],[
-AC_CHECK_FUNCS(fstatat,,)
-])
m4/ltp-kcmp.m4 deleted +0 -23
deleted file mode 100644
index 70bf375..0000000
@@ -1,23 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2015
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software Foundation,
-dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-dnl Author: Cedric Hnyda <[email protected]>
-dnl
-
-AC_DEFUN([LTP_CHECK_KCMP],[
-AC_CHECK_FUNCS(kcmp,,)
-])
m4/ltp-mkdirat.m4 deleted +0 -25
deleted file mode 100644
index 40786c3..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_MKDIRAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_MKDIRAT],[
-AC_CHECK_FUNCS(mkdirat,,)
-])
m4/ltp-mknodat.m4 deleted +0 -25
deleted file mode 100644
index 1ec22c7..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_MKNODAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_MKNODAT],[
-AC_CHECK_FUNCS(mknodat,,)
-])
m4/ltp-openat.m4 deleted +0 -25
deleted file mode 100644
index aa3b0a3..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_OPENAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_OPENAT],[
-AC_CHECK_FUNCS(openat,,)
-])
m4/ltp-preadv.m4 deleted +0 -23
deleted file mode 100644
index 2046902..0000000
@@ -1,23 +0,0 @@
-dnl
-dnl Copyright (c) 2015 Fujitsu Ltd.
-dnl Author: Xiao Yang <[email protected]>
-dnl
-dnl This program is free software; you can redistribute it and/or modify it
-dnl under the terms of version 2 of the GNU General Public License as
-dnl published by the Free Software Foundation.
-dnl
-dnl This program is distributed in the hope that it would be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl alone with this program.
-dnl
-
-dnl
-dnl LTP_CHECK_PREADV
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_PREADV],[
-AC_CHECK_FUNCS(preadv,,)
-])
m4/ltp-preadv2.m4 deleted +0 -9
deleted file mode 100644
index a1e5327..0000000
@@ -1,9 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
-dnl Author: Xiao Yang <[email protected]>
-
-dnl LTP_CHECK_PREADV2
-dnl ----------------------------
-AC_DEFUN([LTP_CHECK_PREADV2],[
-AC_CHECK_FUNCS(preadv2,,)
-])
m4/ltp-pwritev.m4 deleted +0 -23
deleted file mode 100644
index 6565332..0000000
@@ -1,23 +0,0 @@
-dnl
-dnl Copyright (c) 2015 Fujitsu Ltd.
-dnl Author: Xiao Yang <[email protected]>
-dnl
-dnl This program is free software; you can redistribute it and/or modify it
-dnl under the terms of version 2 of the GNU General Public License as
-dnl published by the Free Software Foundation.
-dnl
-dnl This program is distributed in the hope that it would be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl alone with this program.
-dnl
-
-dnl
-dnl LTP_CHECK_PWRITEV
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_PWRITEV],[
-AC_CHECK_FUNCS(pwritev,,)
-])
m4/ltp-pwritev2.m4 deleted +0 -9
deleted file mode 100644
index 38148ac..0000000
@@ -1,9 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
-dnl Author: Jinhui Huang <[email protected]>
-
-dnl LTP_CHECK_PWRITEV2
-dnl ----------------------------
-AC_DEFUN([LTP_CHECK_PWRITEV2],[
-AC_CHECK_FUNCS(pwritev2,,)
-])
m4/ltp-readlinkat.m4 deleted +0 -25
deleted file mode 100644
index 6866f3b..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_READLINKAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_READLINKAT],[
-AC_CHECK_FUNCS(readlinkat,,)
-])
m4/ltp-renameat.m4 deleted +0 -25
deleted file mode 100644
index f40c58e..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software Foundation,
-dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_RENAMEAT
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_RENAMEAT],[
-AC_CHECK_FUNCS(renameat,,)
-])
m4/ltp-renameat2.m4 deleted +0 -27
deleted file mode 100644
index 2bc7313..0000000
@@ -1,27 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2015
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software Foundation,
-dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-dnl Author: Cedric Hnyda <[email protected]>
-dnl
-
-dnl
-dnl LTP_CHECK_RENAMEAT2
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_RENAMEAT2],[
-AC_CHECK_FUNCS(renameat2,,)
-])
m4/ltp-splice.m4 deleted +0 -25
deleted file mode 100644
index 0ddaae0..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_SPLICE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_SPLICE],[
-AC_CHECK_FUNCS(splice,,)
-])
m4/ltp-sync_file_range.m4 deleted +0 -10
deleted file mode 100644
index b47a091..0000000
@@ -1,10 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) 2019 Linaro Limited. All rights reserved.
-
-dnl
-dnl LTP_CHECK_SYNC_FILE_RANGE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_SYNC_FILE_RANGE],[
-AC_CHECK_FUNCS(sync_file_range,,)
-])
m4/ltp-syncfs.m4 deleted +0 -10
deleted file mode 100644
index 836a055..0000000
@@ -1,10 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) 2019 Linaro Limited. All rights reserved.
-
-dnl
-dnl LTP_CHECK_SYNCFS
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_SYNCFS],[
-AC_CHECK_FUNCS(syncfs,,)
-])
m4/ltp-tee.m4 deleted +0 -25
deleted file mode 100644
index eb4a6b2..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software Foundation,
-dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_TEE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_TEE],[
-AC_CHECK_FUNCS(tee,,)
-])
m4/ltp-unshare.m4 deleted +0 -25
deleted file mode 100644
index de8da73..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Cisco Systems Inc., 2009
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-dnl Author: Ngie Cooper <[email protected]>
-dnl
-
-dnl
-dnl LTP_CHECK_SYSCALL_UNSHARE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_SYSCALL_UNSHARE],[AC_CHECK_FUNCS_ONCE(unshare)])
m4/ltp-vmsplice.m4 deleted +0 -25
deleted file mode 100644
index 6129cfe..0000000
@@ -1,25 +0,0 @@
-dnl
-dnl Copyright (c) Linux Test Project, 2014
-dnl
-dnl This program is free software;  you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-dnl the GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program;  if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-dnl
-
-dnl
-dnl LTP_CHECK_SPLICE
-dnl ----------------------------
-dnl
-AC_DEFUN([LTP_CHECK_VMSPLICE],[
-AC_CHECK_FUNCS(vmsplice,,)
-])
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH v3 2/3 syscalls/stime: Add libc stime() detection

Don't alway skip libc stime() for Android because bionic(Android libc) may implement it in the future.

Also add break to fix potential compiler warnings.

---
 configure.ac                                | 1 +
 testcases/kernel/syscalls/stime/stime_var.h | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
configure.ac +1 -0
index bc5ba74..4208ae7 100644
@@ -78,6 +78,7 @@ AC_CHECK_FUNCS([ \
     renameat \
     renameat2 \
     splice \
+    stime \
     syncfs \
     sync_file_range \
     tee \
testcases/kernel/syscalls/stime/stime_var.h +4 -2
index b014f0a..342f762 100644
@@ -8,6 +8,7 @@
 #define STIME_VAR__
 
 #include <sys/time.h>
+#include "config.h"
 #include "lapi/syscalls.h"
 
 #define TEST_VARIANTS 3
@@ -16,11 +17,12 @@ static int do_stime(time_t *ntime)
 {
 	switch (tst_variant) {
 	case 0:
-#ifdef __ANDROID__
-		tst_brk(TCONF, "libc stime() is not implemented on Android");
+#ifndef HAVE_STIME
+		tst_brk(TCONF, "libc stime() is not implemented");
 #else
 		return stime(ntime);
 #endif
+		break;
 	case 1:
 		return tst_syscall(__NR_stime, ntime);
 	case 2: {
Signature · 1 line
1.8.3.1
author
#2 lore raw

PATCH v3 3/3 syscalls/sigpending02.c: Add libc sigpending() detection && reset sighandler_counter

In reply to Xiao Yang

1) bionic(Android libc) doesn't implement libc sigpending() currently, so we can skip it on Android by the detection. Also add break to avoid potential compiler warnings.

2) Fix sigpending02 -i n by resetting sighandler_counter variable.

---
 configure.ac                                        | 1 +
 testcases/kernel/syscalls/sigpending/sigpending02.c | 8 ++++++++
 2 files changed, 9 insertions(+)
configure.ac +1 -0
index 4208ae7..de12499 100644
@@ -77,6 +77,7 @@ AC_CHECK_FUNCS([ \
     readlinkat \
     renameat \
     renameat2 \
+    sigpending \
     splice \
     stime \
     syncfs \
testcases/kernel/syscalls/sigpending/sigpending02.c +8 -0
index d75807d..0a1ba25 100644
@@ -13,6 +13,7 @@
  * Test 2: Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT.
  */
 
+#include "config.h"
 #include "tst_test.h"
 #include "ltp_signal.h"
 #include "lapi/syscalls.h"
@@ -36,7 +37,12 @@ static int tested_sigpending(sigset_t *sigset)
 {
 	switch (tst_variant) {
 	case 0:
+#ifndef HAVE_SIGPENDING
+		tst_brk(TCONF, "libc sigpending() is not implemented");
+#else
 		return sigpending(sigset);
+#endif
+		break;
 	case 1:
 		return tst_syscall(__NR_sigpending, sigset);
 	case 2:
@@ -57,6 +63,8 @@ static void test_sigpending(void)
 
 	int i; /* loop index */
 
+	sighandler_counter = 0;
+
 	/* set up signal mask and handler */
 	sigset_t only_SIGUSR, old_mask;
 	sighandler_t old_sighandler1, old_sighandler2;
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH v3 3/3 syscalls/sigpending02.c: Add libc sigpending() detection && reset sighandler_counter

Hi Xiao,

whole patchset LGTM.
...

Quoted 10 lines

+++ b/testcases/kernel/syscalls/sigpending/sigpending02.c

testcases/kernel/syscalls/sigpending/sigpending02.c +1 -0
@@ -13,6 +13,7 @@
  * Test 2: Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT.
  */
 
+#include "config.h"
 #include "tst_test.h"
 #include "ltp_signal.h"
 #include "lapi/syscalls.h"

testcases/kernel/syscalls/sigpending/sigpending02.c static int tested_sigpending(sigset_t *sigset) · line 45

Quoted 9 lines
testcases/kernel/syscalls/sigpending/sigpending02.c +5 -0
@@ -36,7 +37,12 @@ static int tested_sigpending(sigset_t *sigset)
 {
 	switch (tst_variant) {
 	case 0:
+#ifndef HAVE_SIGPENDING
+		tst_brk(TCONF, "libc sigpending() is not implemented");
+#else
 		return sigpending(sigset);
+#endif
+		break;

very minor nit: shift left break (to be on the same level as case).

testcases/kernel/syscalls/sigpending/sigpending02.c static int tested_sigpending(sigset_t *sigset) · line 48

Quoted 3 lines
testcases/kernel/syscalls/sigpending/sigpending02.c +0 -0
 	case 1:
 		return tst_syscall(__NR_sigpending, sigset);
 	case 2:

Kind regards,
Petr

author
#4 lore raw

PATCH v3 3/3 syscalls/sigpending02.c: Add libc sigpending() detection && reset sighandler_counter

Hi Petr, Cyril

Pushed with left-shift break. :-)
Thanks a lot.

Best Regards,
Xiao Yang

Quoted 32 lines · Petr Vorel

Hi Xiao,

whole patchset LGTM.
...

Quoted 9 lines

+++ b/testcases/kernel/syscalls/sigpending/sigpending02.c

testcases/kernel/syscalls/sigpending/sigpending02.c +1 -0
@@ -13,6 +13,7 @@
   * Test 2: Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT.
   */
+#include "config.h"
  #include "tst_test.h"
  #include "ltp_signal.h"
  #include "lapi/syscalls.h"

testcases/kernel/syscalls/sigpending/sigpending02.c static int tested_sigpending(sigset_t *sigset) · line 45

Quoted 9 lines
testcases/kernel/syscalls/sigpending/sigpending02.c +5 -0
@@ -36,7 +37,12 @@ static int tested_sigpending(sigset_t *sigset)
  {
  	switch (tst_variant) {
  	case 0:
+#ifndef HAVE_SIGPENDING
+		tst_brk(TCONF, "libc sigpending() is not implemented");
+#else
  		return sigpending(sigset);
+#endif
+		break;

very minor nit: shift left break (to be on the same level as case).

testcases/kernel/syscalls/sigpending/sigpending02.c static int tested_sigpending(sigset_t *sigset) · line 48

Quoted 3 lines
testcases/kernel/syscalls/sigpending/sigpending02.c +0 -0
  	case 1:
  		return tst_syscall(__NR_sigpending, sigset);
  	case 2:

Kind regards,
Petr