Re: How to get clock ticks for sb_timeo
Re: How to get clock ticks for sb_timeo
- Subject: Re: How to get clock ticks for sb_timeo
- From: Bernd Löhr <email@hidden>
- Date: Mon, 24 Mar 2003 12:07:14 +0100
Wade, I'm in the kernel - so I cannot call sysctl. Would it be safe to
declare extern int hz? It seems to work (my kext loads), though. I
would prefer a function call, of course.
Am Montag, 24.03.03 um 10:20 Uhr schrieb Wade Tregaskis:
I need to set the timeout value so_rcv.sb_timeo (for sosend /
soreceive) in my kernel socket. Can anybody tell me how to obtain the
correct value for the clock ticks to compute the timeout?
One way I can think of is sysctl. You'll have to dig through header
files to find the right definitions (the man pages are simply wrong),
but they are there - look under the kern branch, for clockrate. It
returns a struct, in which you'll find the clock frequency, and the
number of microseconds per clock tick. They should be what you need.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.