svn commit: r320447 - in vendor/pjdfstest/dist: . tests tests/chflags tests/chmod tests/chown tests/ftruncate tests/granular tests/link tests/mkdir tests/mkfifo tests/mknod tests/open tests/rename ...
Ngie Cooper
ngie at FreeBSD.org
Wed Jun 28 08:48:12 UTC 2017
Author: ngie
Date: Wed Jun 28 08:48:09 2017
New Revision: 320447
URL: https://svnweb.freebsd.org/changeset/base/320447
Log:
Pull down pjdfstest 0.1
The summary of changes is as follows..
Generic changes::
- Added configure support [2].
- Check for lchmod filesystem support with create_file(..); for
testcases that require lchmod, skip the testcase -- otherwise
use chmod directly [1].
- Added Travis CI integration [2].
- Added utimensat testcases [1].
Linux support::
- Fixed Linux support to pass on later supported versions of
Fedora/Ubuntu [2].
- Conditionally enable posix_fallocate(2) support [2].
OSX support::
- Fixed compilation on OSX [2].
- Added partial OSX support (the test run isn't fully green yet)
[2].
Obtained from: https://github.com/pjd/pjdfstest/tree/0.1
Submitted by: asomers [1], ngie [2]
Added:
vendor/pjdfstest/dist/.gitignore
vendor/pjdfstest/dist/.travis.yml
vendor/pjdfstest/dist/AUTHORS
vendor/pjdfstest/dist/COPYING
vendor/pjdfstest/dist/ChangeLog
vendor/pjdfstest/dist/Makefile.am (contents, props changed)
vendor/pjdfstest/dist/NEWS
vendor/pjdfstest/dist/configure.ac
vendor/pjdfstest/dist/tests/utimensat/
vendor/pjdfstest/dist/tests/utimensat/00.t
vendor/pjdfstest/dist/tests/utimensat/01.t
vendor/pjdfstest/dist/tests/utimensat/02.t
vendor/pjdfstest/dist/tests/utimensat/03.t
vendor/pjdfstest/dist/tests/utimensat/04.t
vendor/pjdfstest/dist/tests/utimensat/05.t
vendor/pjdfstest/dist/tests/utimensat/06.t
vendor/pjdfstest/dist/tests/utimensat/07.t
vendor/pjdfstest/dist/tests/utimensat/08.t
vendor/pjdfstest/dist/tests/utimensat/09.t
vendor/pjdfstest/dist/travis/
vendor/pjdfstest/dist/travis/build.sh (contents, props changed)
vendor/pjdfstest/dist/travis/test.sh (contents, props changed)
Modified:
vendor/pjdfstest/dist/README
vendor/pjdfstest/dist/pjdfstest.c
vendor/pjdfstest/dist/tests/chflags/00.t
vendor/pjdfstest/dist/tests/chflags/01.t
vendor/pjdfstest/dist/tests/chflags/02.t
vendor/pjdfstest/dist/tests/chflags/03.t
vendor/pjdfstest/dist/tests/chflags/04.t
vendor/pjdfstest/dist/tests/chflags/05.t
vendor/pjdfstest/dist/tests/chflags/06.t
vendor/pjdfstest/dist/tests/chflags/07.t
vendor/pjdfstest/dist/tests/chflags/08.t
vendor/pjdfstest/dist/tests/chflags/09.t
vendor/pjdfstest/dist/tests/chflags/10.t
vendor/pjdfstest/dist/tests/chflags/11.t
vendor/pjdfstest/dist/tests/chflags/12.t
vendor/pjdfstest/dist/tests/chflags/13.t
vendor/pjdfstest/dist/tests/chmod/00.t
vendor/pjdfstest/dist/tests/chmod/01.t
vendor/pjdfstest/dist/tests/chmod/02.t
vendor/pjdfstest/dist/tests/chmod/03.t
vendor/pjdfstest/dist/tests/chmod/04.t
vendor/pjdfstest/dist/tests/chmod/05.t
vendor/pjdfstest/dist/tests/chmod/06.t
vendor/pjdfstest/dist/tests/chmod/07.t
vendor/pjdfstest/dist/tests/chmod/08.t
vendor/pjdfstest/dist/tests/chmod/09.t
vendor/pjdfstest/dist/tests/chmod/10.t
vendor/pjdfstest/dist/tests/chmod/11.t
vendor/pjdfstest/dist/tests/chmod/12.t
vendor/pjdfstest/dist/tests/chown/00.t
vendor/pjdfstest/dist/tests/chown/01.t
vendor/pjdfstest/dist/tests/chown/02.t
vendor/pjdfstest/dist/tests/chown/03.t
vendor/pjdfstest/dist/tests/chown/04.t
vendor/pjdfstest/dist/tests/chown/05.t
vendor/pjdfstest/dist/tests/chown/06.t
vendor/pjdfstest/dist/tests/chown/07.t
vendor/pjdfstest/dist/tests/chown/08.t
vendor/pjdfstest/dist/tests/chown/09.t
vendor/pjdfstest/dist/tests/chown/10.t
vendor/pjdfstest/dist/tests/conf
vendor/pjdfstest/dist/tests/ftruncate/00.t
vendor/pjdfstest/dist/tests/ftruncate/01.t
vendor/pjdfstest/dist/tests/ftruncate/02.t
vendor/pjdfstest/dist/tests/ftruncate/03.t
vendor/pjdfstest/dist/tests/ftruncate/04.t
vendor/pjdfstest/dist/tests/ftruncate/05.t
vendor/pjdfstest/dist/tests/ftruncate/06.t
vendor/pjdfstest/dist/tests/ftruncate/07.t
vendor/pjdfstest/dist/tests/ftruncate/08.t
vendor/pjdfstest/dist/tests/ftruncate/09.t
vendor/pjdfstest/dist/tests/ftruncate/10.t
vendor/pjdfstest/dist/tests/ftruncate/11.t
vendor/pjdfstest/dist/tests/ftruncate/12.t
vendor/pjdfstest/dist/tests/ftruncate/13.t
vendor/pjdfstest/dist/tests/ftruncate/14.t
vendor/pjdfstest/dist/tests/granular/00.t
vendor/pjdfstest/dist/tests/granular/01.t
vendor/pjdfstest/dist/tests/granular/02.t
vendor/pjdfstest/dist/tests/granular/03.t
vendor/pjdfstest/dist/tests/granular/04.t
vendor/pjdfstest/dist/tests/granular/05.t
vendor/pjdfstest/dist/tests/link/00.t
vendor/pjdfstest/dist/tests/link/01.t
vendor/pjdfstest/dist/tests/link/02.t
vendor/pjdfstest/dist/tests/link/03.t
vendor/pjdfstest/dist/tests/link/04.t
vendor/pjdfstest/dist/tests/link/05.t
vendor/pjdfstest/dist/tests/link/06.t
vendor/pjdfstest/dist/tests/link/07.t
vendor/pjdfstest/dist/tests/link/08.t
vendor/pjdfstest/dist/tests/link/09.t
vendor/pjdfstest/dist/tests/link/10.t
vendor/pjdfstest/dist/tests/link/11.t
vendor/pjdfstest/dist/tests/link/12.t
vendor/pjdfstest/dist/tests/link/13.t
vendor/pjdfstest/dist/tests/link/14.t
vendor/pjdfstest/dist/tests/link/15.t
vendor/pjdfstest/dist/tests/link/16.t
vendor/pjdfstest/dist/tests/link/17.t
vendor/pjdfstest/dist/tests/misc.sh
vendor/pjdfstest/dist/tests/mkdir/00.t
vendor/pjdfstest/dist/tests/mkdir/01.t
vendor/pjdfstest/dist/tests/mkdir/02.t
vendor/pjdfstest/dist/tests/mkdir/03.t
vendor/pjdfstest/dist/tests/mkdir/04.t
vendor/pjdfstest/dist/tests/mkdir/05.t
vendor/pjdfstest/dist/tests/mkdir/06.t
vendor/pjdfstest/dist/tests/mkdir/07.t
vendor/pjdfstest/dist/tests/mkdir/08.t
vendor/pjdfstest/dist/tests/mkdir/09.t
vendor/pjdfstest/dist/tests/mkdir/10.t
vendor/pjdfstest/dist/tests/mkdir/11.t
vendor/pjdfstest/dist/tests/mkdir/12.t
vendor/pjdfstest/dist/tests/mkfifo/00.t
vendor/pjdfstest/dist/tests/mkfifo/01.t
vendor/pjdfstest/dist/tests/mkfifo/02.t
vendor/pjdfstest/dist/tests/mkfifo/03.t
vendor/pjdfstest/dist/tests/mkfifo/04.t
vendor/pjdfstest/dist/tests/mkfifo/05.t
vendor/pjdfstest/dist/tests/mkfifo/06.t
vendor/pjdfstest/dist/tests/mkfifo/07.t
vendor/pjdfstest/dist/tests/mkfifo/08.t
vendor/pjdfstest/dist/tests/mkfifo/09.t
vendor/pjdfstest/dist/tests/mkfifo/10.t
vendor/pjdfstest/dist/tests/mkfifo/11.t
vendor/pjdfstest/dist/tests/mkfifo/12.t
vendor/pjdfstest/dist/tests/mknod/00.t
vendor/pjdfstest/dist/tests/mknod/01.t
vendor/pjdfstest/dist/tests/mknod/02.t
vendor/pjdfstest/dist/tests/mknod/03.t
vendor/pjdfstest/dist/tests/mknod/04.t
vendor/pjdfstest/dist/tests/mknod/05.t
vendor/pjdfstest/dist/tests/mknod/06.t
vendor/pjdfstest/dist/tests/mknod/07.t
vendor/pjdfstest/dist/tests/mknod/08.t
vendor/pjdfstest/dist/tests/mknod/09.t
vendor/pjdfstest/dist/tests/mknod/10.t
vendor/pjdfstest/dist/tests/mknod/11.t
vendor/pjdfstest/dist/tests/open/00.t
vendor/pjdfstest/dist/tests/open/01.t
vendor/pjdfstest/dist/tests/open/02.t
vendor/pjdfstest/dist/tests/open/03.t
vendor/pjdfstest/dist/tests/open/04.t
vendor/pjdfstest/dist/tests/open/05.t
vendor/pjdfstest/dist/tests/open/06.t
vendor/pjdfstest/dist/tests/open/07.t
vendor/pjdfstest/dist/tests/open/08.t
vendor/pjdfstest/dist/tests/open/09.t
vendor/pjdfstest/dist/tests/open/10.t
vendor/pjdfstest/dist/tests/open/11.t
vendor/pjdfstest/dist/tests/open/12.t
vendor/pjdfstest/dist/tests/open/13.t
vendor/pjdfstest/dist/tests/open/14.t
vendor/pjdfstest/dist/tests/open/15.t
vendor/pjdfstest/dist/tests/open/16.t
vendor/pjdfstest/dist/tests/open/17.t
vendor/pjdfstest/dist/tests/open/18.t
vendor/pjdfstest/dist/tests/open/19.t
vendor/pjdfstest/dist/tests/open/20.t
vendor/pjdfstest/dist/tests/open/21.t
vendor/pjdfstest/dist/tests/open/22.t
vendor/pjdfstest/dist/tests/open/23.t
vendor/pjdfstest/dist/tests/open/24.t
vendor/pjdfstest/dist/tests/rename/00.t
vendor/pjdfstest/dist/tests/rename/01.t
vendor/pjdfstest/dist/tests/rename/02.t
vendor/pjdfstest/dist/tests/rename/03.t
vendor/pjdfstest/dist/tests/rename/04.t
vendor/pjdfstest/dist/tests/rename/05.t
vendor/pjdfstest/dist/tests/rename/06.t
vendor/pjdfstest/dist/tests/rename/07.t
vendor/pjdfstest/dist/tests/rename/08.t
vendor/pjdfstest/dist/tests/rename/09.t
vendor/pjdfstest/dist/tests/rename/10.t
vendor/pjdfstest/dist/tests/rename/11.t
vendor/pjdfstest/dist/tests/rename/12.t
vendor/pjdfstest/dist/tests/rename/13.t
vendor/pjdfstest/dist/tests/rename/14.t
vendor/pjdfstest/dist/tests/rename/15.t
vendor/pjdfstest/dist/tests/rename/16.t
vendor/pjdfstest/dist/tests/rename/17.t
vendor/pjdfstest/dist/tests/rename/18.t
vendor/pjdfstest/dist/tests/rename/19.t
vendor/pjdfstest/dist/tests/rename/20.t
vendor/pjdfstest/dist/tests/rename/21.t
vendor/pjdfstest/dist/tests/rmdir/00.t
vendor/pjdfstest/dist/tests/rmdir/01.t
vendor/pjdfstest/dist/tests/rmdir/02.t
vendor/pjdfstest/dist/tests/rmdir/03.t
vendor/pjdfstest/dist/tests/rmdir/04.t
vendor/pjdfstest/dist/tests/rmdir/05.t
vendor/pjdfstest/dist/tests/rmdir/06.t
vendor/pjdfstest/dist/tests/rmdir/07.t
vendor/pjdfstest/dist/tests/rmdir/08.t
vendor/pjdfstest/dist/tests/rmdir/09.t
vendor/pjdfstest/dist/tests/rmdir/10.t
vendor/pjdfstest/dist/tests/rmdir/11.t
vendor/pjdfstest/dist/tests/rmdir/12.t
vendor/pjdfstest/dist/tests/rmdir/13.t
vendor/pjdfstest/dist/tests/rmdir/14.t
vendor/pjdfstest/dist/tests/rmdir/15.t
vendor/pjdfstest/dist/tests/symlink/00.t
vendor/pjdfstest/dist/tests/symlink/01.t
vendor/pjdfstest/dist/tests/symlink/02.t
vendor/pjdfstest/dist/tests/symlink/03.t
vendor/pjdfstest/dist/tests/symlink/04.t
vendor/pjdfstest/dist/tests/symlink/05.t
vendor/pjdfstest/dist/tests/symlink/06.t
vendor/pjdfstest/dist/tests/symlink/07.t
vendor/pjdfstest/dist/tests/symlink/08.t
vendor/pjdfstest/dist/tests/symlink/09.t
vendor/pjdfstest/dist/tests/symlink/10.t
vendor/pjdfstest/dist/tests/symlink/11.t
vendor/pjdfstest/dist/tests/symlink/12.t
vendor/pjdfstest/dist/tests/truncate/00.t
vendor/pjdfstest/dist/tests/truncate/01.t
vendor/pjdfstest/dist/tests/truncate/02.t
vendor/pjdfstest/dist/tests/truncate/03.t
vendor/pjdfstest/dist/tests/truncate/04.t
vendor/pjdfstest/dist/tests/truncate/05.t
vendor/pjdfstest/dist/tests/truncate/06.t
vendor/pjdfstest/dist/tests/truncate/07.t
vendor/pjdfstest/dist/tests/truncate/08.t
vendor/pjdfstest/dist/tests/truncate/09.t
vendor/pjdfstest/dist/tests/truncate/10.t
vendor/pjdfstest/dist/tests/truncate/11.t
vendor/pjdfstest/dist/tests/truncate/12.t
vendor/pjdfstest/dist/tests/truncate/13.t
vendor/pjdfstest/dist/tests/truncate/14.t
vendor/pjdfstest/dist/tests/unlink/00.t
vendor/pjdfstest/dist/tests/unlink/01.t
vendor/pjdfstest/dist/tests/unlink/02.t
vendor/pjdfstest/dist/tests/unlink/03.t
vendor/pjdfstest/dist/tests/unlink/04.t
vendor/pjdfstest/dist/tests/unlink/05.t
vendor/pjdfstest/dist/tests/unlink/06.t
vendor/pjdfstest/dist/tests/unlink/07.t
vendor/pjdfstest/dist/tests/unlink/08.t
vendor/pjdfstest/dist/tests/unlink/09.t
vendor/pjdfstest/dist/tests/unlink/10.t
vendor/pjdfstest/dist/tests/unlink/11.t
vendor/pjdfstest/dist/tests/unlink/12.t
vendor/pjdfstest/dist/tests/unlink/13.t
Added: vendor/pjdfstest/dist/.gitignore
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/.gitignore Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,19 @@
+autom4te.cache
+aclocal.m4
+compile
+configure
+config.h*
+config.guess
+config.log
+config.status
+config.sub
+depcomp
+install-sh
+missing
+pjdfstest
+stamp-h1
+INSTALL
+Makefile
+Makefile.in
+.deps
+*.o
Added: vendor/pjdfstest/dist/.travis.yml
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/.travis.yml Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,19 @@
+language: c
+sudo: required
+
+matrix:
+ include:
+ - os: linux
+ compiler: clang
+ dist: xenial
+ - os: linux
+ compiler: gcc
+ dist: xenial
+ - os: osx
+ compiler: clang
+ - os: osx
+ compiler: gcc
+
+script:
+ - ./travis/build.sh
+ - ./travis/test.sh
Added: vendor/pjdfstest/dist/AUTHORS
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/AUTHORS Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,3 @@
+* Alan Somers <asomers at FreeBSD.org> - contributor/co-maintainer
+* Ngie Cooper <ngie at FreeBSD.org> - contributor/co-maintainer
+* Pawel Jakub Dawidek <pawel at dawidek.net> - pjdfstest author/maintainer
Added: vendor/pjdfstest/dist/COPYING
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/COPYING Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,27 @@
+$FreeBSD: head/tools/regression/pjdfstest/LICENSE 211354 2010-08-15 21:29:03Z pjd $
+
+License for all regression tests available with pjdfstest:
+
+Copyright (c) 2006-2012 Pawel Jakub Dawidek <pawel at dawidek.net>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
Added: vendor/pjdfstest/dist/ChangeLog
==============================================================================
Added: vendor/pjdfstest/dist/Makefile.am
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/Makefile.am Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,5 @@
+AM_CFLAGS= -Wall -Werror
+
+bin_PROGRAMS= pjdfstest
+
+pjdfstest_SOURCES= pjdfstest.c
Added: vendor/pjdfstest/dist/NEWS
==============================================================================
Modified: vendor/pjdfstest/dist/README
==============================================================================
--- vendor/pjdfstest/dist/README Wed Jun 28 08:29:20 2017 (r320446)
+++ vendor/pjdfstest/dist/README Wed Jun 28 08:48:09 2017 (r320447)
@@ -1,22 +1,57 @@
$FreeBSD: head/tools/regression/pjdfstest/README 211354 2010-08-15 21:29:03Z pjd $
-Few notes on how to use pjdfstest in short steps:
+============
+Introduction
+============
- # cd pjdfstest
- # vi tests/conf
- Change 'fs' to file system type you want to test (UFS or ZFS).
- # vi Makefile
- You need to manually tweak few things by editing CFLAGS lines
- at the top of the file.
- # make
- It will compile pjdfstest utility which is used by regression tests.
- # cd /path/to/file/system/you/want/to/test/
- # prove -r /path/to/pjdfstest/tests
+pjdfstest is a test suite that helps exercise POSIX system calls.
-That's all. Enjoy.
+pjdfstest supports the following operating systems/filesystems:
-Currently supported operating systems: FreeBSD, Solaris.
-Currently supported file system types: UFS, ZFS.
+- Supported Operating Systems: FreeBSD, Linux, Solaris
+- Supported Filesystems: ext4, UFS, ZFS
---
-Pawel Jakub Dawidek <pawel at dawidek.net>
+==================
+Building pjdfstest
+==================
+
+-------------
+Prerequisites
+-------------
+
+- autoconf 2.69 or newer
+- automake 1.15 or newer
+- cc (clang or gcc)
+- make
+- appropriate system headers (please install your distribution appropriate
+ header package)
+
+---------
+Procedure
+---------
+
+ $ autoreconf -ifs
+ $ ./configure
+ $ make pjdfstest
+
+=================
+Running pjdfstest
+=================
+
+-------------
+Prerequisites
+-------------
+- You must be root when running these testcases.
+
+----------------------
+Software Prerequisites
+----------------------
+- perl
+- TAP-Harness (perl package)
+
+---------
+Procedure
+---------
+
+ # cd /path/to/filesystem/under/test
+ # prove -rv /path/to/pjdfstest/tests
Added: vendor/pjdfstest/dist/configure.ac
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/pjdfstest/dist/configure.ac Wed Jun 28 08:48:09 2017 (r320447)
@@ -0,0 +1,107 @@
+AC_PREREQ(2.61)
+AC_INIT([pjdfstest],[0.1],)
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([ \
+ Makefile \
+])
+
+AC_CANONICAL_HOST
+
+AC_PROG_CC([cc])
+
+# For _GNU_SOURCE on Linux, etc.
+AC_USE_SYSTEM_EXTENSIONS
+
+AC_CHECK_HEADERS([ \
+ sys/mkdev.h \
+])
+
+#HAS_FREEBSD_ACL
+
+AC_CHECK_FUNC([bindat],
+ [AC_DEFINE([HAVE_BINDAT], [1], [Define if bindat exists])])
+AC_CHECK_FUNC([chflags],
+ [AC_DEFINE([HAVE_CHFLAGS], [1], [Define if chflags exists])])
+AC_CHECK_FUNC([chflagsat],
+ [AC_DEFINE([HAVE_CHFLAGSAT], [1], [Define if chflagsat exists])])
+AC_CHECK_FUNC([connectat],
+ [AC_DEFINE([HAVE_CONNECTAT], [1], [Define if connectat exists])])
+AC_CHECK_FUNC([faccessat],
+ [AC_DEFINE([HAVE_FACCESSAT], [1], [Define if faccessat exists])])
+AC_CHECK_FUNC([fchflags],
+ [AC_DEFINE([HAVE_FCHFLAGS], [1], [Define if fchflags exists])])
+AC_CHECK_FUNC([fchmodat],
+ [AC_DEFINE([HAVE_FCHMODAT], [1], [Define if fchmodat exists])])
+AC_CHECK_FUNC([fchownat],
+ [AC_DEFINE([HAVE_FCHOWNAT], [1], [Define if fchownat exists])])
+AC_CHECK_FUNC([fstatat],
+ [AC_DEFINE([HAVE_FSTATAT], [1], [Define if fstatat exists])])
+AC_CHECK_FUNC([lchflags],
+ [AC_DEFINE([HAVE_LCHFLAGS], [1], [Define if lchflags exists])])
+AC_CHECK_FUNC([lchmod],
+ [AC_DEFINE([HAVE_LCHMOD], [1], [Define if lchmod exists])])
+AC_CHECK_FUNC([linkat],
+ [AC_DEFINE([HAVE_LINKAT], [1], [Define if linkat exists])])
+AC_CHECK_FUNC([lpathconf],
+ [AC_DEFINE([HAVE_LPATHCONF], [1], [Define if lpathconf exists])])
+AC_CHECK_FUNC([mkdirat],
+ [AC_DEFINE([HAVE_MKDIRAT], [1], [Define if mkdirat exists])])
+AC_CHECK_FUNC([mkfifoat],
+ [AC_DEFINE([HAVE_MKFIFOAT], [1], [Define if mkfifoat exists])])
+AC_CHECK_FUNC([mknodat],
+ [AC_DEFINE([HAVE_MKNODAT], [1], [Define if mknodat exists])])
+AC_CHECK_FUNC([openat],
+ [AC_DEFINE([HAVE_OPENAT], [1], [Define if openat exists])])
+AC_CHECK_FUNC([posix_fallocate],
+ [AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Define if posix_fallocate exists])])
+AC_CHECK_FUNC([readlinkat],
+ [AC_DEFINE([HAVE_READLINKAT], [1], [Define if readlinkat exists])])
+AC_CHECK_FUNC([renameat],
+ [AC_DEFINE([HAVE_RENAMEAT], [1], [Define if renameat exists])])
+AC_CHECK_FUNC([symlinkat],
+ [AC_DEFINE([HAVE_SYMLINKAT], [1], [Define if symlinkat exists])])
+AC_CHECK_FUNC([utimensat],
+ [AC_DEFINE([HAVE_UTIMENSAT], [1], [Define if utimensat exists])])
+
+# ACL test battery.
+AC_CHECK_HEADER([sys/acl.h], [has_sys_acl_h=yes], [has_sys_acl_h=no])
+has_acl_funcs=no
+if test x$has_sys_acl_h = xyes; then
+ AC_DEFINE([HAVE_SYS_ACL_H], [1],
+ [Define to 1 if sys/acl.h is available])
+ AC_CHECK_FUNCS([acl_create_entry_np acl_from_text acl_get_entry acl_get_file acl_set_file],
+ [has_acl_funcs=yes],[])
+fi
+if test x$has_acl_funcs = xyes; then
+ # Check for NFSv4 ACL support.
+ AC_CHECK_DECL([ACL_TYPE_NFS4],
+ [has_nfsv4_acl_support=yes], [has_nfsv4_acl_support=no],[[#include <sys/acl.h>]])
+ if test x$has_nfsv4_acl_support = xyes; then
+ AC_DEFINE([HAS_NFSV4_ACL_SUPPORT], [1],
+ [Define to 1 if NFSv4 ACL support is available])
+ fi
+fi
+
+AC_CHECK_MEMBERS([struct stat.st_atim, struct stat.st_atimespec], [], [], [[
+#include <sys/types.h>
+#include <sys/stat.h>
+]])
+
+AC_CHECK_MEMBERS([struct stat.st_birthtim, struct stat.st_birthtime, struct stat.st_birthtimespec], [], [], [[
+#include <sys/types.h>
+#include <sys/stat.h>
+]])
+
+AC_CHECK_MEMBERS([struct stat.st_ctim, struct stat.st_ctimespec], [], [], [[
+#include <sys/types.h>
+#include <sys/stat.h>
+]])
+
+AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimespec], [], [], [[
+#include <sys/types.h>
+#include <sys/stat.h>
+]])
+
+AC_OUTPUT
Modified: vendor/pjdfstest/dist/pjdfstest.c
==============================================================================
--- vendor/pjdfstest/dist/pjdfstest.c Wed Jun 28 08:29:20 2017 (r320446)
+++ vendor/pjdfstest/dist/pjdfstest.c Wed Jun 28 08:48:09 2017 (r320447)
@@ -26,14 +26,19 @@
* $FreeBSD$
*/
+/* Needs to be first to twiddle appropriate system configuration/HAVE_* flags */
+#include "config.h"
+
#include <sys/param.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-#ifndef makedev
-#include <sys/mkdev.h>
-#endif
#include <assert.h>
#include <ctype.h>
@@ -45,18 +50,15 @@
#include <string.h>
#include <unistd.h>
-#ifndef HAS_TRUNCATE64
-#define truncate64 truncate
-#define ftruncate64 ftruncate
+#ifdef __sun__
+#define _USE_STAT64
#endif
-#ifndef HAS_STAT64
-#define stat64 stat
-#define fstat64 fstat
-#define lstat64 lstat
+
+#ifdef _USE_STAT64
+typedef struct stat64 stat_t;
+#else
+typedef struct stat stat_t;
#endif
-#ifdef HAS_FREEBSD_ACL
-#include <sys/acl.h>
-#endif
#ifndef ALLPERMS
#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
@@ -64,69 +66,91 @@
enum action {
ACTION_OPEN,
+#ifdef HAVE_OPENAT
ACTION_OPENAT,
+#endif
ACTION_CREATE,
ACTION_UNLINK,
+#ifdef HAVE_UNLINKAT
ACTION_UNLINKAT,
+#endif
ACTION_MKDIR,
+#ifdef HAVE_MKDIRAT
ACTION_MKDIRAT,
+#endif
ACTION_RMDIR,
ACTION_LINK,
+#ifdef HAVE_LINKAT
ACTION_LINKAT,
+#endif
ACTION_SYMLINK,
+#ifdef HAVE_SYMLINKAT
ACTION_SYMLINKAT,
+#endif
ACTION_RENAME,
+#ifdef HAVE_RENAMEAT
ACTION_RENAMEAT,
+#endif
ACTION_MKFIFO,
+#ifdef HAVE_MKFIFOAT
ACTION_MKFIFOAT,
+#endif
ACTION_MKNOD,
ACTION_MKNODAT,
ACTION_BIND,
-#ifdef HAS_BINDAT
+#ifdef HAVE_BINDAT
ACTION_BINDAT,
#endif
ACTION_CONNECT,
-#ifdef HAS_CONNECTAT
+#ifdef HAVE_CONNECTAT
ACTION_CONNECTAT,
#endif
ACTION_CHMOD,
ACTION_FCHMOD,
-#ifdef HAS_LCHMOD
+#ifdef HAVE_LCHMOD
ACTION_LCHMOD,
#endif
ACTION_FCHMODAT,
ACTION_CHOWN,
ACTION_FCHOWN,
ACTION_LCHOWN,
+#ifdef HAVE_FCHOWNAT
ACTION_FCHOWNAT,
-#ifdef HAS_CHFLAGS
+#endif
+#ifdef HAVE_CHFLAGS
ACTION_CHFLAGS,
#endif
-#ifdef HAS_FCHFLAGS
+#ifdef HAVE_FCHFLAGS
ACTION_FCHFLAGS,
#endif
-#ifdef HAS_CHFLAGSAT
+#ifdef HAVE_CHFLAGSAT
ACTION_CHFLAGSAT,
#endif
-#ifdef HAS_LCHFLAGS
+#ifdef HAVE_LCHFLAGS
ACTION_LCHFLAGS,
#endif
ACTION_TRUNCATE,
ACTION_FTRUNCATE,
+#ifdef HAVE_POSIX_FALLOCATE
+ ACTION_POSIX_FALLOCATE,
+#endif
ACTION_STAT,
ACTION_FSTAT,
ACTION_LSTAT,
ACTION_FSTATAT,
ACTION_PATHCONF,
ACTION_FPATHCONF,
-#ifdef HAS_LPATHCONF
+#ifdef HAVE_LPATHCONF
ACTION_LPATHCONF,
#endif
-#ifdef HAS_FREEBSD_ACL
+#ifdef HAS_NFSV4_ACL_SUPPORT
ACTION_PREPENDACL,
ACTION_READACL,
#endif
ACTION_WRITE,
+#ifdef HAVE_UTIMENSAT
+ ACTION_UTIMENSAT,
+#endif
};
#define TYPE_NONE 0x0000
@@ -147,69 +171,104 @@ struct syscall_desc {
static struct syscall_desc syscalls[] = {
{ "open", ACTION_OPEN, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } },
+#ifdef HAVE_OPENAT
{ "openat", ACTION_OPENAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } },
+#endif
{ "create", ACTION_CREATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
{ "unlink", ACTION_UNLINK, { TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_UNLINKAT
{ "unlinkat", ACTION_UNLINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#endif
{ "mkdir", ACTION_MKDIR, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+#ifdef HAVE_MKDIRAT
{ "mkdirat", ACTION_MKDIRAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+#endif
{ "rmdir", ACTION_RMDIR, { TYPE_STRING, TYPE_NONE } },
{ "link", ACTION_LINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_LINKAT
{ "linkat", ACTION_LINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#endif
{ "symlink", ACTION_SYMLINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_SYMLINKAT
{ "symlinkat", ACTION_SYMLINKAT, { TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
+#endif
{ "rename", ACTION_RENAME, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_RENAMEAT
{ "renameat", ACTION_RENAMEAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
+#endif
{ "mkfifo", ACTION_MKFIFO, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+#ifdef HAVE_MKFIFOAT
{ "mkfifoat", ACTION_MKFIFOAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+#endif
{ "mknod", ACTION_MKNOD, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
+#ifdef HAVE_MKNODAT
{ "mknodat", ACTION_MKNODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
+#endif
{ "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } },
-#ifdef HAS_BINDAT
+#ifdef HAVE_BINDAT
{ "bindat", ACTION_BINDAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
#endif
{ "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } },
-#ifdef HAS_CONNECTAT
+#ifdef HAVE_CONNECTAT
{ "connectat", ACTION_CONNECTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
#endif
{ "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
{ "fchmod", ACTION_FCHMOD, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } },
-#ifdef HAS_LCHMOD
+#ifdef HAVE_LCHMOD
{ "lchmod", ACTION_LCHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
#endif
+#ifdef HAVE_FCHMODAT
{ "fchmodat", ACTION_FCHMODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+#endif
{ "chown", ACTION_CHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
{ "fchown", ACTION_FCHOWN, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
{ "lchown", ACTION_LCHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+#ifdef HAVE_FCHOWNAT
{ "fchownat", ACTION_FCHOWNAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
-#ifdef HAS_CHFLAGS
+#endif
+#ifdef HAVE_CHFLAGS
{ "chflags", ACTION_CHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
#endif
-#ifdef HAS_FCHFLAGS
+#ifdef HAVE_FCHFLAGS
{ "fchflags", ACTION_FCHFLAGS, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
#endif
-#ifdef HAS_CHFLAGSAT
+#ifdef HAVE_CHFLAGSAT
{ "chflagsat", ACTION_CHFLAGSAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
#endif
-#ifdef HAS_LCHFLAGS
+#ifdef HAVE_LCHFLAGS
{ "lchflags", ACTION_LCHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
#endif
{ "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
{ "ftruncate", ACTION_FTRUNCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } },
+#ifdef HAVE_POSIX_FALLOCATE
+ { "posix_fallocate", ACTION_POSIX_FALLOCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+#endif
{ "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
{ "fstat", ACTION_FSTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
{ "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_FSTATAT
{ "fstatat", ACTION_FSTATAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+#endif
{ "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
{ "fpathconf", ACTION_FPATHCONF, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
-#ifdef HAS_LPATHCONF
+#ifdef HAVE_LPATHCONF
{ "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
#endif
-#ifdef HAS_FREEBSD_ACL
+#ifdef HAS_NFSV4_ACL_SUPPORT
{ "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
{ "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } },
#endif
{ "write", ACTION_WRITE, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
+#ifdef HAVE_UTIMENSAT
+ { "utimensat", ACTION_UTIMENSAT, {
+ TYPE_DESCRIPTOR, /* Directory */
+ TYPE_STRING, /* Relative path */
+ TYPE_NUMBER, /* atime seconds */
+ TYPE_STRING, /* atime nanoseconds */
+ TYPE_NUMBER, /* mtime seconds */
+ TYPE_STRING, /* mtime nanoseconds */
+ TYPE_STRING, /* flags */}},
+#endif
{ NULL, -1, { TYPE_NONE } }
};
@@ -219,122 +278,136 @@ struct flag {
};
static struct flag open_flags[] = {
-#ifdef O_RDONLY
+#ifdef O_RDONLY
{ O_RDONLY, "O_RDONLY" },
#endif
-#ifdef O_WRONLY
+#ifdef O_WRONLY
{ O_WRONLY, "O_WRONLY" },
#endif
-#ifdef O_RDWR
+#ifdef O_RDWR
{ O_RDWR, "O_RDWR" },
#endif
-#ifdef O_NONBLOCK
+#ifdef O_NONBLOCK
{ O_NONBLOCK, "O_NONBLOCK" },
#endif
-#ifdef O_APPEND
+#ifdef O_APPEND
{ O_APPEND, "O_APPEND" },
#endif
-#ifdef O_CREAT
+#ifdef O_CREAT
{ O_CREAT, "O_CREAT" },
#endif
-#ifdef O_TRUNC
+#ifdef O_TRUNC
{ O_TRUNC, "O_TRUNC" },
#endif
-#ifdef O_EXCL
+#ifdef O_EXCL
{ O_EXCL, "O_EXCL" },
#endif
-#ifdef O_SHLOCK
+#ifdef O_SHLOCK
{ O_SHLOCK, "O_SHLOCK" },
#endif
-#ifdef O_EXLOCK
+#ifdef O_EXLOCK
{ O_EXLOCK, "O_EXLOCK" },
#endif
-#ifdef O_DIRECT
+#ifdef O_DIRECT
{ O_DIRECT, "O_DIRECT" },
#endif
-#ifdef O_FSYNC
+#ifdef O_FSYNC
{ O_FSYNC, "O_FSYNC" },
#endif
-#ifdef O_SYNC
+#ifdef O_SYNC
{ O_SYNC, "O_SYNC" },
#endif
-#ifdef O_NOFOLLOW
+#ifdef O_NOFOLLOW
{ O_NOFOLLOW, "O_NOFOLLOW" },
#endif
-#ifdef O_NOCTTY
+#ifdef O_NOCTTY
{ O_NOCTTY, "O_NOCTTY" },
#endif
-#ifdef O_DIRECTORY
+#ifdef O_DIRECTORY
{ O_DIRECTORY, "O_DIRECTORY" },
#endif
{ 0, NULL }
};
-#ifdef HAS_CHFLAGS
+#ifdef HAVE_CHFLAGS
static struct flag chflags_flags[] = {
-#ifdef UF_NODUMP
+#ifdef UF_NODUMP
{ UF_NODUMP, "UF_NODUMP" },
#endif
-#ifdef UF_IMMUTABLE
+#ifdef UF_IMMUTABLE
{ UF_IMMUTABLE, "UF_IMMUTABLE" },
#endif
-#ifdef UF_APPEND
+#ifdef UF_APPEND
{ UF_APPEND, "UF_APPEND" },
#endif
-#ifdef UF_NOUNLINK
+#ifdef UF_NOUNLINK
{ UF_NOUNLINK, "UF_NOUNLINK" },
#endif
-#ifdef UF_OPAQUE
+#ifdef UF_OPAQUE
{ UF_OPAQUE, "UF_OPAQUE" },
#endif
-#ifdef SF_ARCHIVED
+#ifdef SF_ARCHIVED
{ SF_ARCHIVED, "SF_ARCHIVED" },
#endif
-#ifdef SF_IMMUTABLE
+#ifdef SF_IMMUTABLE
{ SF_IMMUTABLE, "SF_IMMUTABLE" },
#endif
-#ifdef SF_APPEND
+#ifdef SF_APPEND
{ SF_APPEND, "SF_APPEND" },
#endif
-#ifdef SF_NOUNLINK
+#ifdef SF_NOUNLINK
{ SF_NOUNLINK, "SF_NOUNLINK" },
#endif
-#ifdef SF_SNAPSHOT
+#ifdef SF_SNAPSHOT
{ SF_SNAPSHOT, "SF_SNAPSHOT" },
#endif
{ 0, NULL }
};
#endif
+#ifdef HAVE_UNLINKAT
static struct flag unlinkat_flags[] = {
{ AT_REMOVEDIR, "AT_REMOVEDIR" },
{ 0, NULL }
};
+#endif
+#ifdef HAVE_LINKAT
static struct flag linkat_flags[] = {
+#ifdef AT_SYMLINK_FOLLOW
{ AT_SYMLINK_FOLLOW, "AT_SYMLINK_FOLLOW" },
+#endif
{ 0, NULL }
};
+#endif
+#ifdef HAVE_CHFLAGSAT
static struct flag chflagsat_flags[] = {
{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
{ 0, NULL }
};
+#endif
+#ifdef HAVE_FCHMODAT
static struct flag fchmodat_flags[] = {
{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
{ 0, NULL }
};
+#endif
+#ifdef HAVE_FCHOWNAT
static struct flag fchownat_flags[] = {
{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
{ 0, NULL }
};
+#endif
+#ifdef HAVE_FSTATAT
static struct flag fstatat_flags[] = {
{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
{ 0, NULL }
};
+#endif
struct name {
int n_name;
@@ -342,16 +415,16 @@ struct name {
};
static struct name pathconf_names[] = {
-#ifdef _PC_LINK_MAX
+#ifdef _PC_LINK_MAX
{ _PC_LINK_MAX, "_PC_LINK_MAX" },
#endif
-#ifdef _PC_NAME_MAX
+#ifdef _PC_NAME_MAX
{ _PC_NAME_MAX, "_PC_NAME_MAX" },
#endif
-#ifdef _PC_PATH_MAX
+#ifdef _PC_PATH_MAX
{ _PC_PATH_MAX, "_PC_PATH_MAX" },
#endif
-#ifdef _PC_SYMLINK_MAX
+#ifdef _PC_SYMLINK_MAX
{ _PC_SYMLINK_MAX, "_PC_SYMLINK_MAX" },
#endif
{ 0, NULL }
@@ -394,7 +467,7 @@ str2flags(struct flag *tflags, char *sflags)
return (flags);
}
-#ifdef HAS_CHFLAGS
+#ifdef HAVE_CHFLAGS
static char *
flags2str(struct flag *tflags, long long flags)
{
@@ -440,7 +513,7 @@ find_syscall(const char *name)
}
static void
-show_stat(struct stat64 *sp, const char *what)
+show_stat(stat_t *sp, const char *what)
{
if (strcmp(what, "mode") == 0)
@@ -459,11 +532,51 @@ show_stat(struct stat64 *sp, const char *what)
printf("%lld", (long long)sp->st_blocks);
else if (strcmp(what, "atime") == 0)
printf("%lld", (long long)sp->st_atime);
- else if (strcmp(what, "mtime") == 0)
- printf("%lld", (long long)sp->st_mtime);
+#if defined(HAVE_STRUCT_STAT_ST_ATIM) || \
+ defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
+ else if (strcmp(what, "atime_ns") == 0)
+#ifdef HAVE_STRUCT_STAT_ST_ATIMESPEC
+ printf("%lld", (long long)sp->st_atimespec.tv_nsec);
+#else
+ printf("%lld", (long long)sp->st_atim.tv_nsec);
+#endif
+#endif /* st_atim* */
else if (strcmp(what, "ctime") == 0)
printf("%lld", (long long)sp->st_ctime);
-#ifdef HAS_CHFLAGS
+#if defined(HAVE_STRUCT_STAT_ST_CTIM) || \
+ defined(HAVE_STRUCT_STAT_ST_CTIMESPEC)
+ else if (strcmp(what, "ctime_ns") == 0)
+#ifdef HAVE_STRUCT_STAT_ST_CTIMESPEC
+ printf("%lld", (long long)sp->st_ctimespec.tv_nsec);
+#else
+ printf("%lld", (long long)sp->st_ctim.tv_nsec);
+#endif
+#endif /* st_ctim* */
+ else if (strcmp(what, "mtime") == 0)
+ printf("%lld", (long long)sp->st_mtime);
+ else if (strcmp(what, "mtime_ns") == 0)
+#if defined(HAVE_STRUCT_STAT_ST_MTIM) || \
+ defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
+#ifdef HAVE_STRUCT_STAT_ST_MTIMESPEC
+ printf("%lld", (long long)sp->st_mtimespec.tv_nsec);
+#else
+ printf("%lld", (long long)sp->st_mtim.tv_nsec);
+#endif
+#endif /* st_mtim* */
+#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
+ else if (strcmp(what, "birthtime") == 0)
+ printf("%lld", (long long)sp->st_birthtime);
+#endif /* st_birthtime */
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIM) || \
+ defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC)
+ else if (strcmp(what, "birthtime_ns") == 0)
+#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC
+ printf("%lld", (long long)sp->st_birthtimespec.tv_nsec);
+#else
+ printf("%lld", (long long)sp->st_birthtim.tv_nsec);
+#endif
+#endif /* st_birthtim{,espec} */
+#ifdef HAVE_CHFLAGS
else if (strcmp(what, "flags") == 0)
printf("%s", flags2str(chflags_flags, (long long)sp->st_flags));
#endif
@@ -504,7 +617,7 @@ show_stat(struct stat64 *sp, const char *what)
}
static void
-show_stats(struct stat64 *sp, char *what)
+show_stats(stat_t *sp, char *what)
{
const char *s = "";
char *w;
@@ -547,7 +660,11 @@ descriptor_get(int pos)
static unsigned int
call_syscall(struct syscall_desc *scall, char *argv[])
{
- struct stat64 sb;
+ stat_t sb;
+#ifdef HAVE_UTIMENSAT
+ struct timespec times[2];
+ int flag;
+#endif
long long flags;
unsigned int i;
char *endp;
@@ -556,7 +673,7 @@ call_syscall(struct syscall_desc *scall, char *argv[])
char *str;
long long num;
} args[MAX_ARGS];
-#ifdef HAS_FREEBSD_ACL
+#ifdef HAS_NFSV4_ACL_SUPPORT
int entry_id = ACL_FIRST_ENTRY;
acl_t acl, newacl;
acl_entry_t entry, newentry;
@@ -645,6 +762,7 @@ call_syscall(struct syscall_desc *scall, char *argv[])
if (rval >= 0)
descriptor_add(rval);
break;
+#ifdef HAVE_OPENAT
case ACTION_OPENAT:
flags = str2flags(open_flags, STR(2));
if (flags & O_CREAT) {
@@ -664,6 +782,7 @@ call_syscall(struct syscall_desc *scall, char *argv[])
if (rval >= 0)
descriptor_add(rval);
break;
+#endif
case ACTION_CREATE:
rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1));
if (rval >= 0)
@@ -672,46 +791,60 @@ call_syscall(struct syscall_desc *scall, char *argv[])
case ACTION_UNLINK:
rval = unlink(STR(0));
break;
+#ifdef HAVE_UNLINKAT
case ACTION_UNLINKAT:
rval = unlinkat(NUM(0), STR(1),
(int)str2flags(unlinkat_flags, STR(2)));
break;
+#endif
case ACTION_MKDIR:
rval = mkdir(STR(0), (mode_t)NUM(1));
break;
+#ifdef HAVE_MKDIRAT
case ACTION_MKDIRAT:
rval = mkdirat(NUM(0), STR(1), (mode_t)NUM(2));
break;
+#endif
case ACTION_RMDIR:
rval = rmdir(STR(0));
break;
case ACTION_LINK:
rval = link(STR(0), STR(1));
break;
+#ifdef HAVE_LINKAT
case ACTION_LINKAT:
rval = linkat(NUM(0), STR(1), NUM(2), STR(3),
(int)str2flags(linkat_flags, STR(4)));
break;
+#endif
case ACTION_SYMLINK:
rval = symlink(STR(0), STR(1));
break;
+#ifdef HAVE_SYMLINKAT
case ACTION_SYMLINKAT:
rval = symlinkat(STR(0), NUM(1), STR(2));
break;
+#endif
case ACTION_RENAME:
rval = rename(STR(0), STR(1));
break;
+#ifdef HAVE_RENAMEAT
case ACTION_RENAMEAT:
rval = renameat(NUM(0), STR(1), NUM(2), STR(3));
break;
+#endif
case ACTION_MKFIFO:
rval = mkfifo(STR(0), (mode_t)NUM(1));
break;
+#ifdef HAVE_MKFIFOAT
case ACTION_MKFIFOAT:
rval = mkfifoat(NUM(0), STR(1), (mode_t)NUM(2));
break;
+#endif
case ACTION_MKNOD:
+#ifdef HAVE_MKNODAT
case ACTION_MKNODAT:
+#endif
{
mode_t ntype;
dev_t dev;
@@ -721,9 +854,11 @@ call_syscall(struct syscall_desc *scall, char *argv[])
case ACTION_MKNOD:
fa = 0;
break;
+#ifdef HAVE_MKNODAT
case ACTION_MKNODAT:
fa = 1;
break;
+#endif
default:
abort();
}
@@ -747,9 +882,11 @@ call_syscall(struct syscall_desc *scall, char *argv[])
case ACTION_MKNOD:
rval = mknod(STR(0), ntype | NUM(2), dev);
break;
+#ifdef HAVE_MKNODAT
case ACTION_MKNODAT:
rval = mknodat(NUM(0), STR(1), ntype | NUM(3), dev);
break;
+#endif
default:
abort();
}
@@ -768,7 +905,7 @@ call_syscall(struct syscall_desc *scall, char *argv[])
rval = bind(rval, (struct sockaddr *)&sunx, sizeof(sunx));
break;
}
-#ifdef HAS_BINDAT
+#ifdef HAVE_BINDAT
case ACTION_BINDAT:
{
struct sockaddr_un sunx;
@@ -797,7 +934,7 @@ call_syscall(struct syscall_desc *scall, char *argv[])
rval = connect(rval, (struct sockaddr *)&sunx, sizeof(sunx));
break;
}
-#ifdef HAS_CONNECTAT
+#ifdef HAVE_CONNECTAT
case ACTION_CONNECTAT:
{
struct sockaddr_un sunx;
@@ -819,15 +956,17 @@ call_syscall(struct syscall_desc *scall, char *argv[])
case ACTION_FCHMOD:
rval = fchmod(NUM(0), (mode_t)NUM(1));
break;
-#ifdef HAS_LCHMOD
+#ifdef HAVE_LCHMOD
case ACTION_LCHMOD:
rval = lchmod(STR(0), (mode_t)NUM(1));
break;
#endif
+#ifdef HAVE_FCHMODAT
case ACTION_FCHMODAT:
rval = fchmodat(NUM(0), STR(1), (mode_t)NUM(2),
str2flags(fchmodat_flags, STR(3)));
break;
+#endif
case ACTION_CHOWN:
rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
break;
@@ -837,62 +976,94 @@ call_syscall(struct syscall_desc *scall, char *argv[])
case ACTION_LCHOWN:
rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
break;
+#ifdef HAVE_FCHOWNAT
case ACTION_FCHOWNAT:
rval = fchownat(NUM(0), STR(1), (uid_t)NUM(2), (gid_t)NUM(3),
(int)str2flags(fchownat_flags, STR(4)));
break;
-#ifdef HAS_CHFLAGS
+#endif
+#ifdef HAVE_CHFLAGS
case ACTION_CHFLAGS:
rval = chflags(STR(0),
(unsigned long)str2flags(chflags_flags, STR(1)));
break;
#endif
-#ifdef HAS_FCHFLAGS
+#ifdef HAVE_FCHFLAGS
case ACTION_FCHFLAGS:
rval = fchflags(NUM(0),
(unsigned long)str2flags(chflags_flags, STR(1)));
break;
#endif
-#ifdef HAS_CHFLAGSAT
+#ifdef HAVE_CHFLAGSAT
case ACTION_CHFLAGSAT:
rval = chflagsat(NUM(0), STR(1),
(unsigned long)str2flags(chflags_flags, STR(2)),
(int)str2flags(chflagsat_flags, STR(3)));
break;
#endif
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-vendor
mailing list