| 749 | } |
| 750 | |
| 751 | bool TruncateFile(FILE* file, unsigned int length) { |
| 752 | #if defined(WIN32) |
| 753 | return _chsize(_fileno(file), length) == 0; |
| 754 | #else |
| 755 | return ftruncate(fileno(file), length) == 0; |
| 756 | #endif |
| 757 | } |
| 758 | |
| 759 | // this function tries to raise the file descriptor limit to the requested number. |
| 760 | // It returns the actual file descriptor limit (which may be more or less than nMinFD) |