# where is FreeBSD's corresponding data structure for Linux's "struct timer_list ?"



## liuwang (Nov 21, 2011)

Where is FreeBSD's corresponding data structure for Linux's struct timer_list?


----------



## liuwang (Nov 21, 2011)

*Is "ktimer" the one for Linux "struct timer_list ?"*

Is "ktimer" the one ?



```
struct ktimer {
	nt_dispatch_header	k_header;
	uint64_t		k_duetime;
	union {
		list_entry		k_timerlistentry;
		struct callout		*k_callout;
	} u;
	void			*k_dpc;
	uint32_t		k_period;
};
```


----------



## richardpl (Nov 21, 2011)

Obviously not, ktimer is Windows crap.

And FreeBSD do not need to have corresponding data structure with Linux at all.


----------



## vertexSymphony (Nov 21, 2011)

richardpl said:
			
		

> Obviously not, ktimer is Windows crap.
> 
> And FreeBSD do not need to have corresponding data structure with Linux at all.



There was no need to be aggressive like that =/
Maybe not the same structure, but he refers to *where* you can get the same functionality/information in FreeBSD.


----------



## liuwang (Nov 22, 2011)

Thanks your reply anyway.

What and where is the FreeBSD's mechanism for timeout timer?

Sincerely,
Liu


----------



## SirDice (Nov 22, 2011)

Not sure if it fits the bill but there's timer_create(2) and evtimer_add(3) (from devel/libevent).


----------



## richardpl (Nov 22, 2011)

That is for userland, just to be sure.


----------



## liuwang (Nov 22, 2011)

SirDice,

Thanks.
Retrieved down to timeet.h from your hint.

Sincerely,
Liu


----------

