[kernel] Create UNIX named socket as regular file for FAT compatibility w/Nano-X #2218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows Nano-X to function on FAT filesystems, requested in discussion #1810 (reply in thread).
Nano-X now creates and attaches its UNIX socket to a regular file (/tmp/nxsock in this case) rather than requiring a Named Socket file type, as is standard in Linux/UNIX. This exception is being made for ELKS so that Nano-X can run client/server on FAT filesystems.
The
bind
andconnect
operations in the UNIX socket driver are now configured in net/unix/af_unix.c using "#define USE_IFREG 1" to turn on using a regular file instead of a named socket/pipe for the client/server connection. For strict UNIX comptability, the define can be set to 0 and a named socket/pipe will be used.@tyama501, I have tested this on QEMU, this should now allow you to run Nano-X client/server on PC-98. Be aware that the special ifdef CONFIG_ARCH_PC98 in nanox/srvmain.c may have to be removed in the !NONETWORK (i.e. client/server) case in order to work on PC-98. I didn't test with those in, as I'm testing on IBM PC. It is possible those defines must remain in the NONETWORK case. If so, please submit a PR after you have everything working. I have tested with two nxclocks running, as well a single nxclock and nxtetris, using the shell script previously described for starting them.