Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/mono/mono/utils/mono-filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ mono_file_map_open (const char* name)
int fd = open (name, O_RDONLY);
if (fd < 0)
return NULL;
#ifdef HOST_NUTTX
/* Track fd→path mapping for SDRAM cache in mmap stub */
extern void sdram_cache_track_fd(int fd, const char *path);
sdram_cache_track_fd (fd, name);
#endif
return (MonoFileMap *)(size_t)fd;
#endif
}
Expand Down
5 changes: 5 additions & 0 deletions src/native/libs/System.Native/pal_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <errno.h>
#ifdef __NuttX__
#include "pal_io_nuttx.h"
#include "pal_networking.h" // nxsock_close_notify
#else
#include <fnmatch.h>
#endif
Expand Down Expand Up @@ -394,6 +395,10 @@ int32_t SystemNative_Close(intptr_t fd)
// do it here. Harmless for non-socket fds (ENOTSOCK) and already-shutdown
// sockets (ENOTCONN).
shutdown(rawFd, SHUT_RDWR);

// Remove the fd from the SocketAsyncEngine poll() emulation before it is
// closed (see nxsock_close_notify in pal_networking.c). Safe for any fd.
nxsock_close_notify(rawFd);
#endif

int result = close(rawFd);
Expand Down
5 changes: 5 additions & 0 deletions src/native/minipal/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ static inline size_t minipal_get_current_thread_id(void)
#if defined(__wasm) && !defined(_REENTRANT)
return minipal_get_current_thread_id_no_cache();

#elif defined(__NuttX__)
// NuttX user space has no thread-local storage support (__aeabi_read_tp is
// only provided in the kernel), so do not cache the ID.
return minipal_get_current_thread_id_no_cache();

#else // !__wasm || _REENTRANT
#if defined(__GNUC__) && !defined(__clang__) && defined(__cplusplus)
// gcc doesn't like _Thread_local when __cplusplus is defined.
Expand Down