![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using system calls | ilavenil | UNIX Desktop for Dummies Questions & Answers | 1 | 03-01-2008 05:21 AM |
| UDP socket - can both client and server recv and send | rvan | High Level Programming | 1 | 05-09-2007 03:36 AM |
| System calls? | PlunderBunny | UNIX for Dummies Questions & Answers | 2 | 03-26-2006 10:12 PM |
| send and recv ARP package in AS3.0 | lameryang | High Level Programming | 0 | 09-22-2005 12:05 AM |
| System calls for cp and mv | gaurava99 | UNIX for Dummies Questions & Answers | 2 | 04-25-2005 11:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
log send, sendrec, recv and notify system calls
Hi, I've a question about MINIX OS. 1 - I would like to log the messages that user or kernel process send to each other through the system call send, recv, sendrec and notify. Since MINIX is a microkernel OS, I suppose that the best way is to have an TCP socket, listening in INADDR_ANY address. But, I don't know which port should I use. Can anyone help me? 2 - I've the following code: Code:
int main(void)
{
int sockfd, new_fd; // listen on sock_fd, new connection on new_fd
struct sockaddr_in my_addr; // my address information
struct sockaddr_in their_addr; // connector's address information
socklen_t sin_size;
struct sigaction sa;
int yes=1;
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
}
(..)
my_addr.sin_family = AF_INET; // host byte order
my_addr.sin_port = htons(MYPORT); // short, network byte order
my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP
memset(my_addr.sin_zero, '\0', sizeof my_addr.sin_zero);
if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof my_addr) == -1) {
perror("bind");
exit(1);
}
(...)
}
But I get the error that, "Address family is not supported". I don't understand why? Thanks, Pedro |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|