In itself, this is quite reasonable. You should realise however that all of these are done on a textual level. Strong systems dependency C was developed for use as a systems programming language.
Some system calls and library functions are defined in different header files on different systems.
There may be differing semantics for particular routines. For example, on Sys V-like systems, a signal handler reinstalled. On BSD-like systems, a signal handler stays in place until explicitly removed. There are standard ways to overcome some of these problems, like using sizeof instead of the concrete size of the variable on the current system. You can do all kinds of conversions, many of which can be system dependent or meaningless.