Pack a pid and two file descriptors into a 64-bit word, using 16, 24, and 24 bits for each respectively.
| 2183 | // Pack a pid and two file descriptors into a 64-bit word, |
| 2184 | // using 16, 24, and 24 bits for each respectively. |
| 2185 | static uint64_t Pack(uint64_t pid, uint64_t read_fd, uint64_t write_fd) { |
| 2186 | ABSL_RAW_CHECK((read_fd >> 24) == 0 && (write_fd >> 24) == 0, "fd out of range"); |
| 2187 | return (pid << 48) | ((read_fd & 0xffffff) << 24) | (write_fd & 0xffffff); |
| 2188 | } |
| 2189 | |
| 2190 | // Unpack x into a pid and two file descriptors, where x was created with |
| 2191 | // Pack(). |