[LTP] [PATCH v2 2/2] syscalls/openat: Add new regression test when using open(O_TMPFILE) under umask

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Mon Aug 15 09:58:55 CEST 2022


Hi Petr

> Hi all,
> 
> ...
>>> +static void open_tmpfile_supported(int dirfd)
>>> +{
>>> +	TEST(openat(dirfd, ".", O_TMPFILE | O_RDWR, S_IXGRP | S_ISGID));
>>> +
>>> +	if (TST_RET == -1) {
>>> +		if (errno == ENOTSUP)
>>> +			tst_brk(TCONF, "fs doesn't support O_TMPFILE");
>>> +		else
>>> +			tst_brk(TBROK | TTERRNO, "open(%d, O_TMPFILE) failed", dirfd);
>>> +	}
> 
>> What if openat() returns some other negative value?
> How about add ENOTSUP to safe_openat() (lib/tst_safe_file_at.c) and use SAFE_OPENAT() here?

I am fine with this.

Best Regards
Yang Xu
> 
> Kind regards,
> Petr
> 
>>> +
>>> +	SAFE_CLOSE(TST_RET);
>>> +}
> ...


More information about the ltp mailing list