|
|
03d83a |
From 9aada05f4c7f95220a5b16416f530419db6b4dff Mon Sep 17 00:00:00 2001
|
|
|
03d83a |
From: "Dmitry V. Levin" <ldv@strace.io>
|
|
|
03d83a |
Date: Fri, 23 Jul 2021 08:00:00 +0000
|
|
|
03d83a |
Subject: [PATCH] tests: change sockopt-timestamp test to use
|
|
|
03d83a |
syscall(__NR_recvmsg)
|
|
|
03d83a |
|
|
|
03d83a |
Since the glibc recvmsg wrapper became unsuitable for our needs,
|
|
|
03d83a |
invoke __NR_recvmsg syscall directly.
|
|
|
03d83a |
|
|
|
03d83a |
* tests/sockopt-timestamp.c: Include "scno.h" and <errno.h>,
|
|
|
03d83a |
conditionalize on __NR_recvmsg.
|
|
|
03d83a |
(TEST_OLD_SCM_TIMESTAMPS): Remove.
|
|
|
03d83a |
(k_recvmsg): New function.
|
|
|
03d83a |
(test_sockopt): Use it instead of recvmsg.
|
|
|
03d83a |
---
|
|
|
03d83a |
tests/sockopt-timestamp.c | 72 ++++++++++++++++++++++-------------------------
|
|
|
03d83a |
1 file changed, 34 insertions(+), 38 deletions(-)
|
|
|
03d83a |
|
|
|
03d83a |
diff --git a/tests/sockopt-timestamp.c b/tests/sockopt-timestamp.c
|
|
|
03d83a |
index 56627bb..ed73ca1 100644
|
|
|
03d83a |
--- a/tests/sockopt-timestamp.c
|
|
|
03d83a |
+++ b/tests/sockopt-timestamp.c
|
|
|
03d83a |
@@ -9,44 +9,45 @@
|
|
|
03d83a |
*/
|
|
|
03d83a |
|
|
|
03d83a |
#include "tests.h"
|
|
|
03d83a |
-#include <stdio.h>
|
|
|
03d83a |
-#include <string.h>
|
|
|
03d83a |
-#include <unistd.h>
|
|
|
03d83a |
-#include <sys/socket.h>
|
|
|
03d83a |
-
|
|
|
03d83a |
-#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
-# include <linux/time_types.h>
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+#include "scno.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#include "kernel_timeval.h"
|
|
|
03d83a |
-#include "kernel_old_timespec.h"
|
|
|
03d83a |
+#ifdef __NR_recvmsg
|
|
|
03d83a |
|
|
|
03d83a |
-#define XLAT_MACROS_ONLY
|
|
|
03d83a |
-# include "xlat/sock_options.h"
|
|
|
03d83a |
-#undef XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include <errno.h>
|
|
|
03d83a |
+# include <stdio.h>
|
|
|
03d83a |
+# include <string.h>
|
|
|
03d83a |
+# include <unistd.h>
|
|
|
03d83a |
+# include <sys/socket.h>
|
|
|
03d83a |
|
|
|
03d83a |
-#undef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
+# if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
+ || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
+# include <linux/time_types.h>
|
|
|
03d83a |
+# endif
|
|
|
03d83a |
|
|
|
03d83a |
-/*
|
|
|
03d83a |
- * Sadly, starting with commit
|
|
|
03d83a |
- * glibc-2.33.9000-707-g13c51549e2077f2f3bf84e8fd0b46d8b0c615912, on every
|
|
|
03d83a |
- * 32-bit architecture where 32-bit time_t support is enabled,
|
|
|
03d83a |
- * glibc mangles old scm timestamps.
|
|
|
03d83a |
- */
|
|
|
03d83a |
-#if GLIBC_PREREQ_GE(2, 33) && defined __TIMESIZE && __TIMESIZE != 64
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 0
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# include "kernel_timeval.h"
|
|
|
03d83a |
+# include "kernel_old_timespec.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#ifndef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 1
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# define XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include "xlat/sock_options.h"
|
|
|
03d83a |
+# undef XLAT_MACROS_ONLY
|
|
|
03d83a |
|
|
|
03d83a |
-#if TEST_OLD_SCM_TIMESTAMPS \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
+static const char *errstr;
|
|
|
03d83a |
+
|
|
|
03d83a |
+static long
|
|
|
03d83a |
+k_recvmsg(const unsigned int fd, const void *const ptr, const unsigned int flags)
|
|
|
03d83a |
+{
|
|
|
03d83a |
+ const kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL;
|
|
|
03d83a |
+ const kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL;
|
|
|
03d83a |
+ const kernel_ulong_t arg1 = fill | fd;
|
|
|
03d83a |
+ const kernel_ulong_t arg2 = (uintptr_t) ptr;
|
|
|
03d83a |
+ const kernel_ulong_t arg3 = fill | flags;
|
|
|
03d83a |
+ const long rc = syscall(__NR_recvmsg, arg1, arg2, arg3, bad, bad, bad);
|
|
|
03d83a |
+ if (rc && errno == ENOSYS)
|
|
|
03d83a |
+ perror_msg_and_skip("recvmsg");
|
|
|
03d83a |
+ errstr = sprintrc(rc);
|
|
|
03d83a |
+ return rc;
|
|
|
03d83a |
+}
|
|
|
03d83a |
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
static void
|
|
|
03d83a |
print_timestamp_old(const struct cmsghdr *c)
|
|
|
03d83a |
{
|
|
|
03d83a |
@@ -84,7 +85,6 @@ print_timestampns_old(const struct cmsghdr *c)
|
|
|
03d83a |
printf("{tv_sec=%lld, tv_nsec=%lld}",
|
|
|
03d83a |
(long long) ts.tv_sec, (long long) ts.tv_nsec);
|
|
|
03d83a |
}
|
|
|
03d83a |
-# endif /* TEST_OLD_SCM_TIMESTAMPS */
|
|
|
03d83a |
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
static void
|
|
|
03d83a |
@@ -162,7 +162,7 @@ test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *))
|
|
|
03d83a |
.msg_controllen = sizeof(control)
|
|
|
03d83a |
};
|
|
|
03d83a |
|
|
|
03d83a |
- if (recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
+ if (k_recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
perror_msg_and_fail("recvmsg");
|
|
|
03d83a |
if (close(sv[0]))
|
|
|
03d83a |
perror_msg_and_fail("close recv");
|
|
|
03d83a |
@@ -210,10 +210,8 @@ main(void)
|
|
|
03d83a |
const char *str;
|
|
|
03d83a |
void (*fun)(const struct cmsghdr *);
|
|
|
03d83a |
} tests[] = {
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
{ SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old },
|
|
|
03d83a |
{ SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old },
|
|
|
03d83a |
-# endif
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
{ SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new },
|
|
|
03d83a |
# endif
|
|
|
03d83a |
@@ -235,8 +233,6 @@ main(void)
|
|
|
03d83a |
|
|
|
03d83a |
#else
|
|
|
03d83a |
|
|
|
03d83a |
-SKIP_MAIN_UNDEFINED("TEST_OLD_SCM_TIMESTAMPS"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_TIMESPEC"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_SOCK_TIMEVAL")
|
|
|
03d83a |
+SKIP_MAIN_UNDEFINED("__NR_recvmsg")
|
|
|
03d83a |
|
|
|
03d83a |
#endif
|
|
|
03d83a |
diff --git a/tests-m32/sockopt-timestamp.c b/tests-m32/sockopt-timestamp.c
|
|
|
03d83a |
index 56627bb..ed73ca1 100644
|
|
|
03d83a |
--- a/tests-m32/sockopt-timestamp.c
|
|
|
03d83a |
+++ b/tests-m32/sockopt-timestamp.c
|
|
|
03d83a |
@@ -9,44 +9,45 @@
|
|
|
03d83a |
*/
|
|
|
03d83a |
|
|
|
03d83a |
#include "tests.h"
|
|
|
03d83a |
-#include <stdio.h>
|
|
|
03d83a |
-#include <string.h>
|
|
|
03d83a |
-#include <unistd.h>
|
|
|
03d83a |
-#include <sys/socket.h>
|
|
|
03d83a |
-
|
|
|
03d83a |
-#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
-# include <linux/time_types.h>
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+#include "scno.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#include "kernel_timeval.h"
|
|
|
03d83a |
-#include "kernel_old_timespec.h"
|
|
|
03d83a |
+#ifdef __NR_recvmsg
|
|
|
03d83a |
|
|
|
03d83a |
-#define XLAT_MACROS_ONLY
|
|
|
03d83a |
-# include "xlat/sock_options.h"
|
|
|
03d83a |
-#undef XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include <errno.h>
|
|
|
03d83a |
+# include <stdio.h>
|
|
|
03d83a |
+# include <string.h>
|
|
|
03d83a |
+# include <unistd.h>
|
|
|
03d83a |
+# include <sys/socket.h>
|
|
|
03d83a |
|
|
|
03d83a |
-#undef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
+# if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
+ || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
+# include <linux/time_types.h>
|
|
|
03d83a |
+# endif
|
|
|
03d83a |
|
|
|
03d83a |
-/*
|
|
|
03d83a |
- * Sadly, starting with commit
|
|
|
03d83a |
- * glibc-2.33.9000-707-g13c51549e2077f2f3bf84e8fd0b46d8b0c615912, on every
|
|
|
03d83a |
- * 32-bit architecture where 32-bit time_t support is enabled,
|
|
|
03d83a |
- * glibc mangles old scm timestamps.
|
|
|
03d83a |
- */
|
|
|
03d83a |
-#if GLIBC_PREREQ_GE(2, 33) && defined __TIMESIZE && __TIMESIZE != 64
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 0
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# include "kernel_timeval.h"
|
|
|
03d83a |
+# include "kernel_old_timespec.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#ifndef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 1
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# define XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include "xlat/sock_options.h"
|
|
|
03d83a |
+# undef XLAT_MACROS_ONLY
|
|
|
03d83a |
|
|
|
03d83a |
-#if TEST_OLD_SCM_TIMESTAMPS \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
+static const char *errstr;
|
|
|
03d83a |
+
|
|
|
03d83a |
+static long
|
|
|
03d83a |
+k_recvmsg(const unsigned int fd, const void *const ptr, const unsigned int flags)
|
|
|
03d83a |
+{
|
|
|
03d83a |
+ const kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL;
|
|
|
03d83a |
+ const kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL;
|
|
|
03d83a |
+ const kernel_ulong_t arg1 = fill | fd;
|
|
|
03d83a |
+ const kernel_ulong_t arg2 = (uintptr_t) ptr;
|
|
|
03d83a |
+ const kernel_ulong_t arg3 = fill | flags;
|
|
|
03d83a |
+ const long rc = syscall(__NR_recvmsg, arg1, arg2, arg3, bad, bad, bad);
|
|
|
03d83a |
+ if (rc && errno == ENOSYS)
|
|
|
03d83a |
+ perror_msg_and_skip("recvmsg");
|
|
|
03d83a |
+ errstr = sprintrc(rc);
|
|
|
03d83a |
+ return rc;
|
|
|
03d83a |
+}
|
|
|
03d83a |
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
static void
|
|
|
03d83a |
print_timestamp_old(const struct cmsghdr *c)
|
|
|
03d83a |
{
|
|
|
03d83a |
@@ -84,7 +85,6 @@ print_timestampns_old(const struct cmsghdr *c)
|
|
|
03d83a |
printf("{tv_sec=%lld, tv_nsec=%lld}",
|
|
|
03d83a |
(long long) ts.tv_sec, (long long) ts.tv_nsec);
|
|
|
03d83a |
}
|
|
|
03d83a |
-# endif /* TEST_OLD_SCM_TIMESTAMPS */
|
|
|
03d83a |
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
static void
|
|
|
03d83a |
@@ -162,7 +162,7 @@ test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *))
|
|
|
03d83a |
.msg_controllen = sizeof(control)
|
|
|
03d83a |
};
|
|
|
03d83a |
|
|
|
03d83a |
- if (recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
+ if (k_recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
perror_msg_and_fail("recvmsg");
|
|
|
03d83a |
if (close(sv[0]))
|
|
|
03d83a |
perror_msg_and_fail("close recv");
|
|
|
03d83a |
@@ -210,10 +210,8 @@ main(void)
|
|
|
03d83a |
const char *str;
|
|
|
03d83a |
void (*fun)(const struct cmsghdr *);
|
|
|
03d83a |
} tests[] = {
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
{ SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old },
|
|
|
03d83a |
{ SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old },
|
|
|
03d83a |
-# endif
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
{ SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new },
|
|
|
03d83a |
# endif
|
|
|
03d83a |
@@ -235,8 +233,6 @@ main(void)
|
|
|
03d83a |
|
|
|
03d83a |
#else
|
|
|
03d83a |
|
|
|
03d83a |
-SKIP_MAIN_UNDEFINED("TEST_OLD_SCM_TIMESTAMPS"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_TIMESPEC"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_SOCK_TIMEVAL")
|
|
|
03d83a |
+SKIP_MAIN_UNDEFINED("__NR_recvmsg")
|
|
|
03d83a |
|
|
|
03d83a |
#endif
|
|
|
03d83a |
diff --git a/tests-mx32/sockopt-timestamp.c b/tests-mx32/sockopt-timestamp.c
|
|
|
03d83a |
index 56627bb..ed73ca1 100644
|
|
|
03d83a |
--- a/tests-mx32/sockopt-timestamp.c
|
|
|
03d83a |
+++ b/tests-mx32/sockopt-timestamp.c
|
|
|
03d83a |
@@ -9,44 +9,45 @@
|
|
|
03d83a |
*/
|
|
|
03d83a |
|
|
|
03d83a |
#include "tests.h"
|
|
|
03d83a |
-#include <stdio.h>
|
|
|
03d83a |
-#include <string.h>
|
|
|
03d83a |
-#include <unistd.h>
|
|
|
03d83a |
-#include <sys/socket.h>
|
|
|
03d83a |
-
|
|
|
03d83a |
-#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
-# include <linux/time_types.h>
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+#include "scno.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#include "kernel_timeval.h"
|
|
|
03d83a |
-#include "kernel_old_timespec.h"
|
|
|
03d83a |
+#ifdef __NR_recvmsg
|
|
|
03d83a |
|
|
|
03d83a |
-#define XLAT_MACROS_ONLY
|
|
|
03d83a |
-# include "xlat/sock_options.h"
|
|
|
03d83a |
-#undef XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include <errno.h>
|
|
|
03d83a |
+# include <stdio.h>
|
|
|
03d83a |
+# include <string.h>
|
|
|
03d83a |
+# include <unistd.h>
|
|
|
03d83a |
+# include <sys/socket.h>
|
|
|
03d83a |
|
|
|
03d83a |
-#undef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
+# if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \
|
|
|
03d83a |
+ || defined HAVE_STRUCT___KERNEL_TIMESPEC
|
|
|
03d83a |
+# include <linux/time_types.h>
|
|
|
03d83a |
+# endif
|
|
|
03d83a |
|
|
|
03d83a |
-/*
|
|
|
03d83a |
- * Sadly, starting with commit
|
|
|
03d83a |
- * glibc-2.33.9000-707-g13c51549e2077f2f3bf84e8fd0b46d8b0c615912, on every
|
|
|
03d83a |
- * 32-bit architecture where 32-bit time_t support is enabled,
|
|
|
03d83a |
- * glibc mangles old scm timestamps.
|
|
|
03d83a |
- */
|
|
|
03d83a |
-#if GLIBC_PREREQ_GE(2, 33) && defined __TIMESIZE && __TIMESIZE != 64
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 0
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# include "kernel_timeval.h"
|
|
|
03d83a |
+# include "kernel_old_timespec.h"
|
|
|
03d83a |
|
|
|
03d83a |
-#ifndef TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
-# define TEST_OLD_SCM_TIMESTAMPS 1
|
|
|
03d83a |
-#endif
|
|
|
03d83a |
+# define XLAT_MACROS_ONLY
|
|
|
03d83a |
+# include "xlat/sock_options.h"
|
|
|
03d83a |
+# undef XLAT_MACROS_ONLY
|
|
|
03d83a |
|
|
|
03d83a |
-#if TEST_OLD_SCM_TIMESTAMPS \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_TIMESPEC \
|
|
|
03d83a |
- || defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
+static const char *errstr;
|
|
|
03d83a |
+
|
|
|
03d83a |
+static long
|
|
|
03d83a |
+k_recvmsg(const unsigned int fd, const void *const ptr, const unsigned int flags)
|
|
|
03d83a |
+{
|
|
|
03d83a |
+ const kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL;
|
|
|
03d83a |
+ const kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL;
|
|
|
03d83a |
+ const kernel_ulong_t arg1 = fill | fd;
|
|
|
03d83a |
+ const kernel_ulong_t arg2 = (uintptr_t) ptr;
|
|
|
03d83a |
+ const kernel_ulong_t arg3 = fill | flags;
|
|
|
03d83a |
+ const long rc = syscall(__NR_recvmsg, arg1, arg2, arg3, bad, bad, bad);
|
|
|
03d83a |
+ if (rc && errno == ENOSYS)
|
|
|
03d83a |
+ perror_msg_and_skip("recvmsg");
|
|
|
03d83a |
+ errstr = sprintrc(rc);
|
|
|
03d83a |
+ return rc;
|
|
|
03d83a |
+}
|
|
|
03d83a |
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
static void
|
|
|
03d83a |
print_timestamp_old(const struct cmsghdr *c)
|
|
|
03d83a |
{
|
|
|
03d83a |
@@ -84,7 +85,6 @@ print_timestampns_old(const struct cmsghdr *c)
|
|
|
03d83a |
printf("{tv_sec=%lld, tv_nsec=%lld}",
|
|
|
03d83a |
(long long) ts.tv_sec, (long long) ts.tv_nsec);
|
|
|
03d83a |
}
|
|
|
03d83a |
-# endif /* TEST_OLD_SCM_TIMESTAMPS */
|
|
|
03d83a |
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
static void
|
|
|
03d83a |
@@ -162,7 +162,7 @@ test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *))
|
|
|
03d83a |
.msg_controllen = sizeof(control)
|
|
|
03d83a |
};
|
|
|
03d83a |
|
|
|
03d83a |
- if (recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
+ if (k_recvmsg(sv[0], &mh, 0) != (int) size)
|
|
|
03d83a |
perror_msg_and_fail("recvmsg");
|
|
|
03d83a |
if (close(sv[0]))
|
|
|
03d83a |
perror_msg_and_fail("close recv");
|
|
|
03d83a |
@@ -210,10 +210,8 @@ main(void)
|
|
|
03d83a |
const char *str;
|
|
|
03d83a |
void (*fun)(const struct cmsghdr *);
|
|
|
03d83a |
} tests[] = {
|
|
|
03d83a |
-# if TEST_OLD_SCM_TIMESTAMPS
|
|
|
03d83a |
{ SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old },
|
|
|
03d83a |
{ SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old },
|
|
|
03d83a |
-# endif
|
|
|
03d83a |
# ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL
|
|
|
03d83a |
{ SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new },
|
|
|
03d83a |
# endif
|
|
|
03d83a |
@@ -235,8 +233,6 @@ main(void)
|
|
|
03d83a |
|
|
|
03d83a |
#else
|
|
|
03d83a |
|
|
|
03d83a |
-SKIP_MAIN_UNDEFINED("TEST_OLD_SCM_TIMESTAMPS"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_TIMESPEC"
|
|
|
03d83a |
- " || HAVE_STRUCT___KERNEL_SOCK_TIMEVAL")
|
|
|
03d83a |
+SKIP_MAIN_UNDEFINED("__NR_recvmsg")
|
|
|
03d83a |
|
|
|
03d83a |
#endif
|
|
|
03d83a |
--
|
|
|
03d83a |
2.1.4
|
|
|
03d83a |
|