From d892051f37c2c4ad7f345f6a817ea3d38e56a431 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 Dec 2019 10:50:12 +0100 Subject: SOCKATMARK(3): Import from FreeBSD Update #3798. --- testsuite/syscalls01/test_main.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'testsuite') diff --git a/testsuite/syscalls01/test_main.c b/testsuite/syscalls01/test_main.c index c1c15d24..78c7dd44 100644 --- a/testsuite/syscalls01/test_main.c +++ b/testsuite/syscalls01/test_main.c @@ -565,6 +565,35 @@ test_socket_ioctl(void) assert(rtems_resource_snapshot_check(&snapshot)); } +static void +test_socket_sockatmark(void) +{ + rtems_resource_snapshot snapshot; + int sd; + int rv; + + puts("test socket sockatmark"); + + rtems_resource_snapshot_take(&snapshot); + + sd = socket(PF_INET, SOCK_DGRAM, 0); + assert(sd >= 0); + + rv = sockatmark(sd); + assert(rv == 0); + + rv = close(sd); + assert(rv == 0); + + errno = 0; + rv = sockatmark(sd); + assert(rv == -1); + assert(errno == EBADF); + + epoch_cleanup(); + assert(rtems_resource_snapshot_check(&snapshot)); +} + static void no_mem_socket_bind(int fd) { @@ -1727,6 +1756,7 @@ test_main(void) test_socket_unsupported_ops(); test_socket_ioctl(); + test_socket_sockatmark(); test_socket_bind(); test_socket_connect(); test_socket_listen(); -- cgit v1.2.3