[LTP] [PATCH 1/2] getrlimit/getrlimit03: add configure-time check for struct ulimit64

Petr Vorel pvorel@suse.cz
Wed Dec 5 17:47:22 CET 2018


Hi Greg,

> bionic prefers to grab kernel-facing definitions directly from the UAPI
> headers, so sys/resource.h includes linux/resource.h.
Thanks for info.

> I could switch the test to explicitly use linux/resource.h, if you feel that
> makes more sense.  I originally used sys/resource.h to get all the other
> rlimit-related constants.  I actually didn't realize that the kernel already
> exported a struct rlimit64 definition that we could use in place of
> open-coding something.
You answer yourself - RLIM_NLIMITS and other rlimit-related constants are
needed.

+ using <linux/resource.h> conflicts with other <time.h> usage in LTP library headers.

In file included from /usr/include/time.h:48,
                 from ../../../../include/safe_file_ops_fn.h:22,
                 from ../../../../include/tst_safe_file_ops.h:27,
                 from ../../../../include/tst_test.h:87,
                 from getrlimit03.c:29:
/usr/include/bits/types/struct_itimerspec.h: At top level:
/usr/include/bits/types/struct_itimerspec.h:8:8: error: redefinition of ‘struct itimerspec’


Kind regards,
Petr


More information about the ltp mailing list