#include "libComAPI.h"
Go to the source code of this file.
Enumerator |
---|
osiGetUserNameFail |
|
osiGetUserNameSuccess |
|
Definition at line 25 of file osiProcess.h.
Enumerator |
---|
osiSpawnDetachedProcessFail |
|
osiSpawnDetachedProcessSuccess |
|
osiSpawnDetachedProcessNoSupport |
|
Definition at line 35 of file osiProcess.h.
osiSpawnDetachedProcessReturn
Definition at line 33 of file osdProcess.c.
37 p = getpwuid ( getuid () );
38 if ( p && p->pw_name ) {
39 size_t len = strlen ( p->pw_name );
42 if ( len > UINT_MAX || len <= 0 ) {
45 uiLength = (unsigned) len;
47 if ( uiLength + 1 >= bufSizeIn ) {
51 strncpy ( pBuf, p->pw_name, (
size_t) bufSizeIn );
Definition at line 61 of file osdProcess.c.
87 int fd, maxfd = sysconf ( _SC_OPEN_MAX );
88 for ( fd = 0; fd <= maxfd; fd++ ) {
89 if (fd==STDIN_FILENO)
continue;
90 if (fd==STDOUT_FILENO)
continue;
91 if (fd==STDERR_FILENO)
continue;
96 #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0 101 struct sched_param p;
103 p.sched_priority = 0;
104 status = sched_setscheduler(0, SCHED_OTHER, &p);
111 status = execlp (pBaseExecutableName, pBaseExecutableName, (
char *)
NULL);
113 fprintf (
stderr,
"**** The executable \"%s\" couldn't be located\n", pBaseExecutableName );
114 fprintf (
stderr,
"**** because of errno = \"%s\".\n", strerror (errno) );
115 fprintf (
stderr,
"**** You may need to modify your PATH environment variable.\n" );
116 fprintf (
stderr,
"**** Unable to start \"%s\" process.\n", pProcessName);