Re: BSD::Resource and getrusage(2) [PATCH]

2006-07-07 Thread Philip M. Gollucci
server localhost:8529 started
t/apache/basic.ok
t/apache/deprecatedok
t/pod..ok
All tests successful.
Files=3, Tests=18,  2 wallclock secs ( 0.98 cusr +  0.12 csys =  1.09 CPU)
[warning] server localhost:8529 shutdown

[That was from svn trunk, after patch applied]


-- 

Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: BSD::Resource and getrusage(2) [PATCH]

2006-07-07 Thread Philip M. Gollucci
> Doesn't that imply that it's in kb per stat clock ticks?
I think you read it backwards, but I agree with the outcome.

svn diff
Index: lib/Apache/SizeLimit.pm
===
--- lib/Apache/SizeLimit.pm (revision 419830)
+++ lib/Apache/SizeLimit.pm (working copy)
@@ -247,8 +247,15 @@
 return ( $size, 0 );
 }

+## rss is in KB
+## ixrss is in BYTES
+## this is true on at least FreeBSD, OpenBSD, NetBSD, and Darwin
 sub _bsd_size_check {
-return ( BSD::Resource::getrusage() )[ 2, 3 ];
+my @results = BSD::Resource::getrusage();
+my $max_rss   = $results[2];
+my $max_ixrss = int ( $results[3] / 1024 );
+
+return ( $max_rss, $max_ixrss );
 }





-- 

Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"