sock_upcall vs select for kernel socket polling?

I've been using sock_upcall to do socket polling in my VFS kext.

Perusing the Darwin/XNU sources, I've stumbled upon select.

Which is the recommended way to do socket polling in the kernel, sock_upcall or select?

Thanks.

Answered by DTS Engineer in 801627022

select is a user-space thing; you can’t use it within the kernel.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

select is a user-space thing; you can’t use it within the kernel.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for replying.

I had a closer look at the signature of select and realised that there was no way I knew of that I could get a file descriptor to pass into it within the kernel.

sock_upcall vs select for kernel socket polling?
 
 
Q