Added readblock and writeblock functions.
add more glue for newlib