Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: comp.unix.wizards Subject: Re: Wizard-level questions Message-ID: <1991Jan26.142403.22812@mp.cs.niu.edu> Date: 26 Jan 91 14:24:03 GMT References: <16048@sdcc6.ucsd.edu> Organization: Northern Illinois University Lines: 25 In article <16048@sdcc6.ucsd.edu> cs163wcr@sdcc10.ucsd.edu (I support the U.N.) writes: >[1] Can you access a file by its i-node number? Something like > (for C code) FILE *iopen (int inode, char *mode) ? I hope not. Otherwise permissions on directories wouldn't do much. I do think the system design would have been cleaner if you only accessed by i-node number, and mapping filename to inode was done outside the kernel. But I doubt that I have many supporters in this "keep the kernel small" view. >[2] With Internet sockets, how does a machine accept()ing a > socket connection know what machine is calling it? Does > it rely on the calling program to tell it? getpeername() should get you the internet address and port number of the calling machine, and then gethostbyaddr() will attempt to map the Internet address into a domain name. There are added complexities due to the byte order on the network being possibly different from that of your machine, but there are standard library routines such as ntohl(3) to take care of this problem too. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115 +1-815-753-6940