/* $Id: getppid.c,v 1.4 2002/10/29 04:45:48 rex Exp $ */ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS POSIX+ Subsystem * FILE: subsys/psx/lib/psxdll/unistd/getppid.c * PURPOSE: Get the parent process ID * PROGRAMMER: KJK::Hyperion * UPDATE HISTORY: * 15/02/2002: Created */ #include #include #include #include pid_t getppid(void) { PROCESS_BASIC_INFORMATION pbiInfo; NTSTATUS nErrCode; nErrCode = NtQueryInformationProcess ( NtCurrentProcess(), ProcessBasicInformation, &pbiInfo, sizeof(pbiInfo), NULL ); if(!NT_SUCCESS(nErrCode)) { errno = __status_to_errno(nErrCode); return (0); } return (pbiInfo.InheritedFromUniqueProcessId); } /* EOF */