#4928 closed enhancement (fixed)
Implement POSIX *at() Functions
| Reported by: | bonefish | Owned by: | axeld |
|---|---|---|---|
| Priority: | normal | Milestone: | R1 |
| Component: | System/POSIX | Version: | R1/alpha1 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Has a Patch: | no | Platform: | All |
Description (last modified by bonefish)
POSIX.1-2008 introduces standard functions to operate on FD + relative path pairs:
- faccessat()
- fchmodat()
- fchownat()
fstatat()- linkat()
mkdirat()- mkfifoat()
- mknodat()
openat()readlinkat()- renameat()
symlinkat()unlinkat()utimensat()
The new open modes O_SEARCH AND O_EXEC should also be implemented.
Change History (12)
comment:1 Changed 4 years ago by bonefish
- Description modified (diff)
comment:2 Changed 4 years ago by bonefish
- Description modified (diff)
Implemented fstatat() in hrev33987.
comment:3 Changed 4 years ago by bonefish
- Description modified (diff)
Implemented POSIX.1-2008 functions unlinkat(), symlinkat(), mkdirat(), and
utimensat() in hrev34010.
comment:4 Changed 4 years ago by axeld
- Owner changed from nobody to axeld
- Status changed from new to assigned
comment:5 Changed 4 years ago by axeld
Implemented the remaining functions in hrev34288 - just noticed that linkat() is still missing, though, will do that next.
comment:6 Changed 4 years ago by axeld
- Resolution set to fixed
- Status changed from assigned to closed
Implemented linkat() in hrev34289.
comment:7 Changed 4 years ago by bonefish
Nice so far, but what about O_SEARCH and O_EXEC. Reopen the ticket or create a new one?
comment:8 follow-up: ↓ 9 Changed 4 years ago by axeld
Is this related to the *at() functions? If not, I would prefer a new ticket for those.
comment:9 in reply to: ↑ 8 Changed 4 years ago by bonefish
Replying to axeld:
Is this related to the *at() functions? If not, I would prefer a new ticket for those.
Er, have you read the specification of any of the *at() functions? O_SEARCH definitely is related. O_EXEC not so much, unless you consider fexecve() kind of belonging to the lot -- it could be somewhat tricky to implement, anyway, so we might want to track it separately.
comment:10 follow-up: ↓ 11 Changed 4 years ago by axeld
According to the specification, O_SEARCH can also be passed to open(). That's why I asked :-)
comment:11 in reply to: ↑ 10 Changed 4 years ago by bonefish
Replying to axeld:
According to the specification, O_SEARCH can also be passed to open(). That's why I asked :-)
Yep, it can be passed to open() and openat(), but it affects all *at() functions. It's mostly about permission checking, but not supporting this mode calls for ported packages that check for the *at() functions existence and implicitly assume O_SEARCH to exist as well. I'm actually almost surprised that none of the ported code in the repository does that. This kind of problem is why I had to introduce the B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT in the first place.
comment:12 Changed 4 years ago by axeld
I guess it's good enough for the time being, but that should definitely be fixed before the next release :-)

Implemented openat() and readlinkat() in hrev33976 and hrev33978 respectively.