In the UNIX system environment, the function libraries associated with Advanced Server API functions are dynamic-link libraries (liblmx.so and librpcapi.so).
The API functions that are common to both LAN Manager and Advanced Server are contained in the liblmx.so library. The 32-bit, RPC-based API functions that were added specifically for Advanced Server are contained in the librpcapi.so library. These libraries provide information that allows the UNIX operating system to dynamically link the appropriate library to an application program at run-time. These libraries are located in the /usr/lib directory on the server.
To compile and link a program using Advanced Server API functions on the UNIX operating system, use the following command:
cc program.c -o program
-I/usr/include/lmx -llmx -lnsl -ldl -lc -lasulang -lasusec -lsam -lthread -lcrypt -lmsrpc -ltask -lrpcapi
All of the API functions available in the UNIX system environment are implemented in two UNIX system dynamic-link libraries. These libraries (liblmx.so and librpcapi.so) are installed by Advanced Server system in the /usr/lib directory on the server. These libraries cannot be moved because the names (/usr/lib/liblmx.so and /usr/lib/librpcapi.so) are used to locate the libraries at run time. (If moved, they will not be found and any application that needs these libraries will not execute.) Use of dynamic-link libraries means that the API code is not bound into the application program until the program is run on the target UNIX system.
Most of the Advanced Server API functions available under the UNIX system environment can be executed on a remote server. API functions that can be executed remotely must include a remote server name parameter to identify where the function is to be executed.
Those functions that can be executed on a local computer must be called with a NULL server name parameter (defaults to local computer name) or the name assigned the local computer in the format \ \computername. Attempting to execute a local-only function on a remote server returns ERROR_NOT_SUPPORTED.
Advanced Server provides a simple mechanism for invoking services on servers running the UNIX system. This feature enables you to configure services (programs that you write) to be run automatically whenever Advanced Server is started.
To install a service to be invoked automatically, copy the program file to the /var/opt/lanman/service directory on the server. Each service must call the NetServiceStatus function. Every executable in this directory is automatically invoked when the server process is started. An Advanced Server process uses the fork( ) system call to invoke each service. The child process becomes the service, and the parent process exits.
Advanced Server sends a signal to each of these services when the server program is stopped.
Programs that create mailslots and/or named pipes require root privilege on a UNIX System-based Advanced Server.
To obtain root privilege for programs that run on a UNIX System-based Advanced Server, use one of the following methods:
Invoke the program manually while logged in as root.
Change the ownership of the file to root. Then, set the setuid bit for the program via the chmod(1) command.
Move the program to the /var/opt/lanman/service directory, so that Advanced Server will start the program whenever the server is started.
For more information, consult your UNIX system documentation.