aosp: report POSIX symlink st_size from lstat - #11332
Conversation
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
There was a problem hiding this comment.
Code Review
This pull request updates __abi_wrap_fstatat to normalize symlink sizes on platforms like Android by querying the target path length via readlinkat. The reviewer pointed out that readlinkat could fail and pollute errno even when the wrapper returns success, and suggested saving and restoring errno around the call to prevent this side effect.
andrewsavage1
left a comment
There was a problem hiding this comment.
We should only change the posix wrappers to have it conform with posix specifications, not use it to support platform-specific quirks. Unless it's not possible, this change should be implemented as an android-specific wrapper, similar to the asset management with stat/open
POSIX requires a symlink's st_size to be the length of its target path. Android's /data filesystem reports a different value. Fixes the following issues in tests posix_lstat_test.cc:97 EXPECT_EQ(sb.st_size, target_filename.length()) Bug: 532068409
Head branch was pushed to by a user without write access
|
@andrewsavage1 moved the fix to the posix_emu wrapper |
|
@rogerzanoni you need to fix the lint checks here |
POSIX requires a symlink's st_size to be the length of its target path. Android's /data filesystem reports a different value.
Fixes the following issues in tests
posix_lstat_test.cc:97 EXPECT_EQ(sb.st_size, target_filename.length())
Bug: 532068409