Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.sys.hp Subject: Re: name clash in PW library in HP-UX 6.2 Message-ID: <953@auspex.UUCP> Date: 4 Feb 89 23:04:45 GMT References: <2836@mhres.mh.nl> <920020@hp-ses.SDE.HP.COM> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 40 >A look at some older HP-UX code for another architecture shows that >the libc version is a real system call instead of a library call; it's >a stub that jumps to the kernel routine. The kernel routine most likely has two other advantages: 1) it allows non-super-users to rename directories 2) it works over NFS to servers that don't allow you to create multiple links to files and it is also allegedly atomic, or at least mostly atomic. To quote from the comment that appears (perhaps with minor typographical changes) in various flavors of UNIX: * ...The essential operation is: * unlink(target); * link(source, target); * unlink(source); * but "atomically". Can't do full commit without saving state in the inode * on disk, which isn't feasible at this time. Best we can do is always * guarantee that the TARGET exists. >... but I couldn't find any man pages for PWB entry points... I >suppose I shouldn't be surprised; PWB was an internal Bell Labs thing, >according to Lapin. Sort of internal. PWB/UNIX 1.0 actually was released; it was based on V6 UNIX, mostly (although with later versions of kernel, C compiler, some library routines, etc. and standard I/O, most of which came out of Research in various forms as well). I think there may even have been a document for the routines in the "-lPW" library; said documentation had disappeared by the time S3 came out, though. >So if you can possibly switch to the kernel version in libc, do it for >greater portability. Definitely. Not all flavors of UNIX have "-lPW", and it may even disappear from AT&T's releases someday.... (And yes, "rename" will be in S5R4; it's already in the POSIX spec.)