Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114398725
getpid.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 25, 15:13
Size
591 B
Mime Type
text/x-c
Expires
Tue, May 27, 15:13 (2 d)
Engine
blob
Format
Raw Data
Handle
26385631
Attached To
R6832 iCAPs public
getpid.c
View Options
#include <sys/types.h>
/*
* This mex file fails to compile using the LCC compiler that is included
* in 32-bit version of MATLAB. With MSVC 2008 it does compile.
*
* See also http://bugzilla.fcdonders.nl/show_bug.cgi?id=1384
*/
#if defined(_WIN32) || defined(_WIN64)
#include <process.h>
#else
#include <unistd.h>
#endif
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
unsigned int *pr;
plhs[0] = mxCreateNumericMatrix(1, 1, mxUINT32_CLASS, mxREAL);
pr = mxGetData(plhs[0]);
*pr = (unsigned int)getpid();
}
Event Timeline
Log In to Comment