add Windows version of getpid

pull/587/head
JacobBarthelmeh 2023-09-20 11:16:35 -06:00
parent 74ca7161a5
commit 12b7c3af93
1 changed files with 4 additions and 0 deletions

View File

@ -1451,7 +1451,11 @@ void wolfSSHD_ConfigSavePID(const WOLFSSHD_CONFIG* conf)
WMEMSET(buf, 0, sizeof(buf));
if (WFOPEN(NULL, &f, conf->pidFile, "wb") == 0) {
#ifndef WIN32
WSNPRINTF(buf, sizeof(buf), "%d", getpid());
#else
WSNPRINTF(buf, sizeof(buf), "%d", _getpid());
#endif
WFWRITE(NULL, buf, 1, WSTRLEN(buf), f);
WFCLOSE(NULL, f);
}