From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21351 invoked by alias); 20 May 2009 13:45:25 -0000 Received: (qmail 21336 invoked by uid 22791); 20 May 2009 13:45:24 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 May 2009 13:45:19 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 445EC3B4004A for ; Wed, 20 May 2009 14:45:17 +0100 (BST) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v15+y8gO4Q7p; Wed, 20 May 2009 14:45:14 +0100 (BST) Date: Wed, 20 May 2009 13:45:00 -0000 Message-Id: From: Bart Veer To: Ross Younger CC: ecos-devel@ecos.sourceware.org In-reply-to: <4A13F762.4050006@ecoscentric.com> (message from Ross Younger on Wed, 20 May 2009 13:28:18 +0100) Subject: Re: Should hard links to directories work? References: <4A13F762.4050006@ecoscentric.com> Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-05/txt/msg00046.txt.bz2 >>>>> "Ross" == Ross Younger writes: Ross> The Unix world traditionally shuns such things as an Ross> abomination. The eCos docs are quiet on the subject, as is Ross> the code in ramfs and jffs2. Should they work? Does anybody Ross> use them? Ross> (By the way: I started this discussion with a bugzilla Ross> ticket, which as Andrew points out is probably the wrong Ross> place. Ross> http://bugzilla.ecoscentric.com/show_bug.cgi?id=1000775 ) >From http://www.opengroup.org/onlinepubs/7990989775/xsh/link.html: "The link() function creates a new link (directory entry) for the existing file, path1. The path1 argument points to a pathname naming an existing file. The path2 argument points to a pathname naming the new directory entry to be created. The link() function will atomically create a new link for the existing file and the link count of the file is incremented by one. If path1 names a directory, link() will fail unless the process has appropriate privileges and the implementation supports using link() on directories." So creating links to directories is not completely disallowed, but from my reading it is certainly discouraged. I would be happy with changes to ramfs and jffs2 to prevent new links to directories. jffs2 should probably continue to support such links in an existing filesystem, in case they are created in another OS. Bart -- Bart Veer eCos Configuration Architect eCosCentric Limited The eCos experts http://www.ecoscentric.com/ Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071.