FFS(3) BSD Library Functions Manual FFS(3)NAME
ffs -- find first bit set in a bit string
Standard C Library (libc, -lc)
The ffs() function finds the first bit set in value and returns the index of that bit. Bits are numbered starting from 1, starting at the
right-most bit. A return value of 0 means that the argument was zero.
SEE ALSO bitstring(3), ffs32(3), popcount(3)STANDARDS
The ffs() function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
The ffs() function appeared in 4.3BSD. The prototype for it existed previously in the <string.h> header before it was moved to <strings.h>
for POSIX compliance.
BSD April 28, 2010 BSD
Check Out this Related Man Page
FFS(3P) POSIX Programmer's Manual FFS(3P)PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
ffs - find first set bit
int ffs(int i);
The ffs() function shall find the first bit set (beginning with the least significant bit) in i, and return the index of that bit. Bits are
numbered starting at one (the least significant bit).
The ffs() function shall return the index of the first bit set. If i is 0, then ffs() shall return 0.
No errors are defined.
The following sections are informative.
The Base Definitions volume of IEEE Std 1003.1-2001, <strings.h>
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE
and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained
online at http://www.opengroup.org/unix/online.html .
IEEE /The Open Group 2003 FFS(3P)
The awk command is one of the most powerfull commands in UNIX. Can someone please explain to me how this command works and give me an example please. I do not understand this command and also the all the -Ffs and -v and -f variables that are used in this command. I never used the awk... (5 Replies)
I have a simple question... In C do we have a standard library function which will return the pointer to a substring at certain offset and having certain length...
Ofcourse we should take care not to access beyond allocated length in the parent string and don't overwrite beyond allocated... (2 Replies)
I need to extract only XML details from large log file which may contain other unwanted junk details.
For example, our xml will be start as <OUTBOUND_MESSAGE .....> and ends with </OUTBOUND_MESSAGE>. I want to extract only lines between these start and end tag (Including these tags)... (5 Replies)
I am currently bringing up an offsite location, right now I am in the process of copying some data offsite (about 400GB).
The problem I see is that running a single rsync for everything is not using the available bandwidth and testing shows that I double in speed for each instance of Rsync I am... (3 Replies)
I have a lot of very large hex files that I need to change one value at the same offset and save to another file. I have a script that finds each file and just need to put an operator for each file.
I think sed might be able to do this but I have not used it before and would like some help. If... (8 Replies)
I am new to Unix and need help with the following (to you all I'm sure) simple task. I am trying to output the differences between previous snaphots of various filesystem sizes to the present sizes.
I have three files (e.g.) :
file 1 file 2 file 3
10 100 /var... (4 Replies)
I'm looking for a program or some way to backup my server to another location onto another server. Does anyone have any ideas? What utility, server O/S(I would like to use Linux RH or CentOS)?
Whats the best way to do this?
I am fairly new with Unix.
Thanks in advance (6 Replies)
I have a .gz file whose contents look like below.
Is it possible to find out the byte offset of each record from the .gz file.
Like in an uncompressed file.
grep -nb "Filename" give the byte offset of the record in this case.
... (4 Replies)
Ive been trying to slide the second column one line down while keeping the first one in place. For a start, I tried to see if I can go through every line and print the element located on the line below with the following command, but it didnt work.
Maybe awk is not the right way to do it. Matlab... (6 Replies)
I am trying to get the position of a repeated string in a line using
grep -b -o "pattern"
In my server I am using GNU grep version 2.14 and the code is working fine. However when I am deploying the same code in a different server which is using GNU grep version 2.5.1 the code is not... (3 Replies)
I want to offset the file numbers. can you please make some awk code or linux code for the same.
input file names
offset --> 30
ANI_WFMASS_PIST00032.gif... (14 Replies)
I've created a pretty straightforward shell script to do backups via rsync. Every night it rsyncs a copy of a website (approx 60GB) to the local machine. Once a week, after the rsync step, it zips the local copy of the whole site into 2GB chunks and places them in another folder.
When running... (3 Replies)
I have an csv file which contends value GPS time for each record and x, y coordinates.. The purpose is to identify which vps does not match with the law parameters in the relation time and offset.
In the graphic attached you can see example of 3 vps which are showed in red color and... (12 Replies)
We had a hardware problem with an IBM System p5 server, with AIX 5.2
We restore from a tape the last backup we had, but the server does not boot up as expected.
The server try to mount some directories from a storage, but could not comunicate with them, we check the FC and everything is... (12 Replies)