Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lookupd



Luke Howard <email@hidden> writes:

Usually localhost and broadcasthost are in the local NetInfo domain.
I don't think hard-coding them in gethostbyname() is a good idea.

I have two reasons for suggesting it:

1) Any code that relies on "localhost" identifying some IPv4 address other than 127.0.0.1 for it to work properly is, I will argue, fundamentally broken. There is a lot of code in the wild that assumes this equivalence. Pretending it isn't there is stupid. (Admittedly, "broadcasthost" is another story, but still: to what address-- *other* than 255.255.255.255-- would a presumptively sane person want it to resolve.)

2) Anything that isn't resolved inline by gethostbyname() ends up turning into an XDR formatted message on a Mach IPC port and causing the lookupd daemon to fire off a new thread, in order to feed it to an array of lookup agents in the configured search order. Seems like a pretty heavy operation for looking up a value that had better always be 127.0.0.1 or something exceedingly impolite is happening (probably without the user being asked first).

Since a lot of normal people have "localhost" as their host name, it seems like resolving the IPv4 address associated with that hostname might be something you want to do quickly.

Or not. I guess. Don't ask me. I just work here.

IIRC, Mentat did a lot of STREAMS implementations. But last time I looked,
native sockets were back in Solaris (parallel infrastructure) for
performance reasons.

Solaris expects network interface drivers to comply with the DLPI. I wrote one in a previous life. Their implementation of STREAMS only bears superficial resemblence to the Magic Garden.

For one thing, they've extended it to live in a multi-threaded kernel; Solaris actually *does* run on systems with more than two processors...


--
j h woodyatt <email@hidden>
"somebody has to do something, and it's just incredibly
pathetic that it has to be us." --jerry garcia
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.