MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / posix_directory_sync

Function posix_directory_sync

src/daemon/ipc.c:1953–1978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1951}
1952
1953static 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
1980static bool posix_socket_record_temp_name(const char *record_name, char temp_name[NAME_MAX + 1]) {
1981 if (!record_name || !temp_name) {

Calls

no outgoing calls

Tested by

no test coverage detected