From f5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:52 -0500 Subject: build: Build mlibc + add distclean target Signed-off-by: Ian Moffett --- lib/mlibc/tests/posix/readv-writev.c | 51 ------------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 lib/mlibc/tests/posix/readv-writev.c (limited to 'lib/mlibc/tests/posix/readv-writev.c') diff --git a/lib/mlibc/tests/posix/readv-writev.c b/lib/mlibc/tests/posix/readv-writev.c deleted file mode 100644 index 5025ce2..0000000 --- a/lib/mlibc/tests/posix/readv-writev.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include - -#ifdef USE_HOST_LIBC -#define TEST_FILE "readv-writev-host-libc.tmp" -#else -#define TEST_FILE "readv-writev.tmp" -#endif - -int main() { - // Make sure that it wasn't created by a previous test run - unlink(TEST_FILE); - - int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0644); - assert(fd != -1); - - char str0[] = "hello "; - char str1[] = "world!"; - - struct iovec bufs[2] = { - { - .iov_base = &str0, - .iov_len = strlen(str0), - }, - { - .iov_base = &str1, - .iov_len = strlen(str1), - }, - }; - - ssize_t written = writev(fd, bufs, 2); - assert(written == 12); - - memset(&str0, 0, strlen(str0)); - memset(&str1, 0, strlen(str1)); - - assert(!lseek(fd, 0, SEEK_SET)); - - ssize_t read = readv(fd, bufs, 2); - assert(read == 12); - - assert(!strncmp(str0, "hello ", 7)); - assert(!strncmp(str1, "world!", 7)); - - assert(!close(fd)); - - unlink(TEST_FILE); -} -- cgit v1.2.3