sync with libextra