8000 minix/lib/other/ffs.c at R3.1.4 · fyy3/minix · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
executable file
·
17 lines (14 loc) · 243 Bytes

ffs.c

File metadata and controls

executable file
·
17 lines (14 loc) · 243 Bytes
#include <lib.h>
/* ffs(3)
*
* Author: Terrence W. Holm Sep. 1988
*/
_PROTOTYPE( int ffs, (int word));
int ffs(word)
int word;
{
int i;
if (word == 0) return(0);
for (i = 1;; ++i, word >>= 1)
if (word & 1) return(i);
}
0