On 6/21/2024 9:14 AM, Xiang Xiao wrote:
but, different devices expose to the different subsets of API. e.g. some
devices mayn't enable the net subsystem at all, any application which
calls socket api will fail to load.

Right, that is a consequence of size reduction using a minimal, incomplete configuration for resource-limited embedded systems. POSIX actually specifies which APIs must be present, be we ignore this requirement for a smaller footprint.

You would probably have to adopt a standard, minimal configuration across products OR perhaps some stubs that return only ENOSYS for nonexistent APIs.  You might even want a common version if you want completely consistent, bug-for-bug behavior. Such stubs really should be generated automatically is a system call is configured out.  Returning ENOSYS if the API is not present is required by most POSIX APIs.

But this all should be doable in principle. After all, the P in POSIX stands for portable.

Reply via email to