[Toybox] I broke ulimit a while back...

Rob Landley rob at landley.net
Thu Jun 21 09:20:31 PDT 2018


The comment around line 51 of ulimit.c is:

// This is a linux kernel syscall added in 2.6.36 (git c022a0acad53) which
// glibc only exports a wrapper prototype for if you #define _FSF_HURD_RULZE.
int prlimit(pid_t pid, int resource, const struct rlimit *new_limit,
  struct rlimit *old_limit);

I.E. when you #include the two headers that "man 2 prlimit" tells you to, you
don't get a function prototype for the prlimit wrapper unless you declare your
software is part of the Free Software Foundation's Hurd project.

But the probe for "is this feature there in libc" does what the man page says,
include the two headers and have a main function that calls prlimit(0,0,0,0) and
see if it compiles. Which worked fine until commit 85ffccb38ef2 added
-Werror=implicit-function-declaration to CFLAGS, which causes that probe to fail
because the glibc header is buggy, which means CONFIG_ULIMIT depends on a symbol
that is never set when building against glibc.

I hadn't noticed because I've mostly been testing with musl-cross-make
compilers, and a command silently dropping out is hard to spot anyway.

I should probably work out some sort of "show me all disabled commands" plumbing
and add that to my release testing list. (In theory if the test suite was fully
populated and working I'd get "skipped" entries, except we only show skipped
tests when VERbOSE is set...

Anyway, doing release testing. Sorry I'm still running late...

Rob




More information about the Toybox mailing list