From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,b69d377feb5a8a2 X-Google-Attributes: gid10952f,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public From: felix@mamba.pond.sub.org (Felix Schroeter) Subject: Re: Different UNIX pro's and con's. Date: 1998/09/21 Message-ID: <6u6h6h$hhb$1@mamba.pond.sub.org>#1/1 X-Deja-AN: 393730110 References: <35F71814.1E0B911C@iakom.com> <3602E82F.C8638268@llnl.gov> <6tur3l$m3b$1@sapa.inka.de> Organization: Chaos Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix Hello! In article <6tur3l$m3b$1@sapa.inka.de>, wrote: >[...] >You can eighter use private TMP directories for important applications >(setting TMPDIR to ~/.tmp/) or you can hack a funlink() into the kernel. funlink() is not really possible. The file descriptor refers to an inode (or generically a vnode) at last. The vnode has no linkage to the directory entries referring to the file, so funlink() would have to guess which link you want to remove. A better thing would be this: int safe_unlink(const char *fname, struct stat *sb) like unlink, but only removes the file, if the name still refers to the same file the stat buffer stems from (i.e. st_dev and st_ino still match). Or this: int safe_unlink(const char *fname, int fd) unlink fname, but only if fname refers to the same file as fd. A similar thing could be interesting for directories: int safe_rmdir(const char *dname, int fd) (or the same thing with struct stat * like above) Regards, Felix.