summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/syscall01/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/libtests/syscall01/init.c')
-rw-r--r--testsuites/libtests/syscall01/init.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/testsuites/libtests/syscall01/init.c b/testsuites/libtests/syscall01/init.c
index 8b63348a5d..1e0d27eaa5 100644
--- a/testsuites/libtests/syscall01/init.c
+++ b/testsuites/libtests/syscall01/init.c
@@ -39,19 +39,39 @@ static void test(void)
int rv;
char buf [1];
ssize_t n;
- int fd = open(open_driver_path, O_RDWR);
+ int fd;
+
+ fd = open(open_driver_path, O_RDWR);
rtems_test_assert(fd >= 0);
+ errno = 0;
n = send(fd, buf, sizeof(buf), 0);
rtems_test_assert(n == -1);
rtems_test_assert(errno == ENOTSOCK);
+ errno = 0;
n = recv(fd, buf, sizeof(buf), 0);
rtems_test_assert(n == -1);
rtems_test_assert(errno == ENOTSOCK);
rv = close(fd);
rtems_test_assert(rv == 0);
+
+ fd = socket(PF_INET, SOCK_DGRAM, 0);
+ rtems_test_assert(fd >= 0);
+
+ errno = 0;
+ rv = fsync(fd);
+ rtems_test_assert(rv == -1);
+ rtems_test_assert(errno == EINVAL);
+
+ errno = 0;
+ rv = fdatasync(fd);
+ rtems_test_assert(rv == -1);
+ rtems_test_assert(errno == EINVAL);
+
+ rv = close(fd);
+ rtems_test_assert(rv == 0);
}
static void Init(rtems_task_argument arg)