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

Function posix_directory_sync

src/daemon/ipc.c:1941–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1939}
1940
1941static bool posix_directory_sync(int dir_fd) {
1942 if (dir_fd < 0) {
1943 return false;
1944 }
1945 int result;
1946 do {
1947 result = fsync(dir_fd);
1948 } while (result != 0 && errno == EINTR);
1949 if (result == 0) {
1950 return true;
1951 }
1952
1953 int sync_error = errno;
1954 bool unsupported = sync_error == EINVAL;
1955#ifdef ENOTSUP
1956 unsupported = unsupported || sync_error == ENOTSUP;
1957#endif
1958#ifdef EOPNOTSUPP
1959 unsupported = unsupported || sync_error == EOPNOTSUPP;
1960#endif
1961 /* Some POSIX filesystems, including Darwin filesystems, do not expose a
1962 * directory-sync operation. Record contents are still fsynced before
1963 * publication, and the recovery state machine accepts either atomic
1964 * namespace outcome after a crash. */
1965 return unsupported;
1966}
1967
1968static bool posix_socket_record_temp_name(const char *record_name, char temp_name[NAME_MAX + 1]) {
1969 if (!record_name || !temp_name) {

Calls

no outgoing calls

Tested by

no test coverage detected