write.c (212B)
1 #include <unistd.h> 2 #include "rep.h" 3 4 char buf[65536]; 5 6 int main() 7 { 8 int fd = open("/dev/null", 1); 9 if (fd < 0) 10 return -1; 11 for (int i = 0; i < 1000000; i++) { 12 write(fd, buf, sizeof(buf)); 13 } 14 return 0; 15 } 16