From owner-freebsd-questions@FreeBSD.ORG Sun Jun 6 13:56:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A64116A4CE for ; Sun, 6 Jun 2004 13:56:18 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0527943D58 for ; Sun, 6 Jun 2004 13:56:18 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i56Ku77n066637; Sun, 6 Jun 2004 15:56:07 -0500 (CDT) (envelope-from dan) Date: Sun, 6 Jun 2004 15:56:07 -0500 From: Dan Nelson To: Tim Pushor Message-ID: <20040606205607.GF42830@dan.emsphone.com> References: <40C2B409.6070705@crossthread.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40C2B409.6070705@crossthread.com> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: questions@freebsd.org Subject: Re: lseek problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2004 20:56:18 -0000 In the last episode (Jun 06), Tim Pushor said: > I am working on porting an old system over to FreeBSD, and am having > a weird (to me) problem. This system uses various data file types, > and unfortunately it uses the group_id execution bit (but no execute) > on a data file to signify a sequential type file (mode 2440). I have > stepped through the code, and it is failing on an lseek > (fd,0,SEEK_SET) where fd is the properly opened file descriptor for > one of these files. This file is readable by the user and is about 2K > in size. this lseek should work shoudn't it? Its returning -1 and > sets errno to 22 (EINVAL). Could this be because of the weird mode? > man chmod doesn't say anything about what the set-group-id bit does > to non-executable files. Could this be the problem? The only obvious cause of EINVAL from lseek would be an invalid third argument. The program doesn't try and define SEEK_SET itself, does it? -- Dan Nelson dnelson@allantgroup.com