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

Function posix_directory_sync

src/daemon/ipc.c:1905–1930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1903}
1904
1905static bool posix_directory_sync(int dir_fd) {
1906 if (dir_fd < 0) {
1907 return false;
1908 }
1909 int result;
1910 do {
1911 result = fsync(dir_fd);
1912 } while (result != 0 && errno == EINTR);
1913 if (result == 0) {
1914 return true;
1915 }
1916
1917 int sync_error = errno;
1918 bool unsupported = sync_error == EINVAL;
1919#ifdef ENOTSUP
1920 unsupported = unsupported || sync_error == ENOTSUP;
1921#endif
1922#ifdef EOPNOTSUPP
1923 unsupported = unsupported || sync_error == EOPNOTSUPP;
1924#endif
1925 /* Some POSIX filesystems, including Darwin filesystems, do not expose a
1926 * directory-sync operation. Record contents are still fsynced before
1927 * publication, and the recovery state machine accepts either atomic
1928 * namespace outcome after a crash. */
1929 return unsupported;
1930}
1931
1932static bool posix_socket_record_temp_name(const char *record_name, char temp_name[NAME_MAX + 1]) {
1933 if (!record_name || !temp_name) {

Calls

no outgoing calls

Tested by

no test coverage detected