• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get clock ticks for sb_timeo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >How to get clock ticks for sb_timeo (From: Bernd Löhr <email@hidden>)

  • Prev by Date: How to get clock ticks for sb_timeo
  • Next by Date: Re: How to get clock ticks for sb_timeo
  • Previous by thread: How to get clock ticks for sb_timeo
  • Next by thread: Re: How to get clock ticks for sb_timeo
  • Index(es):
    • Date
    • Thread