add h$rand ccall implementation