Summary: | dev-util/pretrace-0.4 fails to build with glibc 2.8 (ARG_MAX undefined) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Evil Compile Person <bugs> |
Component: | New packages | Assignee: | Ali Polatel (RETIRED) <hawking> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bsd, flameeyes |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 225459 | ||
Attachments: |
Fix to include limits.h
Fix for ARG_MAX using sysconf |
Description
Evil Compile Person
2008-06-17 19:25:36 UTC
Created attachment 157387 [details, diff]
Fix to include limits.h
Include <linux/limits.h> to fix problem.
(In reply to comment #1) > Created an attachment (id=157387) [edit] > Fix to include limits.h > > Include <linux/limits.h> to fix problem. > including a linux-specific header is not the solution. Linux headers should never be directly referenced and included in userspace programs, because it cripples portability. A more portable fix would be: #if defined(_SC_ARG_MAX) # if defined(ARG_MAX) # undef ARG_MAX # endif # define ARG_MAX sysconf (_SC_ARG_MAX) #endif just after the last system headers includes.
>
> just after the last system headers includes.
>
That is indeed more portable and elegant. Thanks!
Created attachment 157451 [details, diff]
Fix for ARG_MAX using sysconf
System header shouldn't be included. Used sysconf instead.
This appears to be yours now hawking. (In reply to comment #4) Thanx, this patch forks ok on amd64. |