Could you document atleast the return values of these functions?
Its inconsistently SUCCESS/FAILURE vs 0/1 so this looked like a bug when skimming this patch