Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!utah-cs!donn
From: donn@utah-cs.UUCP (Donn Seeley)
Newsgroups: net.bugs.4bsd
Subject: Bug in ffs() library function?
Message-ID: <3035@utah-cs.UUCP>
Date: Mon, 17-Sep-84 21:25:25 EDT
Article-I.D.: utah-cs.3035
Posted: Mon Sep 17 21:25:25 1984
Date-Received: Tue, 25-Sep-84 05:18:52 EDT
Organization: University of Utah CS Dept
Lines: 16

Actually the bug is undoubtedly in the documentation...  Under the
manual section 'bstring' we read:

	A return value of -1 indicates that the value passed is zero.

But a look at the source (and the kernel asm.sed) shows that 0 is
returned for zero.  I assume that the code is right and the manual page
is wrong.  Although my knowledge of Sun assembler is close to zip, it
would appear that the same inconsistency exists in the Sun 1.1
distribution.

Unless ffs() returns 0 for zero, you lose the only good reason to
number the bits from 1 instead of from 0...  (Growl.)

Donn Seeley    University of Utah CS Dept    donn@utah-cs.arpa
40 46' 6"N 111 50' 34"W    (801) 581-5668    decvax!utah-cs!donn