Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.c

Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.c

From: Kris Katterjohn <katterjohn_at_gmail.com>
Date: Sat, 16 Dec 2006 10:47:51 -0600

Dmitry V. Levin wrote:
> On Fri, Dec 15, 2006 at 11:43:38AM -0600, Kris Katterjohn wrote:
>> This simple patch dramatically reduces the number of fopen()s and
>> fclose()s used when getting random numbers from nbase_rnd.c by keeping
>> the rng device open.
>>
>> Before:
>>
>> # strace nmap -p- localhost 2>&1 | grep 'open("/dev/[au]*random"' | wc
>> 512 3584 31744
>>
>> After:
>>
>> # strace ./nmap -p- localhost 2>&1 | grep 'open("/dev/[au]*random"' | wc
>> 2 14 124
>
> You can also compare "strace -c" output to estimate effect of the change.
>

Oh cool, thanks. The only problem with trying to compare the difference
like this is that fopen() has more "stuff" in it than an open() call. If
it's just like the one in K&R (Ch. 8 or 9, I believe), it might not be a
big deal, but with what's probably in glibc, for example, it's likely
bloated -- or at least "feature-rich" :)

Of course I _am_ the one who initially counted the open()s, but I just
wanted to see how many times fopen() is called, along with the extra
stuff in it.

Thanks,
Kris Katterjohn

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Dec 16 2006

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]