delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/05/20:30:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <20040106013026.21604.qmail@linuxmail.org>
MIME-Version: 1.0
From: "peter garrone" <pgarrone AT linuxmail DOT org>
To: cygwin AT cygwin DOT com
Date: Tue, 06 Jan 2004 09:30:26 +0800
Subject: lstat symbolic link size
X-Originating-Ip: 192.10.200.223
X-Originating-Server: ws5-7.us4.outblaze.com

lstat returns an incorrect symbolic link size, with size 11 bytes too large.
This causes mkcramfs to fail.
CYGWIN variable is set to nowinsymlinks. Set to winsymlinks, the size is about 80 bytes too large.
This is for a cygwin snapshot from September.
This program generates the error for me. Create a symbolic link, e.g.
ln -s -f x x
compile program. e.g. gcc chklnk.c -o chklnk
test. e.g. ./chklnk x
Source for chklnk.c
---------------------------------------------------
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char ** argv)
{
	int r;
	struct stat st;
	if(argc != 2)exit(-1);
	r = lstat(argv[1],&st);
	if(r != 0){ printf("lstat fails\n");exit(-1);}
	if(!S_ISLNK(st.st_mode)){printf("Not a symbolic link\n");exit(0);}
	printf("Size %d\n",(int)(st.st_size));
	return 0;
}

-- 
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze

--
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