Functions returning "unit" correspond to C fns which use -1 for failure