Skip to contentSkip to conversation

m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

PATCH Superseded Xiao Yang 3 participants 12 messages Mar 28, 2019 – Apr 17, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Use LTP_CHECK_LIBC_FUNCS if only libc implementations need to be checked.

---
 configure.ac              | 23 +----------------------
 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-libc-funcs.m4      | 14 ++++++++++++++
 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 -------------------------
 24 files changed, 15 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
 create mode 100644 m4/ltp-libc-funcs.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 +1 -22
index d71d832..c231e33 100644
@@ -182,7 +182,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 +192,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,10 +214,9 @@ 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
+LTP_CHECK_LIBC_FUNCS
 
 if test "x$with_numa" = xyes; then
 	LTP_CHECK_SYSCALL_NUMA
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-libc-funcs.m4 new file +14 -0
new file mode 100644
index 0000000..ebbe2c9
@@ -0,0 +1,14 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2019 Fujitsu Ltd.
+dnl Author: Xiao Yang <[email protected]>
+
+dnl
+dnl LTP_CHECK_LIBC_FUNCS
+dnl ----------------------------
+dnl
+
+AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
+AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
+mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
+splice syncfs sync_file_range tee unshare vmsplice,,)
+])
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 2/2 syscalls/stime: detect if libc stime() is implemented dynamically

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

---
 m4/ltp-libc-funcs.m4                        | 2 +-
 testcases/kernel/syscalls/stime/stime_var.h | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
m4/ltp-libc-funcs.m4 +1 -1
index ebbe2c9..122073f 100644
@@ -10,5 +10,5 @@ dnl
 AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
 AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
 mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
-splice syncfs sync_file_range tee unshare vmsplice,,)
+splice stime syncfs sync_file_range tee unshare vmsplice,,)
 ])
testcases/kernel/syscalls/stime/stime_var.h +3 -2
index b014f0a..48d46b3 100644
@@ -8,6 +8,7 @@
 #define STIME_VAR__
 
 #include <sys/time.h>
+#include "config.h"
 #include "lapi/syscalls.h"
 
 #define TEST_VARIANTS 3
@@ -16,8 +17,8 @@ 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
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 syscalls/stime: detect if libc stime() is implemented dynamically

Hi Xiao, Steve,

m4/ltp-libc-funcs.m4 dnl · line 13

Quoted 10 lines
m4/ltp-libc-funcs.m4 +1 -1
index ebbe2c9..122073f 100644
@@ -10,5 +10,5 @@ dnl
 AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
 AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
 mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
-splice syncfs sync_file_range tee unshare vmsplice,,)
+splice stime syncfs sync_file_range tee unshare vmsplice,,)

I hope AC_CHECK_FUNCS is working well on cross compilation (I guess so, but noticed some problems on autotools with PKG_CHECK_MODULES, but that's different as it's using pkg-config).
...

Quoted 1 line
testcases/kernel/syscalls/stime/stime_var.h +0 -0

...

testcases/kernel/syscalls/stime/stime_var.h static int do_stime(time_t *ntime) · line 24

Quoted 7 lines
testcases/kernel/syscalls/stime/stime_var.h +2 -2
-#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

Kind regards,
Petr

author
#3 lore raw

PATCH 2/2 syscalls/stime: detect if libc stime() is implemented dynamically

Quoted 4 lines · Petr Vorel

Hi Xiao, Steve,

Quoted 14 lines

m4/ltp-libc-funcs.m4 dnl · line 13

Quoted 10 lines
m4/ltp-libc-funcs.m4 +1 -1
index ebbe2c9..122073f 100644
@@ -10,5 +10,5 @@ dnl
  AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
  AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
  mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
-splice syncfs sync_file_range tee unshare vmsplice,,)
+splice stime syncfs sync_file_range tee unshare vmsplice,,)

I hope AC_CHECK_FUNCS is working well on cross compilation (I guess so, but noticed some problems on autotools with PKG_CHECK_MODULES, but that's different as it's using pkg-config).
...

Hi Petr,

I wonder the detail of your problems, so could you provide the operations and error messages?

Best Regards,
Xiao Yang

Quoted 15 lines
Quoted 1 line
testcases/kernel/syscalls/stime/stime_var.h +0 -0

...

testcases/kernel/syscalls/stime/stime_var.h static int do_stime(time_t *ntime) · line 24

Quoted 7 lines
testcases/kernel/syscalls/stime/stime_var.h +2 -2
-#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

Kind regards,
Petr

#4 lore raw

PATCH 2/2 syscalls/stime: detect if libc stime() is implemented dynamically

Hi Xiao,

...

Quoted 11 lines
Quoted 11 lines

m4/ltp-libc-funcs.m4 dnl · line 13

Quoted 7 lines

+++ b/m4/ltp-libc-funcs.m4

m4/ltp-libc-funcs.m4 +1 -1
@@ -10,5 +10,5 @@ dnl
  AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
  AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
  mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
-splice syncfs sync_file_range tee unshare vmsplice,,)
+splice stime syncfs sync_file_range tee unshare vmsplice,,)

I hope AC_CHECK_FUNCS is working well on cross compilation (I guess so, but noticed some problems on autotools with PKG_CHECK_MODULES, but that's different as it's using pkg-config).
...

Quoted 4 lines

Hi Petr,

I wonder the detail of your problems, so could you provide the operations and error messages?

autotools fails preadv and pwritev detection with AC_CHECK_FUNCS for android build [1]. Not sure if it's a problem of my setup or autotools bug.

Quoted 2 lines

Best Regards,
Xiao Yang

Kind regards,
Petr

[1] http://lists.linux.it/pipermail/ltp/2019-April/011722.html

#6 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

In reply to Xiao Yang

Hi Xiao,

...

Quoted 6 lines

+++ b/m4/ltp-libc-funcs.m4

m4/ltp-libc-funcs.m4 new file +4 -0
@@ -0,0 +1,14 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2019 Fujitsu Ltd.
+dnl Author: Xiao Yang <[email protected]>
+

m4/ltp-libc-funcs.m4 line 14

Quoted 10 lines
m4/ltp-libc-funcs.m4 new file +10 -0
+dnl
+dnl LTP_CHECK_LIBC_FUNCS
+dnl ----------------------------
+dnl
+
+AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
+AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
+mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
+splice syncfs sync_file_range tee unshare vmsplice,,)
+])

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Kind regards,
Petr

#7 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Hi!

Quoted 10 lines
Quoted 10 lines

+++ b/m4/ltp-libc-funcs.m4

m4/ltp-libc-funcs.m4 new file +8 -0
@@ -0,0 +1,14 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2019 Fujitsu Ltd.
+dnl Author: Xiao Yang <[email protected]>
+
+dnl
+dnl LTP_CHECK_LIBC_FUNCS
+dnl ----------------------------
+dnl
Quoted 8 lines

m4/ltp-libc-funcs.m4 line 14

Quoted 6 lines
m4/ltp-libc-funcs.m4 new file +6 -0
+
+AC_DEFUN([LTP_CHECK_LIBC_FUNCS],[
+AC_CHECK_FUNCS(epoll_pwait execveat fallocate fchownat fstatat kcmp mkdirat \
+mknodat openat preadv preadv2 pwritev pwritev2 readlinkat renameat renameat2 \
+splice syncfs sync_file_range tee unshare vmsplice,,)
+])

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Agreed, also we have AC_CHECK_FUNCS() in the configure.ac so the best step would be moving these there as well.

Other than that this is a great cleanup, thanks for doing this.

Signature · 2 lines
Cyril Hrubis
[email protected]
#8 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Hi,

Quoted 5 lines
Quoted 2 lines

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Agreed, also we have AC_CHECK_FUNCS() in the configure.ac so the best step would be moving these there as well.

+1 (easier to find general things like this in configure.ac than in m4/ltp-*.m4.

Quoted 1 line

Other than that this is a great cleanup, thanks for doing this.

Kind regards,
Petr

author
#9 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Hi Petr, Cyril

Thanks for your comment.
I will send v2 patch as you suggested. :-)

Best Regards,
Xiao Yang

Quoted 14 lines · Petr Vorel

Hi,

Quoted 4 lines
Quoted 2 lines

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Agreed, also we have AC_CHECK_FUNCS() in the configure.ac so the best step would be moving these there as well.

+1 (easier to find general things like this in configure.ac than in m4/ltp-*.m4.

Quoted 1 line

Other than that this is a great cleanup, thanks for doing this.

Kind regards,
Petr

#10 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Hi Xiao, Cyril,

Quoted 2 lines

Thanks for your comment.
I will send v2 patch as you suggested. :-)

v2 has LTP_CHECK_LIBC_FUNCS in m4/ltp-libc-funcs.m4.
IMHO it'd be better to have simple AC_CHECK_FUNCS() in configure.ac, i.e. the same way we handle AC_CHECK_HEADERS(). It might not be good to mix configure.ac and m4/ltp-*.m4, but I guess general functions like this is easier to find in configure.ac than in some of m4/ltp-*.m4.

Kind regards,
Petr

Quoted 14 lines

Best Regards,
Xiao Yang

Quoted 11 lines · Petr Vorel

Hi,

Quoted 4 lines
Quoted 2 lines

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Agreed, also we have AC_CHECK_FUNCS() in the configure.ac so the best step would be moving these there as well.

+1 (easier to find general things like this in configure.ac than in m4/ltp-*.m4.

Quoted 1 line

Other than that this is a great cleanup, thanks for doing this.

Kind regards,
Petr

author
#11 lore raw

PATCH 1/2 m4: Use common LTP_CHECK_LIBC_FUNCS to check libc implementations

Quoted 9 lines · Petr Vorel

Hi Xiao, Cyril,

Quoted 2 lines

Thanks for your comment.
I will send v2 patch as you suggested. :-)

v2 has LTP_CHECK_LIBC_FUNCS in m4/ltp-libc-funcs.m4.
IMHO it'd be better to have simple AC_CHECK_FUNCS() in configure.ac, i.e. the same way we handle AC_CHECK_HEADERS(). It might not be good to mix configure.ac and m4/ltp-*.m4, but I guess general functions like this is easier to find in configure.ac than in some of m4/ltp-*.m4.

Hi Petr,

Sorry, I missed your last comment.
It seems easier to remove LTP_CHECK_LIBC_FUNCS directly.

I will send v3 patch soon.

Best Regards,
Xiao Yang

Quoted 24 lines

Kind regards,
Petr

Quoted 12 lines

Best Regards,
Xiao Yang

Quoted 9 lines · Petr Vorel

Hi,

Quoted 4 lines
Quoted 2 lines

Note about formatting: maybe it'd be easier to edit the file if each function was on separate line.

Agreed, also we have AC_CHECK_FUNCS() in the configure.ac so the best step would be moving these there as well.

+1 (easier to find general things like this in configure.ac than in m4/ltp-*.m4.

Quoted 1 line

Other than that this is a great cleanup, thanks for doing this.

Kind regards,
Petr