date and time created 90/05/15 14:01:13 by bostic
[unix-history] / usr / src / lib / libc / string / ffs.c
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)ffs.c 5.3 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
/*
* ffs -- vax ffs instruction
*/
ffs(mask)
register int mask;
{
register int bit;
if (mask == 0)
return(0);
for (bit = 1; !(mask & 1); bit++)
mask >>= 1;
return(bit);
}