The function returns one of the following values:-1 if buf1 and buf2 contain different characters in the first len positions, and the first such character is smaller in buf1 than the character at the same position in buf2. 0 if the first len characters in buf1 and buf2 are equal. 1 if buf1 and buf2 contain different characters in the first len positions, and the first such character is larger in buf1 than the character at the same position in buf2.
Note that the distance is very valuable. In many cases you need that distance, not just -1,0,1.