Problem
Code compiled on SCO OpenServer 5.0 Development System will not run on SCO XENIX.
Cause
The XENIX kernel does not recognize the system call that the OSES binary is attempting to execute and sends signal SIGSYS (bad argument to system call) to the process. The system call number is not understood by the XENIX kernel.
SCO OpenServer 5.0 COFF binaries will mostly work unchanged on
a 3.2V4.2 kernel. The library code actually adjusts to the kernel
it happens to be running on (either a 3.2V4.2 or SCO OpenServer 5.0
kernel) and simply "works", albeit in a slower and less efficient
manner. This scheme won't work on SCO XENIX since the underlying
kernel doesn't support any of the choices that the library code
is trying to make.Here is a partial list of function calls that will not work when run on XENIX:
chsize(S) fchdir(S) fchmod(S) fchown(S) fpathconf(S) fstatvfs(S) getgroups(S) getitimer(S) getpmsg(S) getrlimit(S) lchown(S) lstat(S) mmap(S) mprotect(S) munmap(S) paccess(S) pathconf(S) putpmsg(S) readlink(S) readv(S) rename(S) scoinfo(S) setcontext(S) setegid(S) seteuid(S) setgroups(S) setitimer(S) setrlimit(S) sigaltstack(S) sigsendset(S) sigsuspend(S) statvfs(S) symlink(S) sysconf(S) truncate(S) vfork(S) waitid(S) writev(S)
This list is not comprehensive, but it includes the majority of functions.
Solution
To resolve this problem, follow these steps:
Compile the binary on XENIX with the XENIX Development System.
*or*Cross compile to XENIX (cc -xenix or cc -x2.3). The SCO 3.2V4.2
Development System cc command supports this option. For SCO
OpenServer 5.0 you must purchase the XENIX/DOS Cross Development
System Extended Feature Supplement product.*or*If the XENIX/DOS Cross Development System product is not available,
compiling with the "-b ibcs2" flag _may_ work. This causes the
libraries to choose older (and potentially less safe or capable)
code paths. Specifically, OpenServer Release 5.0 is significantly
better at running APIs like sleep, popen, signal, and so on, than
Open Server 3.0 was, and avoids the sysconf() calls of Open Server
3.0 in most of these alternate code paths.NOTE: SCO OpenServer Release 5.0 is not 100% iBCS2 compliant, and XENIX
is not 100% compatible with the SCO OpenServer Release Development
System if the iBCS2 mode is selected over the default.