File descriptors are small non-negative integers. Returns void so the implementation can use ASSERT_EQ.
| 76 | // |
| 77 | // Returns void so the implementation can use ASSERT_EQ. |
| 78 | void GetMaxFileDescriptor(int* result_fd) { |
| 79 | // Get the maximum file descriptor number. |
| 80 | ::rlimit fd_rlimit; |
| 81 | ASSERT_EQ(0, ::getrlimit(RLIMIT_NOFILE, &fd_rlimit)); |
| 82 | *result_fd = fd_rlimit.rlim_cur; |
| 83 | } |
| 84 | |
| 85 | // Iterates through all possible FDs and returns the currently open ones. |
| 86 | // |
no outgoing calls
no test coverage detected