I am tracing the socket related code, and can’t find the socket ops which is corresponding to sys call write or read.
Can anybody help me?
The following code segment is sock ops. Which one is corresponding to sys write or read?
Thanks!!!!
static const struct proto_ops hci_sock_ops = {
.family = PF_BLUETOOTH,
.owner = THIS_MODULE,
.release = hci_sock_release,
.bind = hci_sock_bind,
.getname = hci_sock_getname,
.sendmsg = hci_sock_sendmsg,
.recvmsg = hci_sock_recvmsg,
.ioctl = hci_sock_ioctl,
.poll = datagram_poll,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = hci_sock_setsockopt,
.getsockopt = hci_sock_getsockopt,
.connect = sock_no_connect,
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.mmap = sock_no_mmap
};
Most of the magic – the demultiplexing – happens in the VFS layer. The read/write functions are
*_recvmsgand*_sendmsg, respectively.