spawnlp, spawnvp
Executes a new NLM
#include <nwthread.h>
int spawnlp (
int mode,
const char *path,
char *arg0,
...);
int spawnvp (
int mode,
const char *path,
char **argv);
The following table lists return values and descriptions.
|
Value |
Hex |
Name |
Description |
|---|---|---|---|
|
0 |
(0x00) |
ESUCCESS |
Program was successfully loaded. |
|
–1 |
(0xFF) |
EFAILURE |
The function failed. |
On error, errno is set to one of the following values:
Through a Novell internal conversion process, NwErrno may also be set to one of the following values:
NOTE:The errno code EINVAL indicates only that code was set to other than P_NOWAIT or P_WAIT.
IMPORTANT:P_WAIT is operative only in NLMs made with CLIB. Other NLMs indicate load completion only.
The value of mode determines how the program is loaded and how the invoking program behaves after the it is initiated:
IMPORTANT:P_WAIT functionality is available only on NetWare 5.x, 6.x, and NetWare 4 systems updated to use CLib v. 4.11 libraries, the official update for NetWare v. 4.10 systems.
Arguments are passed to the child process by supplying one or more pointers to character strings as arguments in the spawn call. These character strings are concatenated with spaces inserted to separate the arguments to form one argument string for the child process. The length of this concatenated string must not exceed 128 bytes.
The arguments can be passed as a list of arguments ( spawnlp) or as a vector of pointers ( spawnvp). At least one argument, arg0 or argv [0], must be passed to the child process. By convention, this first argument is the name of the program.
If the arguments are passed as a list, there must be a NULL pointer to mark the end of the argument list.
#include <nwthread.h> int completionCode: completionCode = spawnlp (P_NOWAIT, "helper.NLM", NULL);
#include <nwthread.h> int completionCode; char *argv[5]; completionCode = spawnvp (P_NOWAIT, "helper.nlm", argv);