问题 Motivated by Smart-write to arbitrary file descriptor from C/C++, I mean to associate a file descriptor with a file pointer and use that for writing. I put together program io.cc below: int main() { int nbytes; const int fd = 3; FILE * fp = fdopen(fd, "a"); fprintf(fp, "Writing to file descriptor %d\n", fd); cout << "Testing alternate writing to stdout and to another fd" << endl; fprintf(fp, "Writing again to file descriptor %d\n", fd); fclose(fp); return 0; } Should I perform some kind of