[ILUG] C Questions
William Murphy
alias at student.nuigalway.ie
Mon Jan 24 11:51:44 GMT 2000
Hi all,
Just having one or two problems writing a little network daemon:
1. Most programs in the inetutils distribution seem to lose their
controlling terminals as follows:
int tty = open( "/dev/tty", O_RDWR );
ioctl( tty, TIOCNOTTY );
close( tty );
All of the function calls proceed successfully, but the program stays in
the foreground. The alternative of fork()ing seems kinda like cheating.
Any ideas?
2. I want the program to listen on a given port on all network
interfaces. Programs running under inetd do this, but my program is
standalone.
Other standalone daemons seem to do this. Obviously when one binds to a
local address, it only listens on the interface to which that address
belongs, eg if i bind with the address 127.0.0.1, then my program won't
listen on my ethernet card's address.
Thanks in advance,
William Murphy
<alias at student.nuigalway.ie>
More information about the ILUG
mailing list