On 2/4/2022 5:21 PM, Waldemar Brodkorb wrote:
Did you forget the preprocessor directive -D_GNU_SOURCE?
Which kernel version predates the prlimit64 syscall you are using?
best regards Waldemar
The older kernel is 2.6.22.19. Looks like prlimit came around kernel 2.6.36. https://man7.org/linux/man-pages/man1/prlimit.1.html I use buildroot to compile which I think it passing all the right things. The older kernel gives me this error while compiling uclibc-ng. prlimit64 syscall just wasn't around before 2.6.36.
CC libc/sysdeps/linux/common/prlimit.os In file included from ./include/sys/syscall.h:33, from ./libc/sysdeps/linux/common/sysdep.h:19, from ./libc/sysdeps/linux/mips/sysdep.h:24, from libc/sysdeps/linux/common/prlimit.c:19: libc/sysdeps/linux/common/prlimit.c: In function 'prlimit': ./libc/sysdeps/linux/mips/sysdep.h:33:33: error: '__NR_prlimit64' undeclared (first use in this function) 33 | # define SYS_ify(syscall_name) __NR_##syscall_name | ^~~~~ ./include/bits/syscalls.h:167:11: note: in definition of macro 'internal_syscall4' 167 | : input, "r" (__a0), "r" (__a1), "r" (__a2) \ | ^~~~~ ./include/bits/syscalls.h:50:36: note: in expansion of macro 'SYS_ify' 50 | "i" (SYS_ify (name)), err, args) | ^~~~~~~ ./include/bits/syscalls.h:24:24: note: in expansion of macro 'INTERNAL_SYSCALL' 24 | long result_var = INTERNAL_SYSCALL(name, err, nr, args); \ | ^~~~~~~~~~~~~~~~ libc/sysdeps/linux/common/prlimit.c:25:10: note: in expansion of macro 'INLINE_SYSCALL' 25 | return INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit, | ^~~~~~~~~~~~~~ ./libc/sysdeps/linux/mips/sysdep.h:33:33: note: each undeclared identifier is reported only once for each function it appears in 33 | # define SYS_ify(syscall_name) __NR_##syscall_name | ^~~~~ ./include/bits/syscalls.h:167:11: note: in definition of macro 'internal_syscall4' 167 | : input, "r" (__a0), "r" (__a1), "r" (__a2) \ | ^~~~~ ./include/bits/syscalls.h:50:36: note: in expansion of macro 'SYS_ify' 50 | "i" (SYS_ify (name)), err, args) | ^~~~~~~ ./include/bits/syscalls.h:24:24: note: in expansion of macro 'INTERNAL_SYSCALL' 24 | long result_var = INTERNAL_SYSCALL(name, err, nr, args); \ | ^~~~~~~~~~~~~~~~ libc/sysdeps/linux/common/prlimit.c:25:10: note: in expansion of macro 'INLINE_SYSCALL' 25 | return INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit, | ^~~~~~~~~~~~~~ make[2]: *** [Makerules:369: libc/sysdeps/linux/common/prlimit.os] Error 1
The error with my newer (older) kernel, 2.6.36.4, was a result of my only reverting the 2nd prlimit commit and not the 1st, so that was my error.
Lance