httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: cvs commit: apache/src conf.h
Date Mon, 25 Nov 1996 01:20:32 GMT
> Ok, you are right.  I actually looked at the code this time to see which
> of the two billion defines are being used for what, and the real problem
> is that on AIX, sys/wait.h includes sys/resource.h if _ALL_SOURCE is
> defined. 
> 
> standards.h, which is included by a whole whack of headers, defines
> _ALL_SOURCE based on:
> 
> 	#if (!defined (_XOPEN_SOURCE)) &&  (!defined (_POSIX_SOURCE)) && (!defined
(_ANSI_C_SOURCE))
> 	#define _XOPEN_SOURCE
> 	#define _POSIX_SOURCE
> 	#define _ANSI_C_SOURCE
> 	#ifndef _ALL_SOURCE
> 	#define _ALL_SOURCE
> 	#endif
> 	#endif
> 
> The code causing the problem is the set_rlimit routine in http_core.c, which
> is surrounded by:
>
>   #if defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC)
> 
> Since sys/resource.h is being included indirectly, some of the
> above are defined.
> 
> Is there some reason that HAVE_SYS_RESOURCE_H isn't used here instead?

Yes. Some systems, while they may have <sys/resources.h>, may not define
the needed macros for the particular resource we are trying to control here.
As I look more at this code here, it seems that someone was over zealous
with the defines though.

In the case of your patch, it appears to be valid that the rlim_t needs
to be typed, but for correctness probably needs to include HAVE_SYS_RESOURCE_H.
Obviously no big deal. My first thought was that the AIX compile was being
run for some other architecture and getting HAVE_SYS_RESOURCE_H defined
when it should not be. I'll look more at http_core.c






Mime
View raw message