[libc-commits] [libc] [libc] implement `sys/uio/readv` (PR #124718)

via libc-commits libc-commits at lists.llvm.org
Tue Jan 28 18:46:07 PST 2025


================
@@ -0,0 +1,30 @@
+//===-- Unittests for readv -----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/fcntl/open.h"
+#include "src/sys/uio/readv.h"
+#include "src/unistd/close.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
+#include "test/UnitTest/Test.h"
+
+using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
+
+TEST(LlvmLibcSysUioReadvTest, SmokeTest) {
+  int fd = LIBC_NAMESPACE::open("/dev/urandom", O_RDONLY);
----------------
c8ef wrote:

Maybe it would be more convenient to use an API like `tmpfile`? Or should we write to a file first and then read from it?

https://github.com/llvm/llvm-project/pull/124718


More information about the libc-commits mailing list