Unsafe operating-system calls

An unsafe system call is one that blocks, causing the virtual processor to stall the CPU until the call returns, or one that allocates resources local to the virtual processor instead of in shared memory. A system call within a transaction is not terminated by a rollback, so a suspended transaction can wait indefinitely for the call to return.

For instructions on recovery from a deadlock during a long transaction rollback, see the Informix® Administrator's Guide.

A well-behaved C UDR must not include any of the categories of system calls in the following table. The system calls listed in the Sample Operating-System Calls column are listed only as possible examples. The operating-system calls that are unsafe in your C UDR can depend on your operating system. Consult your operating-system documentation for information about system calls that perform the categories of tasks in the following table.
Table 1. Unsafe operating-system calls
Type of operating-system call Sample operating-system calls
Calls that manipulate signals to processes signal(), alarm(), sleep()
Calls that modify the system security setuid(), seteuid(), setruid(), setgid(), setegid(), setrgid()
Calls that initiate or halt system processes fork(), exec(), exit(), system(), popen()
Calls that modify the shared-memory segments shmat()
Calls that modify the runtime environment of the dynamic linker dlopen(), dlsym(), dlerror(), dlclose()Windows™: LoadLibrary()
Restriction: The database server reserves all operating-system signals for its own use. The virtual processors use signals to communicate with one another. If a UDR were to use signals, these signals would conflict with those that the virtual processors use. Therefore, do not raise, handle, or mask signals within a C UDR.
You can use system utilities to check if undesired system calls were included in your shared-object file:
  • On UNIX™ or Linux™, you can use the nm and ldd commands to obtain this information. The ldd command lists the dynamic dependencies from a shared object.
  • On Windows, you can use the DUMPBIN command with its /IMPORTS option to obtain this information.
Tip: Given a DataBlade® build (.bld) file, check for unresolved references in the file and all its dependencies. You can compare this list for system calls that violate the rules of the VP you have chosen to execute your C UDR.

For a list of operating-system calls that are generally safe in a C UDR, see Safe operating-system calls.