Hi, Folks:

I got confuse on the Linux kernel study. Can anyone help me out there?

The problem is:

For example:
        
        When I use sento(), this will cause interrupt (0x80), and then
transfer to kernel mode. Under kernel mode, it will call
sys_socketcall(SYS_SENDTO). Following the source, I find that the
sys_sendto will be called. Following is the example,
/*
 *  Send a datagram to a given address. We move the address into kernel
 *  space and check the user space data area is readable before invoking
 *  the protocol.
 */

asmlinkage int sys_sendto(int fd, void * buff, int len, unsigned flags,
     struct sockaddr *addr, int addr_len)
{
  struct socket *sock;
  char address[MAX_SOCK_ADDR];
  int err;
  struct msghdr msg;
  struct iovec iov;

  if(len<0)
    return -EINVAL;
  err=verify_area(VERIFY_READ,buff,len);
  if(err)
      return err;
  if (!(sock = sockfd_lookup(fd, &err)))
    return err;

  iov.iov_base=buff;
  iov.iov_len=len;
  msg.msg_name = NULL;
  msg.msg_namelen = 0;
  msg.msg_iov=&iov;
  msg.msg_iovlen=1;
  msg.msg_control=NULL;
  if (addr && addr_len) {
    err=move_addr_to_kernel(addr,addr_len,address);
    if (err < 0)
    {
      sockfd_put(sock);
      return err;
    }
    msg.msg_name=address;
    msg.msg_namelen=addr_len;
  }

 

/****************************************/
/****************************************/
/*
        MY problem is here                */
/*****************************************/
 err=sock->ops->sendmsg(sock, &msg, len, (sock->file->f_flags &
O_NONBLOCK), flags);
 
/***** WHat/where is the function sock->ops->sendmsg() definition on the
kernel source tree?
*/

 sockfd_put(sock);
  return err;
} /* define at net/socket.c ****/

/*************************************


I know that sock->ops is the sturct to define the function point of a lot
of function call; However I can not understand/find the define of
sendmsg().


Can any help me? TIA.

C.L.




--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.

Reply via email to