From owner-freebsd-hackers Thu Oct 26 10:12:48 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from luke.immure.com (luke.immure.com [207.8.42.74]) by hub.freebsd.org (Postfix) with ESMTP id C4BC637B479 for ; Thu, 26 Oct 2000 10:12:44 -0700 (PDT) Received: (from bob@localhost) by luke.immure.com (8.11.1/8.11.1) id e9QHChP39131 for freebsd-hackers@FreeBSD.ORG; Thu, 26 Oct 2000 12:12:43 -0500 (CDT) (envelope-from bob) Date: Thu, 26 Oct 2000 12:12:43 -0500 From: Bob Willcox To: hackers list Subject: Re: STAILQ_LAST -- what should it return? Message-ID: <20001026121243.A38987@luke.immure.com> Reply-To: Bob Willcox References: <20001025163203.A22361@luke.immure.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001025163203.A22361@luke.immure.com>; from bob@immure.com on Wed, Oct 25, 2000 at 04:32:03PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG To follow-up my own question, it appears that the STAILQ_LAST macro has been changed (fixed) in -current to return the address of the last entry (or NULL if the list is empty). Bob On Wed, Oct 25, 2000 at 04:32:03PM -0500, Bob Willcox wrote: > I am using a SINGLY-LINKED TAIL QUEUE in a device driver I'm developing > and have encountered what looks like a problem with the STAILQ_LAST > macro (this is FreeBSD 4.1.1-stable). This macro as defined: > > #define STAILQ_LAST(head) (*(head)->stqh_last) > > in /usr/src/sys/sys/queue.h appears to be returning the value of > the first word of the last entry, which in my case (since the link > pointer is the first word in each of my chained structures) is _always_ > zero! What am I missing here? Is this possibly a bug or have I > missinterpreted what this macro is supposed to do? > > Thanks, > Bob > > -- > Bob Willcox hatred, n: > bob@VIEO.com A sentiment appropriate to the occasion of > Austin, TX another's superiority. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Bob Willcox hatred, n: bob@VIEO.com A sentiment appropriate to the occasion of Austin, TX another's superiority. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message