Hello community,

here is the log from the commit of package stress-ng for openSUSE:Factory 
checked in at 2017-06-29 15:22:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/stress-ng (Old)
 and      /work/SRC/openSUSE:Factory/.stress-ng.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "stress-ng"

Thu Jun 29 15:22:12 2017 rev:15 rq:507020 version:0.08.07

Changes:
--------
--- /work/SRC/openSUSE:Factory/stress-ng/stress-ng.changes      2017-06-23 
09:18:47.890760975 +0200
+++ /work/SRC/openSUSE:Factory/.stress-ng.new/stress-ng.changes 2017-06-29 
15:22:23.371357876 +0200
@@ -1,0 +2,5 @@
+Thu Jun 29 09:45:32 UTC 2017 - pgeorgia...@suse.com
+
+-  update to version 0.08.07
+
+-------------------------------------------------------------------

Old:
----
  stress-ng-0.08.06.tar.gz

New:
----
  stress-ng-0.08.07.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ stress-ng.spec ++++++
--- /var/tmp/diff_new_pack.JMysHl/_old  2017-06-29 15:22:24.991128919 +0200
+++ /var/tmp/diff_new_pack.JMysHl/_new  2017-06-29 15:22:24.995128353 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           stress-ng
-Version:        0.08.06
+Version:        0.08.07
 Release:        0
 Summary:        Tool to load and stress a computer
 License:        GPL-2.0

++++++ stress-ng-0.08.06.tar.gz -> stress-ng-0.08.07.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/Makefile 
new/stress-ng-0.08.07/Makefile
--- old/stress-ng-0.08.06/Makefile      2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/Makefile      2017-06-28 12:10:09.000000000 +0200
@@ -16,7 +16,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 #
 
-VERSION=0.08.06
+VERSION=0.08.07
 #
 # Codename "harmful hardware harasser"
 #
@@ -273,7 +273,8 @@
         HAVE_VECMATH=0 HAVE_ATOMIC=0 HAVE_LIB_SCTP=0 HAVE_ASM_NOP=0 \
         HAVE_ALIGNED_64K=0 HAVE_ALIGNED_64=0 HAVE_ALIGNED_128=0 \
         HAVE_AFFINITY=0 HAVE_MADVISE=0 HAVE_SEM_POSIX=0 HAVE_SEM_SYSV=0 \
-        HAVE_MQ_POSIX=0 HAVE_MQ_SYSV=0 HAVE_SHM_SYSV=0
+        HAVE_MQ_POSIX=0 HAVE_MQ_SYSV=0 HAVE_SHM_SYSV=0 HAVE_FANOTIFY=0 \
+        HAVE_INOTIFY=0
 
 #
 #  Load in current config; use 'make clean' to clear this
@@ -523,6 +524,22 @@
 endif
 endif
 
+ifndef $(HAVE_FANOTIFY)
+HAVE_FANOTIFY = $(shell $(MAKE) --no-print-directory $(HAVE_NOT) have_fanotify)
+ifeq ($(HAVE_FANOTIFY),1)
+       CONFIG_CFLAGS += -DHAVE_FANOTIFY
+$(info autoconfig: using fanotify)
+endif
+endif
+
+ifndef $(HAVE_INOTIFY)
+HAVE_INOTIFY = $(shell $(MAKE) --no-print-directory $(HAVE_NOT) have_inotify)
+ifeq ($(HAVE_INOTIFY),1)
+       CONFIG_CFLAGS += -DHAVE_INOTIFY
+$(info autoconfig: using inotify)
+endif
+endif
+
 endif
 endif
 
@@ -905,7 +922,7 @@
 #
 #  check if we can build using SYSV shared memory
 #
-.PHONY: have_shm_sysv_
+.PHONY: have_shm_sysv
 have_shm_sysv: test-shm-sysv.c
        @$(CC) $(CPPFLAGS) test-shm-sysv.c -o test-shm-sysv 2> /dev/null || true
        @if [ -f test-shm-sysv ]; then \
@@ -916,6 +933,32 @@
        @rm -rf test-shm-sysv
 
 #
+#  check if we can build using fanotify
+#
+.PHONY: have_fanotify
+have_fanotify: test-fanotify.c
+       @$(CC) $(CPPFLAGS) test-fanotify.c -o test-fanotify 2> /dev/null || true
+       @if [ -f test-fanotify ]; then \
+               echo 1 ;\
+       else \
+               echo 0 ;\
+       fi
+       @rm -rf test-fanotify
+
+#
+#  check if we can build using inotify
+#
+.PHONY: have_inotify
+have_inotify: test-inotify.c
+       @$(CC) $(CPPFLAGS) test-inotify.c -o test-inotify 2> /dev/null || true
+       @if [ -f test-inotify ]; then \
+               echo 1 ;\
+       else \
+               echo 0 ;\
+       fi
+       @rm -rf test-inotify
+
+#
 #  extract the PER_* personality enums
 #
 personality.h:
@@ -967,7 +1010,7 @@
                test-aligned-128.c usr.bin.pulseaudio.eg perf-event.c \
                test-affinity.c test-madvise.c test-sem-posix.c \
                test-sem-sysv.c test-mq-posix.c test-mq-sysv.c \
-               test-shm-sysv.c \
+               test-shm-sysv.c test-fanotify.c test-inotify.c \
                snapcraft smatchify.sh config TODO \
                example-jobs stress-ng-$(VERSION)
        tar -zcf stress-ng-$(VERSION).tar.gz stress-ng-$(VERSION)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-cyclic.c 
new/stress-ng-0.08.07/stress-cyclic.c
--- old/stress-ng-0.08.06/stress-cyclic.c       2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-cyclic.c       2017-06-28 12:10:09.000000000 
+0200
@@ -79,7 +79,7 @@
        uint64_t cyclic_sleep;
 
        cyclic_sleep = get_uint64(opt);
-        check_range_bytes("cyclic-sleep", cyclic_sleep,
+        check_range("cyclic-sleep", cyclic_sleep,
                 1, NANOSECS);
         set_setting("cyclic-sleep", TYPE_ID_UINT64, &cyclic_sleep);
 }
@@ -107,7 +107,7 @@
        int32_t cyclic_prio;
 
        cyclic_prio = get_int32(opt);
-        check_range_bytes("cyclic-prio", cyclic_prio, 1, 100);
+        check_range("cyclic-prio", cyclic_prio, 1, 100);
         set_setting("cyclic-prio", TYPE_ID_INT32, &cyclic_prio);
 }
 
@@ -116,7 +116,7 @@
        uint64_t cyclic_dist;
 
        cyclic_dist = get_uint64(opt);
-        check_range_bytes("cyclic-dist", cyclic_dist, 1, 10000000);
+        check_range("cyclic-dist", cyclic_dist, 1, 10000000);
         set_setting("cyclic-dist", TYPE_ID_UINT64, &cyclic_dist);
 }
 
@@ -262,6 +262,46 @@
        return 0;
 }
 
+#if _POSIX_C_SOURCE >= 200112L
+/*
+ *  stress_cyclic_pselect()
+ *     measure latencies with pselect sleep
+ */
+static int stress_cyclic_pselect(
+       const args_t *args,
+       rt_stats_t *rt_stats,
+       uint64_t cyclic_sleep)
+{
+#if defined(__linux__)
+       struct timespec t1, t2, t;
+       int ret;
+
+       (void)args;
+
+       t.tv_sec = cyclic_sleep / NANOSECS;
+       t.tv_nsec = cyclic_sleep % NANOSECS;
+       clock_gettime(CLOCK_REALTIME, &t1);
+       ret = pselect(0, NULL, NULL,NULL, &t, NULL);
+       clock_gettime(CLOCK_REALTIME, &t2);
+       if (ret == 0) {
+               int64_t delta_ns;
+
+               delta_ns = ((t2.tv_sec - t1.tv_sec) * NANOSECS) + (t2.tv_nsec - 
t1.tv_nsec);
+               delta_ns -= cyclic_sleep;
+
+               if (rt_stats->index < MAX_SAMPLES)
+                       rt_stats->latencies[rt_stats->index++] = delta_ns;
+
+               rt_stats->ns += (double)delta_ns;
+       }
+#else
+       (void)args;
+       (void)rt_stats;
+       (void)cyclic_sleep;
+#endif
+       return 0;
+}
+#endif
 
 #if defined(__linux__)
 static struct timespec itimer_time;
@@ -435,6 +475,9 @@
        { "itimer",     stress_cyclic_itimer },
        { "poll",       stress_cyclic_poll },
        { "posix_ns",   stress_cyclic_posix_nanosleep },
+#if _POSIX_C_SOURCE >= 200112L
+       { "pselect",    stress_cyclic_pselect },
+#endif
        { NULL,         NULL }
 };
 
@@ -601,9 +644,11 @@
                rlim.rlim_max = timeout;
                (void)setrlimit(RLIMIT_CPU, &rlim);
 
+#if defined(RLIMIT_RTTIME)
                rlim.rlim_cur = 1000000 * timeout;
                rlim.rlim_max = 1000000 * timeout;
                (void)setrlimit(RLIMIT_RTTIME, &rlim);
+#endif
 
                if (stress_sighandler(args->name, SIGXCPU, 
stress_rlimit_handler, &old_action_xcpu) < 0)
                        goto tidy;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-dnotify.c 
new/stress-ng-0.08.07/stress-dnotify.c
--- old/stress-ng-0.08.06/stress-dnotify.c      2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-dnotify.c      2017-06-28 12:10:09.000000000 
+0200
@@ -23,7 +23,7 @@
  */
 #include "stress-ng.h"
 
-#if defined(__linux__)
+#if defined(__linux__) && defined(F_NOTIFY)
 
 #include <sys/select.h>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-dup.c 
new/stress-ng-0.08.07/stress-dup.c
--- old/stress-ng-0.08.06/stress-dup.c  2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/stress-dup.c  2017-06-28 12:10:09.000000000 +0200
@@ -81,6 +81,14 @@
                                pr_fail_err("dup2 with same fds");
                                break;
                        }
+#if defined(F_DUPFD)
+                       /* POSIX.1-2001 fcntl() */
+
+                       (void)close(fds[n]);
+                       fds[n] = fcntl(fds[0], F_DUPFD, fds[0]);
+                       if (fds[n] < 0)
+                               break;
+#endif
 
                        if (!g_keep_stressing_flag)
                                break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-fanotify.c 
new/stress-ng-0.08.07/stress-fanotify.c
--- old/stress-ng-0.08.06/stress-fanotify.c     2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-fanotify.c     2017-06-28 12:10:09.000000000 
+0200
@@ -23,7 +23,7 @@
  */
 #include "stress-ng.h"
 
-#if defined(__linux__)
+#if defined(HAVE_FANOTIFY)
 
 #include <mntent.h>
 #include <sys/select.h>
@@ -56,7 +56,7 @@
        return 0;
 }
 
-#if defined(__linux__)
+#if defined(HAVE_FANOTIFY)
 /*
  *  fanotify_event_init()
  *     initialize fanotify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-get.c 
new/stress-ng-0.08.07/stress-get.c
--- old/stress-ng-0.08.06/stress-get.c  2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/stress-get.c  2017-06-28 12:10:09.000000000 +0200
@@ -32,9 +32,9 @@
 #include <sys/timex.h>
 #endif
 
-#define check_do_run()         \
+#define check_do_run()                 \
        if (!g_keep_stressing_flag)     \
-               break;          \
+               break;                  \
 
 #define GIDS_MAX       (1024)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-inotify.c 
new/stress-ng-0.08.07/stress-inotify.c
--- old/stress-ng-0.08.06/stress-inotify.c      2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-inotify.c      2017-06-28 12:10:09.000000000 
+0200
@@ -26,7 +26,7 @@
  */
 #include "stress-ng.h"
 
-#if defined(__linux__) && NEED_GLIBC(2,9,0)
+#if defined(HAVE_INOTIFY) && NEED_GLIBC(2,9,0)
 
 #include <sys/select.h>
 #include <sys/inotify.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-netlink-proc.c 
new/stress-ng-0.08.07/stress-netlink-proc.c
--- old/stress-ng-0.08.06/stress-netlink-proc.c 2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-netlink-proc.c 2017-06-28 12:10:09.000000000 
+0200
@@ -99,6 +99,9 @@
                case PROC_EVENT_FORK:
                case PROC_EVENT_EXEC:
                case PROC_EVENT_EXIT:
+               case PROC_EVENT_UID:
+               case PROC_EVENT_SID:
+               
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
                case PROC_EVENT_COREDUMP:
@@ -106,6 +109,9 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
                case PROC_EVENT_COMM:
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+               case PROC_EVENT_PTRACE:
+#endif
                        inc_counter(args);
                        break;
                default:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-ng.1 
new/stress-ng-0.08.07/stress-ng.1
--- old/stress-ng-0.08.06/stress-ng.1   2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/stress-ng.1   2017-06-28 12:10:09.000000000 +0200
@@ -2,7 +2,7 @@
 .\" First parameter, NAME, should be all caps
 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
 .\" other parameters are allowed: see man(7), man(1)
-.TH STRESS-NG 1 "June 1, 2017"
+.TH STRESS-NG 1 "June 28, 2017"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 .\" Some roff macros, for reference:
@@ -983,7 +983,9 @@
 sleep for the specified time using the POSIX nanosleep(2) high
 resolution nanosleep.
 T}
-
+pselect        T{
+sleep for the specified time using pselect(2) with null file descriptors.
+T}
 .TE
 .TP
 .B \-\-cyclic\-policy [ fifo | rr ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-ng.c 
new/stress-ng-0.08.07/stress-ng.c
--- old/stress-ng-0.08.06/stress-ng.c   2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/stress-ng.c   2017-06-28 12:10:09.000000000 +0200
@@ -3488,6 +3488,8 @@
        int32_t ionice_level = UNDEFINED;       /* ionice level */
        int32_t i;
        uint32_t class = 0;
+       const uint32_t cpus_online = stress_get_processors_online();
+       const uint32_t cpus_configured = stress_get_processors_configured();
 
        /* --exec stressor uses this to exec itself and then exit early */
        if ((argc == 2) && !strcmp(argv[1], "--exec-exit"))
@@ -3561,10 +3563,10 @@
        log_system_info();
        log_system_mem_info();
 
-       pr_dbg("%" PRId32 " processors online, %" PRId32
-               " processors configured\n",
-               stress_get_processors_online(),
-               stress_get_processors_configured());
+       pr_dbg("%" PRId32 " processor%s online, %" PRId32
+               " processor%s configured\n",
+               cpus_online, cpus_online == 1 ? "" : "s",
+               cpus_configured, cpus_configured == 1 ? "" : "s");
 
        /*
         *  These two options enable all the stressors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-rmap.c 
new/stress-ng-0.08.07/stress-rmap.c
--- old/stress-ng-0.08.06/stress-rmap.c 2017-06-21 18:34:24.000000000 +0200
+++ new/stress-ng-0.08.07/stress-rmap.c 2017-06-28 12:10:09.000000000 +0200
@@ -165,7 +165,7 @@
        }
 
        /*
-        *  Spawn of children workers
+        *  Spawn children workers
         */
        for (i = 0; i < RMAP_CHILD_MAX; i++) {
                pids[i] = fork();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-socket-fd.c 
new/stress-ng-0.08.07/stress-socket-fd.c
--- old/stress-ng-0.08.06/stress-socket-fd.c    2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-socket-fd.c    2017-06-28 12:10:09.000000000 
+0200
@@ -134,17 +134,18 @@
 static void stress_socket_client(
        const args_t *args,
        const pid_t ppid,
-       const size_t max_fd,
+       const ssize_t max_fd,
        const int socket_fd_port)
 {
        struct sockaddr *addr;
 
        (void)setpgid(0, g_pgrp);
        stress_parent_died_alarm();
+       set_proc_name("sfd-client");
 
        do {
                int fd, retries = 0, fds[max_fd];
-               size_t i;
+               ssize_t i;
                socklen_t addr_len = 0;
 retry:
                if (!g_keep_stressing_flag) {
@@ -201,7 +202,7 @@
        const args_t *args,
        const pid_t pid,
        const pid_t ppid,
-       const size_t max_fd,
+       const ssize_t max_fd,
        const int socket_fd_port)
 {
        int fd, status;
@@ -213,6 +214,7 @@
        int rc = EXIT_SUCCESS;
 
        (void)setpgid(pid, g_pgrp);
+       set_proc_name("sfd-server");
 
        if (stress_sig_stop_stressing(args->name, SIGALRM)) {
                rc = EXIT_FAILURE;
@@ -247,7 +249,7 @@
        do {
                int sfd = accept(fd, (struct sockaddr *)NULL, NULL);
                if (sfd >= 0) {
-                       size_t i;
+                       ssize_t i;
 
                        for (i = 0; i < max_fd; i++) {
                                int newfd;
@@ -266,6 +268,7 @@
                                                break;
                                        }
                                        (void)close(newfd);
+                                       msgs++;
                                }
                        }
                        (void)close(sfd);
@@ -297,13 +300,25 @@
 int stress_sockfd(const args_t *args)
 {
        pid_t pid, ppid = getppid();
-       const size_t max_fd = stress_get_file_limit();
+       ssize_t max_fd = stress_get_file_limit();
        int socket_fd_port = DEFAULT_SOCKET_FD_PORT;
 
        (void)get_setting("sockfd-port", &socket_fd_port);
 
-       pr_dbg("%s: process [%d] using socket port %d\n",
-               args->name, args->pid, socket_fd_port + args->instance);
+       /*
+        * When run as root, we really don't want to use up all
+        * the file descriptors. Limit ourselves to a head room
+        * so that we don't ever run out of memory
+        */
+       if (geteuid() == 0) {
+               max_fd -= 64;
+               max_fd /= args->num_instances ? args->num_instances : 1;
+               if (max_fd < 0)
+                       max_fd = 1;
+       }
+
+       pr_dbg("%s: process [%d] using socket port %d and %zd file 
descriptors\n",
+               args->name, args->pid, socket_fd_port + args->instance, max_fd);
 again:
        pid = fork();
        if (pid < 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/stress-softlockup.c 
new/stress-ng-0.08.07/stress-softlockup.c
--- old/stress-ng-0.08.06/stress-softlockup.c   2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/stress-softlockup.c   2017-06-28 12:10:09.000000000 
+0200
@@ -167,9 +167,11 @@
                rlim.rlim_max = timeout;
                (void)setrlimit(RLIMIT_CPU, &rlim);
 
+#if defined(RLIMIT_RTTIME)
                rlim.rlim_cur = 1000000 * timeout;
                rlim.rlim_max = 1000000 * timeout;
                (void)setrlimit(RLIMIT_RTTIME, &rlim);
+#endif
 
                if (stress_sighandler(args->name, SIGXCPU, 
stress_rlimit_handler, &old_action_xcpu) < 0)
                        goto tidy;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/test-fanotify.c 
new/stress-ng-0.08.07/test-fanotify.c
--- old/stress-ng-0.08.06/test-fanotify.c       1970-01-01 01:00:00.000000000 
+0100
+++ new/stress-ng-0.08.07/test-fanotify.c       2017-06-28 12:10:09.000000000 
+0200
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012-2017 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+ *
+ * This code is a complete clean re-write of the stress tool by
+ * Colin Ian King <colin.k...@canonical.com> and attempts to be
+ * backwardly compatible with the stress tool by Amos Waterland
+ * <a...@rossby.metr.ou.edu> but has more stress tests and more
+ * functionality.
+ */
+#include "stress-ng.h"
+
+#if !defined(__linux__)
+#error requires linux to build
+#endif
+
+#include <mntent.h>
+#include <sys/select.h>
+#include <sys/fanotify.h>
+
+#if !defined(FAN_MARK_ADD)
+#error missing fnotify FAN_MARK_ADD flag
+#endif
+
+#if !defined(FAN_MARK_MOUNT)
+#error missing fnotify FAN_MARK_MOUNT flag
+#endif
+
+#if !defined(FAN_ACCESS)
+#error missing fnotify FAN_ACCESS flag
+#endif
+
+#if !defined(FAN_MODIFY)
+#error missing fnotify FAN_MODIFY flag
+#endif
+
+#if !defined(FAN_OPEN)
+#error missing fnotify FAN_OPEN flag
+#endif
+
+#if !defined(FAN_CLOSE)
+#error missing fnotify FAN_CLOSE flag
+#endif
+
+#if !defined(FAN_ONDIR)
+#error missing fnotify FAN_ONDIR flag
+#endif
+
+#if !defined(FAN_EVENT_ON_CHILD)
+#error missing fnotify FAN_EVENT_ON_CHILD flag
+#endif
+
+#if !defined(FAN_EVENT_OK)
+#error missing fnotify FAN_EVENT_OK macro
+#endif
+
+#if !defined(FAN_NOFD)
+#error missing fnotify FAN_NOFD macro
+#endif
+
+#define BUFFER_SIZE    (4096)
+
+int main(void)
+{
+       int fan_fd, ret;
+       size_t len;
+       struct fanotify_event_metadata *metadata;
+       void *buffer;
+
+       ret = posix_memalign(&buffer, BUFFER_SIZE, BUFFER_SIZE);
+       if (ret != 0 || buffer == NULL)
+               return -1;
+
+       fan_fd = fanotify_init(0, 0);
+       if (fan_fd < 0)
+               return -1;
+
+       ret = fanotify_mark(fan_fd, FAN_MARK_ADD | FAN_MARK_MOUNT,
+               FAN_ACCESS| FAN_MODIFY | FAN_OPEN | FAN_CLOSE |
+               FAN_ONDIR | FAN_EVENT_ON_CHILD, AT_FDCWD, "/");
+       (void)ret;
+
+       len = read(fan_fd, (void *)buffer, BUFFER_SIZE);
+       metadata = (struct fanotify_event_metadata *)buffer;
+
+       while (FAN_EVENT_OK(metadata, len)) {
+               metadata = FAN_EVENT_NEXT(metadata, len);
+       }
+
+       free(buffer);
+       (void)close(fan_fd);
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/test-inotify.c 
new/stress-ng-0.08.07/test-inotify.c
--- old/stress-ng-0.08.06/test-inotify.c        1970-01-01 01:00:00.000000000 
+0100
+++ new/stress-ng-0.08.07/test-inotify.c        2017-06-28 12:10:09.000000000 
+0200
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2012-2017 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+ *
+ * This code is a complete clean re-write of the stress tool by
+ * Colin Ian King <colin.k...@canonical.com> and attempts to be
+ * backwardly compatible with the stress tool by Amos Waterland
+ * <a...@rossby.metr.ou.edu> but has more stress tests and more
+ * functionality.
+ */
+#include <unistd.h>
+
+#if !defined(__linux__)
+#error requires linux to build
+#endif
+
+#include <sys/select.h>
+#include <sys/inotify.h>
+
+#if !defined(IN_DELETE_SELF)
+#error missing inotify IN_DELETE_SELF flag
+#endif
+
+#if !defined(IN_MOVE_SELF)
+#error missing inotify IN_MOVE_SELF flag
+#endif
+
+#if !defined(IN_MOVED_TO)
+#error missing inotify IN_MOVED_TO flag
+#endif
+
+#if !defined(IN_MOVED_FROM)
+#error missing inotify IN_MOVED_FROM flag
+#endif
+
+#if !defined(IN_ATTRIB)
+#error missing inotify IN_ATTRIB flag
+#endif
+
+#if !defined(IN_ACCESS)
+#error missing inotify IN_ACCESS flag
+#endif
+
+#if !defined(IN_MODIFY)
+#error missing inotify IN_MODIFY flag
+#endif
+
+#if !defined(IN_CREATE)
+#error missing inotify IN_CREATE flag
+#endif
+
+#if !defined(IN_OPEN)
+#error missing inotify IN_OPEN flag
+#endif
+
+#if !defined(IN_CLOSE_WRITE)
+#error missing inotify IN_CLOSE_WRITE flag
+#endif
+
+#if !defined(IN_CLOSE_NOWRITE)
+#error missing inotify IN_CLOSE_NOWRITE flag
+#endif
+
+#if !defined(IN_DELETE)
+#error missing inotify IN_DELETE flag
+#endif
+
+#if !defined(IN_DELETE_SELF)
+#error missing inotify IN_DELETE_SELF flag
+#endif
+
+#define BUFFER_SIZE    (4096)
+
+int main(void)
+{
+       int fd, ret, wd;
+       ssize_t len, i = 0;
+       char buffer[1024];
+
+       fd = inotify_init();
+       if (fd < 0)
+               return -1;
+
+       wd = inotify_add_watch(fd, "/", IN_ACCESS);
+
+       len = read(fd, buffer, sizeof(buffer));
+       if (len < 0)
+               return -1;
+
+       while ((i >= 0) && (i <= len - (ssize_t)sizeof(struct inotify_event))) {
+               struct inotify_event *event = (struct inotify_event 
*)&buffer[i];
+               i += sizeof(struct inotify_event) + event->len;
+       }
+
+       (void)inotify_rm_watch(fd, wd);
+       (void)close(fd);
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/test-mq-sysv.c 
new/stress-ng-0.08.07/test-mq-sysv.c
--- old/stress-ng-0.08.06/test-mq-sysv.c        2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/test-mq-sysv.c        2017-06-28 12:10:09.000000000 
+0200
@@ -67,7 +67,7 @@
        strncpy(msg.msg, "TESTMSG", sizeof(msg.msg));
        msg.mtype = 1;
        ret = msgsnd(msgq_id, &msg, sizeof(msg.msg), 0);
-       (void)msg;
+       (void)ret;
        ret = msgrcv(msgq_id, &msg, sizeof(msg.msg), 0, 0);
        (void)ret;
        ret = msgctl(msgq_id, IPC_STAT, &buf);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stress-ng-0.08.06/test-sem-posix.c 
new/stress-ng-0.08.07/test-sem-posix.c
--- old/stress-ng-0.08.06/test-sem-posix.c      2017-06-21 18:34:24.000000000 
+0200
+++ new/stress-ng-0.08.07/test-sem-posix.c      2017-06-28 12:10:09.000000000 
+0200
@@ -46,11 +46,17 @@
         * based code 
         */
        ret = sem_init(&sem, 1, 1);
+       (void)ret;
        ret = sem_wait(&sem);
+       (void)ret;
        ret = sem_post(&sem);
+       (void)ret;
        ret = sem_trywait(&sem);
+       (void)ret;
        ret = sem_timedwait(&sem, &timeout);
+       (void)ret;
        ret = sem_destroy(&sem);
+       (void)ret;
 
        return 0;
 }


Reply via email to