Minix 2 is the most modern UNIX for 286 systems and works quite well. However, I was surprised how smooth Xenix 286 worked on it, so Coherent may be interesting to try. (Although I've lost my appetite for the pre-ANSI C world by now.)Minix 2.0 will run on a 286 and has tcp/ip support, so it’s probably a better bet than Coherent (on 286 it has the same Small model memory restriction), but I can’t say I’ve actually done anything with Minix beyond booting it a few times.
Minix is also limited to tiny (64K) and small ("split I&D", 64K + 64K) memory models. Some variants of Xenix supported medium (multiple code segments) as well, but I'm not aware of any 16-bit UNIX system with support for multiple data segments.
On a 386+, both the tiny and small models allow using all memory, so I would be surprised to find 64K restrictions (when using a 32-bit kernel, compiler and runtime).
Injecting code into your process is not supported by standard C. If you want to write system-specific code, you might as well use a few lines of assembly to get the type of pointer you want. But you'll be on your own no matter what.It matters if you're trying to inject executable code into your process.