Date: Mon, 23 Jul 2001 02:42:20 +0200 From: Christoph Hellwig <hch@caldera.de> To: Bakul Shah <bakul@bitblocks.com> Cc: tlambert2@mindspring.com, Joshua Goodall <joshua@roughtrade.net>, Bruce Evans <bde@zeta.org.au>, freebsd-fs@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: flags on symlinks Message-ID: <20010723024220.A19865@caldera.de> In-Reply-To: <200107230016.UAA17001@renown.cnchost.com>; from bakul@bitblocks.com on Sun, Jul 22, 2001 at 05:16:11PM -0700 References: <3B5B4F7E.8C48801E@mindspring.com> <200107230016.UAA17001@renown.cnchost.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 22, 2001 at 05:16:11PM -0700, Bakul Shah wrote: > Well, I won't mind if {,l}ch{mod,own,flags} etc become library > routines. Something like: > > int > chown(const char* path, uid_t owner, gid_t group) { > int fd, err; > > fd = open(path, O_EXCL); > if (!fd) > return errno; > err = fchown(fd, owner, group); > close(fd); > return err; > } The problem is that it uses a file-descriptor, which means it will fail if the maximum number of fds (process-wide or globally) is execeeded. Another problem is that open on devices may give all kinds of side-effects (e.g. enabling interrups, awaking from suspend state, not to mention clone devices) that it is generally considered a bad idea to open for a metadata change. And I think this was discusses as zillion times before :P Christoph -- Whip me. Beat me. Make me maintain AIX. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010723024220.A19865>