> I have a question on how to find if the given file descriptor is for socket.
 > Assume that we are in the kernel space and I have received a file
 > descriptor so I want to know if this file descriptor is socket file
 > descriptor.

Well, you could use getf() to convert the fd to a file_t and then check if
f_vnode->v_type == VSOCK.  But it seems a little odd that you're dealing
with file descriptors in the kernel instead of vnodes -- and I fear you're
quite far afield from the DDI interfaces that would enable your code to
work reliably as the kernel continues to evolve.

PS. If you end up using getf(), be sure to use releasef() when you're
    done or you'll have a refcount problem.

-- 
meem
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to