#include <support/xsocket.h>
#include <support/xunistd.h>
#include <stdbool.h>
+#include <socket-constants-time64.h>
/* AF_INET socket and address used to receive data. */
static int srv;
/* Enable 32 bit timeval precision and check if no 64 bit timeval stamp
is created. */
{
- int r = setsockopt (srv, SOL_SOCKET, SO_TIMESTAMP_OLD, &(int){1},
+ int r = setsockopt (srv, SOL_SOCKET, COMPAT_SO_TIMESTAMP_OLD, &(int){1},
sizeof (int));
TEST_VERIFY_EXIT (r != -1);
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
- if (sizeof (time_t) > 4 && cmsg->cmsg_type == SO_TIMESTAMP_NEW)
+ if (sizeof (time_t) > 4 && cmsg->cmsg_type == COMPAT_SO_TIMESTAMP_NEW)
found_timestamp = true;
else
- TEST_VERIFY (cmsg->cmsg_type != SO_TIMESTAMP_NEW);
+ TEST_VERIFY (cmsg->cmsg_type != COMPAT_SO_TIMESTAMP_NEW);
}
TEST_COMPARE (found_timestamp, sizeof (time_t) > 4);
/* Same as before, but for timespec. */
{
- int r = setsockopt (srv, SOL_SOCKET, SO_TIMESTAMPNS_OLD, &(int){1},
+ int r = setsockopt (srv, SOL_SOCKET, COMPAT_SO_TIMESTAMPNS_OLD, &(int){1},
sizeof (int));
TEST_VERIFY_EXIT (r != -1);
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
- if (sizeof (time_t) > 4 && cmsg->cmsg_type == SO_TIMESTAMPNS_NEW)
+ if (sizeof (time_t) > 4 && cmsg->cmsg_type == COMPAT_SO_TIMESTAMPNS_NEW)
found_timestamp = true;
else
- TEST_VERIFY (cmsg->cmsg_type != SO_TIMESTAMPNS_NEW);
+ TEST_VERIFY (cmsg->cmsg_type != COMPAT_SO_TIMESTAMPNS_NEW);
}
TEST_COMPARE (found_timestamp, sizeof (time_t) > 4);
/* Enable 32 bit timeval precision and check if no 64 bit timeval stamp
is created. */
{
- int r = setsockopt (srv, SOL_SOCKET, SO_TIMESTAMP_OLD, &(int){1},
+ int r = setsockopt (srv, SOL_SOCKET, COMPAT_SO_TIMESTAMP_OLD, &(int){1},
sizeof (int));
TEST_VERIFY_EXIT (r != -1);
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
- if (sizeof (time_t) > 4 && cmsg->cmsg_type == SO_TIMESTAMP_NEW)
+ if (sizeof (time_t) > 4 && cmsg->cmsg_type == COMPAT_SO_TIMESTAMP_NEW)
found_timestamp = true;
else
- TEST_VERIFY (cmsg->cmsg_type != SO_TIMESTAMP_NEW);
+ TEST_VERIFY (cmsg->cmsg_type != COMPAT_SO_TIMESTAMP_NEW);
}
if (sizeof (time_t) > 4)
/* Same as before, but for timespec. */
{
- int r = setsockopt (srv, SOL_SOCKET, SO_TIMESTAMPNS_OLD, &(int){1},
+ int r = setsockopt (srv, SOL_SOCKET, COMPAT_SO_TIMESTAMPNS_OLD, &(int){1},
sizeof (int));
TEST_VERIFY_EXIT (r != -1);
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
- if (sizeof (time_t) > 4 && cmsg->cmsg_type == SO_TIMESTAMPNS_NEW)
+ if (sizeof (time_t) > 4 && cmsg->cmsg_type == COMPAT_SO_TIMESTAMPNS_NEW)
found_timestamp = true;
else
- TEST_VERIFY (cmsg->cmsg_type != SO_TIMESTAMPNS_NEW);
+ TEST_VERIFY (cmsg->cmsg_type != COMPAT_SO_TIMESTAMPNS_NEW);
}
if (sizeof (time_t) > 4)