Simplify linux_getcwd(), removing code that seems to be no longer used.
Details
Details
- Reviewers
kib dchagin - Group Reviewers
Linux Emulation - Commits
- rS281882: Simplify linux_getcwd(), removing code that was longer used.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
vn_fullpath may fail if intermediate entries in the path not in the cache.
sys/compat/linux/linux_getcwd.c | ||
---|---|---|
74–75 | kern___getcwd() limits buflen to MAXPATHLEN |
Comment Actions
vn_fullpath() does what the removed code did, but probably with less bugs left. Only the last entry cache is critical to the operation, for the directories, the linear scan is performed if cache failed.
sys/compat/linux/linux_getcwd.c | ||
---|---|---|
77 | Yes, but we need to cap the "len" before we call malloc. |
sys/compat/linux/linux_getcwd.c | ||
---|---|---|
77 | Always malloc LINUX_PATH_MAX bytes ? |
sys/compat/linux/linux_getcwd.c | ||
---|---|---|
85 | If we use UIO_USERSPACE, how do we determine the path length then? We can't call strlen() for user buffer. |
Comment Actions
Another try. The kern/ parts were committed earlier. Yeah,
we could avoid strlen and a copy, but kern___getcwd() gets enough
parameters as it is; please let's leave it for another time.