Thanks teawater!>- write(1, buf, len);>+ if (write(1, buf, len) != len)>+ printf("Output buf \"%s\" fail\n", buf);Changed it to fprintf(stderr, "WARNING: statistics output may be incomplete.\n");Thanks,Fengguang