log send, sendrec, recv and notify system calls


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers log send, sendrec, recv and notify system calls
# 1  
Old 02-04-2008
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A notify-send Question --

Greetings. I've come across a bit of a problem with notify-send syntax; and wondered if anyone out there had found a solution in the woodpile somewhere :) Here's the snippet which is giving me trouble:notify-send 'Text to display' image_data 300, 300, , , , , /etc/image.pngOutput:Invalid... (0 Replies)
Discussion started by: LinQ
0 Replies

2. Shell Programming and Scripting

[linux] tail2notify - script interface between tail -f + grep and notify-send

This isn't exactly a question. Just thought I'd share something I just wrote and found useful. For those of you on modern linux boxen: you may be aware that there's a lovely little tool called notify-send that you can use to send notifications to the desktop. Any experienced shell-scripter could... (0 Replies)
Discussion started by: ryran
0 Replies

3. UNIX for Dummies Questions & Answers

system calls in C

Hello, how would i be able to call ps in C programming? thanks, ---------- Post updated at 01:39 AM ---------- Previous update was at 01:31 AM ---------- here's the complete system call, ps -o pid -p %d, getpit() (2 Replies)
Discussion started by: l flipboi l
2 Replies

4. Shell Programming and Scripting

notify-send does not notify real time

Hi, I am having a little trouble getting notify-send to work the way I would like it to. I am using ubuntu - karmic koala 2.6.31-19-generic #56-Ubuntu SMP So here's the problem run the following commands one after the other. notify-send -i info -t 100000 -- "Hi" "world" & notify-send -i... (3 Replies)
Discussion started by: linuxpenguin
3 Replies

5. Programming

ABOUT RECV() SYSTEM CALL (regarding timer)

Hi all, I am facing a problem in recv() system call i.e.. in my project i have to implement timer for sending (data) and resending purpose when there is no acknowledgement. is there any way that recv() sys call has its own timer i.e., for ex: recv() has to wait for 10 secs. if any... (0 Replies)
Discussion started by: Rohil
0 Replies

6. Programming

System calls

why user is not able to switch from user to kernel mode by writing the function whose code is identical to system call. (1 Reply)
Discussion started by: joshighanshyam
1 Replies

7. UNIX Desktop Questions & Answers

Using system calls

Hi, I'm new to UNIX system calls. Can someone share your knowledge as to how exactly system calls should be executed? Can they be typed like commands such as mkdir on the terminal itself? Also, are there any websites which will show me an example of the output to expect when a system call like... (1 Reply)
Discussion started by: ilavenil
1 Replies

8. Programming

UDP socket - can both client and server recv and send

Hi, Am very new to socket programming. When we use UDP sockets to communicate between two processess, will both the client/server socket be able to send/recv ? meaning can sendto()/ recvfrom() be used on both server and client? It could be useful even if anybody provide some link on socket... (1 Reply)
Discussion started by: rvan
1 Replies

9. Programming

send and recv ARP package in AS3.0

In attachment, is the code to test IP by ARP proxy. I always use it to test a IP already existing in my cluster. Usage: arp_func eth0 192.168.1.1 Enviroment: IA64, RedHat AS3.0, 2.4.21-15.EL, gcc-3.2.3-34, "gcc -o arp_func arp_func.c" When the code below added before... (0 Replies)
Discussion started by: lameryang
0 Replies

10. UNIX for Dummies Questions & Answers

System calls for cp and mv

Which system calls are made for operations cp and mv (2 Replies)
Discussion started by: gaurava99
2 Replies
Login or Register to Ask a Question
notify-send(1)							   User Commands						    notify-send(1)

NAME
notify-send - a CLI program to send desktop notifications SYNOPSIS
notify-send [--help ] [--urgency=level] [--expire-time=time] [--icon=icon,icon...] [--category=type,type...] [--hint=type:name:value] [sum- mary] [body] DESCRIPTION
Using notify-send, you can send desktop notifications to the user via a notification daemon from the command line. The notifications are used to inform the user about an asynchronous event or display some useful information without getting in the user's way. OPTIONS
The following options are supported: -?, --help Display help text. -u, --urgency=level Specifies the urgency level, including low, normal and critical. -t, --expire-time=time Specifies the timeout in milliseconds at which to expire the notification. -i, --icon=icons Specifies an icon filename or stock icon to display. -c, --category=types Specifies the notification category. -h, --hint=hint Specifies basic extra data to pass. The format is type:name:value and valid types are int, double, string and byte -v, --version Display version information. EXIT STATUS
0 All information was written successfully. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-panel | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
The Desktop Notification Spec on http://www.galago-project.org/specs/notification/. NOTES
Written by Jedy Wang, Sun Microsystems Inc., 2007. SunOS 5.11 28 Feb 2007 notify-send(1)