Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: Wed, 7 Sep 2005 20:18:36 +0200 From: Corinna Vinschen To: "[ML] CygWin " Subject: Re: happily messing up with raw devices (aka: lseek problems) Message-ID: <20050907181836.GT5555@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: "[ML] CygWin " References: <431F266D DOT 3050604 AT lapo DOT it> <20050907174848 DOT GR5555 AT calimero DOT vinschen DOT de> <431F2D6D DOT 8000200 AT lapo DOT it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <431F2D6D.8000200@lapo.it> User-Agent: Mutt/1.4.2i Try this: On Sep 7 20:11, Lapo Luchini wrote: > At the bare minumum it all boils down to: > > % cat short.c > #include > #include > #include > #include #include > #define GAG_OFFSET 0x59BD > main() { > char sect[512]; > int dev, i; > dev = open("/dev/sdb", O_RDONLY | O_BINARY, 0); > if (dev < 0) perror("open"); > i = lseek(dev, GAG_OFFSET & (~0x1FF), SEEK_SET); > if (i < 0) perror("seek"); > } > % gcc -O -ggdb -o short short.c > % ./short > seek: Invalid argument -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-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/