1 /* 2 Copyright (C) 2015-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: dk4getpid.ctr 12 */ 13 14 /** @file dk4getpid.c The dk4getpid module. 15 */ 16 17 18 #include "dk4conf.h" 19 #include <libdk4c/dk4getpid.h> 20 21 #if DK4_ON_WINDOWS 22 #ifndef WINDOWS_H_INCLUDED 23 #include <windows.h> 24 #define WINDOWS_H_INCLUDED 1 25 #endif 26 #endif 27 28 #if DK4_HAVE_UNISTD_H 29 #ifndef UNISTD_H_INCLUDED 30 #include <unistd.h> 31 #define UNISTD_H_INCLUDED 1 32 #endif 33 #endif 34 35 36 37 dk4_pid_t dk4getpid(void)38dk4getpid(void) 39 { 40 #if DK4_ON_WINDOWS 41 return ((dk4_pid_t)GetCurrentProcessId()); 42 #else 43 return (getpid()); 44 #endif 45 } 46 47