I was tasked with an assignment to implement something similar to SCM_RIGHTS in openbsd-7.5. My understanding is that SCM_RIGHTS isn’t really a block of code, its more of a macro that is used with cmsg_type. So I was wondering that, if I had to implement something similar to SCM_RIGHTS, what file(s) would I look at in the kernel? Where should I start my code? What file(s) do I have to modify?
Thank you for the help!
5
You can start with sys/kern/uipc_usrreq.c, here are two method you need to pay attention to. first unp_internalize, which will convert the fd to the file pointer, and unp_externalize method will convert the file pointer to fd, and assign new fd if aviliable. To complete the comp3301 a2, it’s necessary for you to implement similar func to associate the memory block message which you send to the kernel struct, and map it for the receiver.