PageRenderTime 31ms CodeModel.GetById 24ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/filesystems/grabfs/GetPID.h

http://macfuse.googlecode.com/
C++ Header | 36 lines | 25 code | 8 blank | 3 comment | 0 complexity | a55788f0574c15a59da307e5e4d190d8 MD5 | raw file
 1/*
 2 * From Apple DTS Sample Code.
 3 */
 4
 5#if !defined(__DTSSampleCode_GetPID__)
 6#define __DTSSampleCode_GetPID__ 1
 7
 8#include <stdlib.h>
 9#include <stdio.h>
10
11#if defined(__cplusplus)
12extern "C" {
13#endif
14    
15enum {
16    kSuccess                          =  0,
17    kCouldNotFindRequestedProcess     = -1, 
18    kInvalidArgumentsError            = -2,
19    kErrorGettingSizeOfBufferRequired = -3,
20    kUnableToAllocateMemoryForBuffer  = -4,
21    kPIDBufferOverrunError            = -5
22};
23
24int GetAllPIDsForProcessName(const char*        ProcessName,
25                             pid_t              ArrayOfReturnedPIDs[],
26                             const unsigned int NumberOfPossiblePIDsInArray,
27                             unsigned int*      NumberOfMatchesFound,
28                             int*               SysctlError);
29
30int GetPIDForProcessName(const char* ProcessName);
31
32#if defined(__cplusplus)
33}
34#endif
35
36#endif