From owner-freebsd-questions Tue Jul 30 08:10:59 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA28770 for questions-outgoing; Tue, 30 Jul 1996 08:10:59 -0700 (PDT) Received: from Campino.Informatik.RWTH-Aachen.DE (campino.Informatik.RWTH-Aachen.DE [137.226.225.2]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA28753 for ; Tue, 30 Jul 1996 08:10:51 -0700 (PDT) Received: from gilberto.physik.rwth-aachen.de (gilberto.physik.rwth-aachen.de [137.226.31.2]) by Campino.Informatik.RWTH-Aachen.DE (RBI-Z-5/8.6.12) with ESMTP id RAA15111; Tue, 30 Jul 1996 17:04:15 +0200 Received: (from kuku@localhost) by gilberto.physik.rwth-aachen.de (8.6.11/8.6.9) id RAA00612; Tue, 30 Jul 1996 17:17:40 +0200 From: "Christoph P. Kukulies" Message-Id: <199607301517.RAA00612@gilberto.physik.rwth-aachen.de> Subject: Re: your mail To: s_koyin@eduserv.its.unimelb.EDU.AU (HMG coA reductase) Date: Tue, 30 Jul 1996 17:17:38 +0200 (MET DST) Cc: questions@freebsd.org In-Reply-To: from HMG coA reductase at "Jul 30, 96 11:14:08 pm" Reply-To: Christoph Kukulies X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > hi again, > > this code: > > #include > > char fs[8196]; ^ Just guessing: You are trying to read a non-multiple of 512 :-) > open ("/dev/rwd0s2e", O_RDONLY, 0); > lseek (f, SBOFF, SEEK_SET); > read (f, fs, sizeof(fs)); > > read gives an error "Invalid argument" which man read(2) says is due to a > negative file descriptor. i know f is not negative. > > but this code works fine: > > char fs[SBSIZE]; > open ("/dev/rwd0s2e", O_RDONLY, 0); > lseek (f, SBOFF, SEEK_SET); > read (f, fs, sizeof(fs)); > > any ideas? > > thanks. > ivan > --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de