Page MenuHomeFreeBSD

Add scandirat(3)
ClosedPublic

Authored by kib on Aug 23 2022, 5:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 9:39 PM
Unknown Object (File)
Mar 10 2024, 9:39 PM
Unknown Object (File)
Mar 10 2024, 9:39 PM
Unknown Object (File)
Mar 10 2024, 9:38 PM
Unknown Object (File)
Mar 10 2024, 9:38 PM
Unknown Object (File)
Mar 10 2024, 9:38 PM
Unknown Object (File)
Mar 7 2024, 9:58 PM
Unknown Object (File)
Feb 28 2024, 10:55 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Aug 23 2022, 5:04 AM
kib added a reviewer: manpages.
gbe added a subscriber: gbe.

LGTM for the man page parts.

emaste added inline comments.
include/dirent.h
135

any reason the first argument [only] is named?

This revision is now accepted and ready to land.Aug 23 2022, 1:34 PM
kib marked an inline comment as done.Aug 23 2022, 1:35 PM
kib added inline comments.
include/dirent.h
135

No, it was copy/paste. Thanks for noting.

kib marked an inline comment as done.

Do not name dirfd in scandirat(3) prototype.

This revision now requires review to proceed.Aug 23 2022, 1:37 PM
This revision is now accepted and ready to land.Aug 23 2022, 1:38 PM

Looks good. Maybe add a 'tidy up a few scandir_b related issues while in the area' to the commit message?
Otherwise looks great.

lib/libc/gen/Makefile.inc
498

I'd mention adding this link in the commit since it was missing before (eg, it's otherwise unrelated to this change)

Looks fine to me aside from the manpage typos :)

lib/libc/gen/scandir.3
35–37

Shouldn't scandirat be added here too?

117

Missing "an" ("takes an additional dirfd argument")?

124
In D36301#824708, @imp wrote:

Looks good. Maybe add a 'tidy up a few scandir_b related issues while in the area' to the commit message?
Otherwise looks great.

This is the cumulative diff against the branch.
Per commit view is available at https://kib.kiev.ua/git/gitweb.cgi?p=deviant3.git;a=shortlog;h=refs/heads/scandirat

kib marked 4 inline comments as done.

Man page fixes.
Add scandirat and scandir_b to .Nm's of scandir.3

This revision now requires review to proceed.Aug 24 2022, 3:15 AM
This revision is now accepted and ready to land.Aug 24 2022, 3:19 AM
markj added inline comments.
lib/libc/gen/scandir.3
122
128

The wording implies that in the case where dirname is absolute, dirfd may be invalid. But, that's not true right? So in the description of the absolute case, perhaps add, "The .Fa dirfd argument is unused, but must be a valid file descriptor or the special value .Dv AT_FDCWD."

131
kib marked 2 inline comments as done.Aug 24 2022, 5:33 PM
kib added inline comments.
lib/libc/gen/scandir.3
128

Hm, I thought that dirfd can be invalid. And both from my reading of namei_setup(), and actual testing, dirfd is ignored when first character of path is '/':

openat(-10000004,"/etc/passwd",O_RDONLY,00)      = 3 (0x3)
This revision now requires review to proceed.Aug 24 2022, 5:34 PM
markj added inline comments.
lib/libc/gen/scandir.3
128

Oops, sorry. I looked at namei() before writing the comment, but misread.

This revision is now accepted and ready to land.Aug 24 2022, 5:47 PM