Re: How to best overload the fileops ?

看板FB_current作者時間12年前 (2013/08/22 08:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/8 (看更多)
On 08/21/2013 17:10, Mateusz Guzik wrote: > Short answer is provide epollops with your own fo_close and the rest as > it is currently in kqueueops. All function are static, but this is not a > real problem since you have to modify kern_event.c anyway. This is exactly what this code I am asking about is doing. kqueueops functions are all static. This modification allows to export fileops to child modules. Since there is nothing similar in the kernel code, I am asking does this way look ugly or not. > > I don't know how your code looks like in general, so in case its not > clear, simply wrapping sys_kqueue is inherently racy (some other thread > may close the fd or even reuse it for something else by the time you try > to do anything with it), thus modification of current code is > unavoidable. No, sys_kqueue calling code is all protected by the lock on this file object. So nobody can close or reuse it. Yuri _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1I5Lm2F7 (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1I5Lm2F7 (FB_current)