delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/03/04:48:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 3 Aug 2004 10:48:42 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: link() bug
Message-ID: <20040803084842.GL31522@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <80vfg0ubqq DOT fsf AT sdf DOT lonestar DOT org>
Mime-Version: 1.0
In-Reply-To: <80vfg0ubqq.fsf@sdf.lonestar.org>
User-Agent: Mutt/1.4.2i

On Aug  2 23:44, Jim Pritts wrote:
> I created a program that demonstrates a bug with link() in Cygwin.
> The program first creates a file named "dummy" and then creates 1050
> hard links to file "dummy" by calling link().  link() reports no error
> for all 1050 calls.  However when an "ls -la dummy" is performed, only
> 1024 hard links to dummy are reported.  In addition, if an ls -la is
> performed on any hard link greater than 1023, then the report is that
> there is only one hard link to the underlying inode.  If link() cannot
> perform the hard link properly, then it should report an error which
> it does not. Source and makefile are included to demonstrate the bug.
> 
> source:
> 
> #include <unistd.h>
> #include <stdio.h>
> #include <errno.h>
> #include <string.h>
> 
> extern int errno;
> 
> int main() 
> {
>   FILE* f = fopen("dummy", "w");
>   fclose(f);
>   char buff[1000];
>   for (int i=0; i < 1050; ++i) {
>     sprintf(buff, "%d", i);
>     int err = link("dummy", buff);
>     switch(err) {
>     case 0:
>       printf("no error: %d\n", i);
>       break;
>     case -1:
>       printf("error: %s\n", strerror(errno));
>       break;
>     }
>   }
> }

WFM. 

You missed to tell us about your system.  http://cygwin.com/problems.html

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019