PostgreSQL Source Code git master
Loading...
Searching...
No Matches
win32common.c File Reference
#include "postgres.h"
Include dependency graph for win32common.c:

Go to the source code of this file.

Functions

DWORD pgwin32_get_file_type (HANDLE hFile)
 

Function Documentation

◆ pgwin32_get_file_type()

DWORD pgwin32_get_file_type ( HANDLE  hFile)

Definition at line 31 of file win32common.c.

32{
35
36 errno = 0;
37
38 /*
39 * When stdin, stdout, and stderr aren't associated with a stream the
40 * special value -2 is returned:
41 * https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle
42 */
43 if (hFile == INVALID_HANDLE_VALUE || hFile == (HANDLE) -2)
44 {
45 errno = EINVAL;
46 return FILE_TYPE_UNKNOWN;
47 }
48
51
52 /*
53 * Invoke GetLastError in order to distinguish between a "valid" return of
54 * FILE_TYPE_UNKNOWN and its return due to a calling error. In case of
55 * success, GetLastError() returns NO_ERROR.
56 */
58 {
60 return FILE_TYPE_UNKNOWN;
61 }
62
63 return fileType;
64}
static int fb(int x)
void _dosmaperr(unsigned long)
Definition win32error.c:177

References _dosmaperr(), and fb().

Referenced by _pgfstat64().