Results 1 to 5 of 5
Iperf client calls write() to send a message to iperf server. My aim - is to find out the way the information goes thru the kernel. First of all, i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-16-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 3
write() method for sockets in kernel
Iperf client calls write() to send a message to iperf server. My aim - is to find out the way the information goes thru the kernel. First of all, i wanna find write method for sockets. it's something like that
Could u please help me?Code:int (*sendmsg) (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t total_len);
- 02-17-2008 #2Just Joined!
- Join Date
- Feb 2008
- Posts
- 7
well, write() is the system call, which takes fd (ie. file descriptor) as one of the arguments. you can get the code of write() system call in <kernel_source_dir>/fs/open.c (i guess) and the function name would be sys_write().. now depending upon the file descriptor, kernel will identify that its a regular file descriptor or a socket descriptor. once it finds that the descriptor is socket, it will call the socket's write method, which will be pointing to "sendmsg".. i hope this helps..
- 02-17-2008 #3Just Joined!
- Join Date
- Feb 2008
- Posts
- 3
Thank you for your answer)))
I'll try to find socket's sendmsg method that way
- 02-17-2008 #4Just Joined!
- Join Date
- Feb 2008
- Posts
- 3
- 02-18-2008 #5Just Joined!
- Join Date
- Feb 2008
- Posts
- 7
sorry about that.. u'll find it in fs/read_write.c (as u mentioned).. method name would be sys_write() (sys_<name>) is the convention for syscalls in linux..


Reply With Quote

