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

Petr Vorel pvorel@suse.cz
Thu Aug 4 22:32:12 CEST 2022


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?

Kind regards,
Petr

> > +
> > +	SAFE_CLOSE(TST_RET);
> > +}
...


More information about the ltp mailing list