|
| 1 | +Undefine fstatat64 on musl before calling fstatat64 syscall |
| 2 | + |
| 3 | +Fixes |
| 4 | + |
| 5 | +In file included from ../../base/rand_util_posix.cc:21: |
| 6 | +../../third_party/lss/linux_syscall_support.h:4547:16: error: use of undeclared identifier '__NR_fstatat'; did you mean 'sys_fstatat'? |
| 7 | + LSS_INLINE _syscall4(int, fstatat64, int, d, |
| 8 | + ^ |
| 9 | +../../third_party/lss/linux_syscall_support.h:2671:9: note: expanded from macro '_syscall4' |
| 10 | + LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3)); \ |
| 11 | + ^ |
| 12 | +../../third_party/lss/linux_syscall_support.h:2640:39: note: expanded from macro 'LSS_BODY' |
| 13 | + : "i"(__NR_##name) , ## args \ |
| 14 | + ^ |
| 15 | +<scratch space>:222:1: note: expanded from here |
| 16 | +__NR_fstatat |
| 17 | +^ |
| 18 | +../../third_party/lss/linux_syscall_support.h:4547:16: note: 'sys_fstatat' declared here |
| 19 | +../../third_party/lss/linux_syscall_support.h:2668:12: note: expanded from macro '_syscall4' |
| 20 | + type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ |
| 21 | + ^ ../../third_party/lss/linux_syscall_support.h:1901:28: note: expanded from macro 'LSS_NAME' |
| 22 | + #define LSS_NAME(name) sys_##name |
| 23 | + ^ |
| 24 | +<scratch space>:213:1: note: expanded from here |
| 25 | +sys_fstatat |
| 26 | +^ |
| 27 | + |
| 28 | +Upstream-Status: Inappropriate [musl specific] |
| 29 | +Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 30 | + |
| 31 | +--- a/third_party/lss/linux_syscall_support.h |
| 32 | ++++ b/third_party/lss/linux_syscall_support.h |
| 33 | +@@ -4544,9 +4544,13 @@ struct kernel_statfs { |
| 34 | + } |
| 35 | + #endif |
| 36 | + #if defined(__NR_fstatat64) |
| 37 | ++ // musl does #define fstatat64 fstatat |
| 38 | ++ #undef fstatat64 |
| 39 | + LSS_INLINE _syscall4(int, fstatat64, int, d, |
| 40 | + const char *, p, |
| 41 | + struct kernel_stat64 *, b, int, f) |
| 42 | ++ // set it back like it was |
| 43 | ++ #define fstatat64 fstatat |
| 44 | + #endif |
| 45 | + #if defined(__NR_waitpid) |
| 46 | + // waitpid is polyfilled below when not available. |
0 commit comments