putchar & getchar functionaliy using read and write calls