vl_getpid.c
Go to the documentation of this file.
00001 
00007 /*
00008 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
00009 All rights reserved.
00010 
00011 This file is part of the VLFeat library and is made available under
00012 the terms of the BSD license (see the COPYING file).
00013 */
00014 
00015 #include <vl/generic.h>
00016 
00017 #ifdef VL_OS_WIN
00018 #include <Windows.h>
00019 #else
00020 #include <unistd.h>
00021 #endif
00022 
00023 #include <mexutils.h>
00024 
00025 void
00026 mexFunction(int nout, mxArray *out[],
00027             int nin, const mxArray *in[] VL_UNUSED)
00028 {
00029   double pid ;
00030 
00031   if (nin > 0) {
00032     vlmxError(vlmxErrTooManyInputArguments, NULL) ;
00033   }
00034   if (nout > 1) {
00035     vlmxError(vlmxErrTooManyOutputArguments, NULL) ;
00036   }
00037 
00038 #ifdef VL_OS_WIN
00039   pid = (double) GetCurrentProcessId() ;
00040 #else
00041   pid = (double) getpid() ;
00042 #endif
00043   out[0] = vlmxCreatePlainScalar (pid) ;
00044 }


libvlfeat
Author(s): Andrea Vedaldi
autogenerated on Thu Jun 6 2019 20:25:51