Should use ssize_t for ret and return type.