From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 1 19:04:27 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AC0316A41F for ; Mon, 1 Aug 2005 19:04:27 +0000 (GMT) (envelope-from victor.cruceru@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id A162443D45 for ; Mon, 1 Aug 2005 19:04:26 +0000 (GMT) (envelope-from victor.cruceru@gmail.com) Received: by wproxy.gmail.com with SMTP id i4so1066388wra for ; Mon, 01 Aug 2005 12:04:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=VWzgJI//oyM6VrOS42nYhJJTm03wOM5L+o8Viz3S5WKIF/7Rf+t5860tyyGGPTZqziSjpzppY/t5jsdv/9La5+Ep/7AAxWwPK/OaaCsYP8MRsvNWz0mhsCAsiiDsQ5AyjJnFPTVC2FJe7Fbz7mmDBl7HQ3InYLIlCJg1iWBv5+U= Received: by 10.54.57.62 with SMTP id f62mr3141710wra; Mon, 01 Aug 2005 12:04:25 -0700 (PDT) Received: by 10.54.91.20 with HTTP; Mon, 1 Aug 2005 12:04:25 -0700 (PDT) Message-ID: <494025505080112043f8a0554@mail.gmail.com> Date: Mon, 1 Aug 2005 22:04:25 +0300 From: victor cruceru To: ticso@cicely.de In-Reply-To: <20050801184731.GD26656@cicely12.cicely.de> Mime-Version: 1.0 References: <494025505080104427c3f91f6@mail.gmail.com> <20050801130502.GA39470@stack.nl> <494025505080106336a329bb@mail.gmail.com> <20050801173047.GC26656@cicely12.cicely.de> <4940255050801114161c1cea3@mail.gmail.com> <20050801184731.GD26656@cicely12.cicely.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Marc Olzheim , freebsd-hackers@freebsd.org Subject: Re: O_NONBLOCK for devices with removable media X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: soc-victor@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2005 19:04:27 -0000 In conclusion:=20 any difference between open with O_NONBLOCK and open without it for this=20 kind of devices? Because man 2 open says: ---------------------------------------------------------------------------= ------------------------- If the O_NONBLOCK flag is specified and the open() system call would result= =20 in the process being blocked for some reason (e.g., waiting for carrier on a dialup line), open() returns immediately. The descriptor remains in non- blocking mode for subsequent operations. ---------------------------------------------------------------------------= ------------------------- Thanks victor cruceru On 8/1/05, Bernd Walter wrote: >=20 > On Mon, Aug 01, 2005 at 09:41:30PM +0300, victor cruceru wrote: > > Well, if you are doing this from a daemon (multiplexing a lot of events= ) > > which is blocked in this open syscall, even 1 second is not reasonable.= =20 > In > > my case it is something more than 30 of seconds (again, on a 5.4 box).= =20 > I'll > > give it a try on FreeBSD 6. I'm currently investigating if there is > > something like TEST_UNIT_READY (for both ATAPI and SCSI) which can be= =20 > issued > > on a control device (i.e. /dev/ata) >=20 > What do you expect it to do? > Ask the device about the state or always fail, because it is not > allowed to ask the device? > In your case you have a broken device, this isn't much of an argument. > A resonable reply time for a USB device would be less then 10ms. >=20 > -- > B.Walter BWCT http://www.bwct.de > bernd@bwct.de info@bwct.de >=20 >