small versions of c std library functions