$ gcc -Wall -o getchar getchar.c $ gcc -Wall -o read read.c $ dd ibs=1 count=10 < /dev/zero | od -tx1 10+0 records in 0+1 records out 10 bytes (10 B) copied, 5.0791e-05 s, 197 kB/s 0000000 00 00 00 00 00 00 00 00 00 00 0000012 $ dd ibs=1 count=10 < /dev/urandom | od -tx1 10+0 records in 0+1 records out 10 bytes (10 B) copied, 6.4408e-05 s, 155 kB/s 0000000 d6 5a c6 d6 90 55 81 e4 46 8d 0000012 $ dd ibs=1 count=10 < /dev/urandom | od -tx1 10+0 records in 0+1 records out 10 bytes (10 B) copied, 5.6232e-05 s, 178 kB/s 0000000 21 24 7f 56 93 34 09 74 7d b0 0000012 $ time dd ibs=1M count=10 < /dev/zero | ./getchar > /dev/null 10+0 records in 20480+0 records out 10485760 bytes (10 MB) copied, 0.157512 s, 66.6 MB/s real 0m0.160s user 0m0.145s sys 0m0.015s $ time dd ibs=1M count=10 < /dev/zero | ./read > /dev/null 10+0 records in 20480+0 records out 10485760 bytes (10 MB) copied, 12.5578 s, 835 kB/s real 0m12.635s user 0m5.094s sys 0m7.525s $