[libc-commits] [libc] Return errno from OFD failure paths in fcntl. (PR #166252)

via libc-commits libc-commits at lists.llvm.org
Mon Nov 3 20:51:12 PST 2025


lntue wrote:

> > > Do we have a test for this?
> > 
> > 
> > There's an analogous test that checks `F_GETFL`, not the OFD variant. If you modify that test to specify F_OFD_GETLK, it fails before this patch.
> > https://github.com/llvm/llvm-project/blob/285b57b1a68e6738dac047f5f6461f231448b0f5/libc/test/src/fcntl/fcntl_test.cpp#L160-L168
> > 
> > It looks like more generally none of the OFD paths are tested. Do we have parameterized testing for libc or an issue to add something like `TEST_P`?
> 
> @lntue to confirm, but I think we basically do ad-hoc parametrized testing in various places -- definitely for math functions with various rounding modes, but also for some stdlib routines:
> 
> https://github.com/llvm/llvm-project/blob/285b57b1a68e6738dac047f5f6461f231448b0f5/libc/test/src/stdlib/StrtolTest.h#L421-L423

+1 for small ad-hoc parametrizing tests when it makes sense, like when the behaviors / implementations won't diverge in the future.

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


More information about the libc-commits mailing list