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: Wade Tregaskis <email@hidden>
- Date: Mon, 24 Mar 2003 20:20:24 +1100
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.
Note that the CLI tool "sysctl", e.g. "sysctl kern.clockrate", returns
different values to the sysctl() call. For instance, it returns 100Hz
as the clock rate of my iBook, but the sysctl() call returns
99-point-something. The latter is of course the more accurate one.
Wade Tregaskis
_______________________________________________
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.