| 1951 | } |
| 1952 | |
| 1953 | static bool posix_directory_sync(int dir_fd) { |
| 1954 | if (dir_fd < 0) { |
| 1955 | return false; |
| 1956 | } |
| 1957 | int result; |
| 1958 | do { |
| 1959 | result = fsync(dir_fd); |
| 1960 | } while (result != 0 && errno == EINTR); |
| 1961 | if (result == 0) { |
| 1962 | return true; |
| 1963 | } |
| 1964 | |
| 1965 | int sync_error = errno; |
| 1966 | bool unsupported = sync_error == EINVAL; |
| 1967 | #ifdef ENOTSUP |
| 1968 | unsupported = unsupported || sync_error == ENOTSUP; |
| 1969 | #endif |
| 1970 | #ifdef EOPNOTSUPP |
| 1971 | unsupported = unsupported || sync_error == EOPNOTSUPP; |
| 1972 | #endif |
| 1973 | /* Some POSIX filesystems, including Darwin filesystems, do not expose a |
| 1974 | * directory-sync operation. Record contents are still fsynced before |
| 1975 | * publication, and the recovery state machine accepts either atomic |
| 1976 | * namespace outcome after a crash. */ |
| 1977 | return unsupported; |
| 1978 | } |
| 1979 | |
| 1980 | static bool posix_socket_record_temp_name(const char *record_name, char temp_name[NAME_MAX + 1]) { |
| 1981 | if (!record_name || !temp_name) { |
no outgoing calls
no test coverage detected