--00151750d868e371650496ba454f
Content-Type: text/plain; charset=ISO-8859-1
Hello,
Here is a patch for Apache2::SizeLimit under solaris 10, apache 2.2,
unthreaded prefork model :
diff -c ./mod_perl-2.0.4/blib/lib/Apache2/SizeLimit.pm ./SizeLimit.pm
*** ./mod_perl-2.0.4/blib/lib/Apache2/SizeLimit.pm Mon Dec 6 15:59:43
2010
--- ./SizeLimit.pm Mon Dec 6 18:41:04 2010
***************
*** 52,58 ****
if Apache2::MPM->is_threaded();
# decide at compile time how to check for a process' memory size.
! if (SOLARIS && $Config{'osvers'} >= 2.6) {
$HOW_BIG_IS_IT = \&solaris_2_6_size_check;
--- 52,58 ----
if Apache2::MPM->is_threaded();
# decide at compile time how to check for a process' memory size.
! if (SOLARIS && $Config{'osvers'} >= 2.6 || $Config{'osvers'} == 2.10)
{
$HOW_BIG_IS_IT = \&solaris_2_6_size_check;
***************
*** 133,139 ****
sub solaris_2_6_size_check {
my $file = "/proc/self/as";
! my $size = -s $file
or &error_log("Fatal Error: $file doesn't exist or is empty");
$size = int($size / 1024); # in Kb
return ($size, 0);
--- 133,141 ----
sub solaris_2_6_size_check {
my $file = "/proc/self/as";
! my $file2 = "/proc/$$/as";
! my $size = undef;
! $size = -s $file or $size = -s $file2
or &error_log("Fatal Error: $file doesn't exist or is empty");
$size = int($size / 1024); # in Kb
return ($size, 0);
Solaris 10 seems to no longer support /proc/self/as (or perhaps just not in
a non-global zone / container)
It does support "/proc/<pid>/as" though, pretty much in the same manner as
2.8. So the thought is just to try both.
The osver conditional breaks after solaris 9, as for Solaris 10 the version
is set to 2.10, which is < 2.6 (floating point).
Cheers
Brett
--00151750d868e371650496ba454f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div class=3D"gmail_quote">Hello,<br><br>Here is a patch for=A0 Apache2::Si=
zeLimit under solaris 10, apache 2.2, unthreaded prefork model :<br><br>dif=
f -c ./mod_perl-2.0.4/blib/lib/Apache2/SizeLimit.pm ./SizeLimit.pm<br>*** .=
/mod_perl-2.0.4/blib/lib/Apache2/SizeLimit.pm=A0=A0=A0=A0=A0 Mon Dec=A0 6 1=
5:59:43 2010<br>
--- ./SizeLimit.pm=A0=A0=A0=A0=A0 Mon Dec=A0 6 18:41:04 2010<br>***********=
****<br>*** 52,58 ****<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0 if Apache2::MPM->i=
s_threaded();<br><br>=A0=A0=A0=A0=A0 # decide at compile time how to check =
for a process' memory size.<br>!=A0=A0=A0=A0 if (SOLARIS && $Co=
nfig{'osvers'} >=3D 2.6) {<br>
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0 $HOW_BIG_IS_IT =3D \&solaris_2_6_size_c=
heck;<br><br>--- 52,58 ----<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0 if Apache2::MPM-=
>is_threaded();<br><br>=A0=A0=A0=A0=A0 # decide at compile time how to c=
heck for a process' memory size.<br>!=A0=A0=A0=A0 if (SOLARIS &&=
; $Config{'osvers'} >=3D 2.6 || $Config{'osvers'} =3D=3D=
2.10) {<br>
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0 $HOW_BIG_IS_IT =3D \&solaris_2_6_size_c=
heck;<br><br>***************<br>*** 133,139 ****<br><br>=A0 sub solaris_2_6=
_size_check {<br>=A0=A0=A0=A0=A0 my $file =3D "/proc/self/as";<br=
>!=A0=A0=A0=A0 my $size =3D -s $file<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0 or &error_log("Fatal Error: $file does=
n't exist or is empty");<br>=A0=A0=A0=A0=A0 $size =3D int($size / =
1024); # in Kb<br>=A0=A0=A0=A0=A0 return ($size, 0);<br>--- 133,141 ----<br=
><br>=A0 sub solaris_2_6_size_check {<br>
=A0=A0=A0=A0=A0 my $file =3D "/proc/self/as";<br>!=A0=A0=A0=A0 my=
$file2 =3D "/proc/$$/as";<br>!=A0=A0=A0=A0 my $size =3D undef;<b=
r>!=A0=A0=A0=A0 $size =3D -s $file or $size =3D -s $file2<br>=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 or &error_log("Fatal Error: $file doesn't exis=
t or is empty");<br>
=A0=A0=A0=A0=A0 $size =3D int($size / 1024); # in Kb<br>=A0=A0=A0=A0=A0 ret=
urn ($size, 0);<br><br>Solaris 10 seems to no longer support /proc/self/as =
(or perhaps just not in a non-global zone / container)<br>
<br>It does support "/proc/<pid>/as" though, pretty much in=
the same manner as 2.8. So the thought is just to try both.<br><br>The osv=
er conditional breaks after solaris 9, as for Solaris 10 the version is set=
to 2.10, which is < 2.6 (floating point).<br>
<br>Cheers<br><font color=3D"#888888">Brett <br>
</font></div><br>
--00151750d868e371650496ba454f--
