Subject: what is /etc/skeykeys?
To: None <port-mac68k@netbsd.org>
From: Roger Brown <rogerhb@xtra.co.nz>
List: port-mac68k
Date: 10/10/1999 12:29:53
Hello list,

I have been running a few of my own applications on NetBSD 1.4.1 and have
noticed that the file descriptors do not start at 3. Normally a process has
0,1  and 2 has as stdin, stdout and stderr.

But my processes when started have....

0=="/dev/ttyp0"
1=="/dev/ttyp0"
2=="/dev/ttyp0"
3=="/etc/skeykeys"
4=="/etc/skeykeys"

and if I have used the 'netdb' functions...

5==/etc/hosts

if I use machine console then 0,1 and 2 are "/dev/ttye0" and this appears
normal.
and BTW the program name (argv[0]) matches "/proc/curproc/file"

So what is "/etc/skeykeys", mine is zero length, and if I delete it gets
recreated at a new login.
So is this a hangover from the shell, 'telnetd' or 'getty'. 
It occurs also on the machine console so I assume it's not 'telnetd'.
As it gets recreated in "/etc" I assume it's not the shell as this should be
a user process.

Who uses this file?
Why is it open twice?
Why is it there no fcntl(fd,F_SETFD,1) so that it gets closed on 'exec' of
the user program?

NetBSD 1.4.1

Regards

Roger