This is Unofficial EPICS BASE Doxygen Site
osdProcess.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /*
11  * Operating System Dependent Implementation of osiProcess.h
12  *
13  * Author: Jeff Hill
14  *
15  */
16 
17 /* This is needed for vxWorks 6.8 to prevent an obnoxious compiler warning */
18 #define _VSB_CONFIG_FILE <../lib/h/config/vsbConfig.h>
19 
20 #include <limits.h>
21 #include <string.h>
22 
23 #include <remLib.h>
24 
25 #include "osiProcess.h"
26 #include "errlog.h"
27 
28 LIBCOM_API osiGetUserNameReturn epicsStdCall osiGetUserName (char *pBuf, unsigned bufSizeIn)
29 {
30  char pName[MAX_IDENTITY_LEN];
31  unsigned uiLength;
32  size_t len;
33 
34  remCurIdGet ( pName, NULL );
35  len = strlen ( pName );
36 
37  if (len>UINT_MAX || len<=0) {
38  return osiGetUserNameFail;
39  }
40  uiLength = (unsigned) len;
41 
42  if ( uiLength + 1 >= bufSizeIn ) {
43  return osiGetUserNameFail;
44  }
45 
46  strncpy ( pBuf, pName, (size_t) bufSizeIn );
47 
48  return osiGetUserNameSuccess;
49 }
50 
52  (const char *pProcessName, const char *pBaseExecutableName)
53 {
55 }
#define NULL
Definition: catime.c:38
osiSpawnDetachedProcessReturn
Definition: osiProcess.h:35
LIBCOM_API osiGetUserNameReturn epicsStdCall osiGetUserName(char *pBuf, unsigned bufSizeIn)
Definition: osdProcess.c:33
LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess(const char *pProcessName, const char *pBaseExecutableName)
Definition: osdProcess.c:61
osiGetUserNameReturn
Definition: osiProcess.h:25