Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  win32common.c

  Sprache: C
 

/*-------------------------------------------------------------------------
 *
 * win32common.c
 *   Common routines shared among the win32*.c ports.
 *
 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 *
 * IDENTIFICATION
 *   src/port/win32common.c
 *
 *-------------------------------------------------------------------------
 */


#ifdef FRONTEND
#include "postgres_fe.h"
#else
#include "postgres.h"
#endif

/*
 * pgwin32_get_file_type
 *
 * Convenience wrapper for GetFileType() with specific error handling for all the
 * port implementations.  Returns the file type associated with a HANDLE.
 *
 * On error, sets errno with FILE_TYPE_UNKNOWN as file type.
 */

DWORD
pgwin32_get_file_type(HANDLE hFile)
{
 DWORD  fileType = FILE_TYPE_UNKNOWN;
 DWORD  lastError;

 errno = 0;

 /*
  * When stdin, stdout, and stderr aren't associated with a stream the
  * special value -2 is returned:
  * https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle
 */

 if (hFile == INVALID_HANDLE_VALUE || hFile == (HANDLE) -2)
 {
  errno = EINVAL;
  return FILE_TYPE_UNKNOWN;
 }

 fileType = GetFileType(hFile);
 lastError = GetLastError();

 /*
  * Invoke GetLastError in order to distinguish between a "valid" return of
  * FILE_TYPE_UNKNOWN and its return due to a calling error.  In case of
  * success, GetLastError() returns NO_ERROR.
 */

 if (fileType == FILE_TYPE_UNKNOWN && lastError != NO_ERROR)
 {
  _dosmaperr(lastError);
  return FILE_TYPE_UNKNOWN;
 }

 return fileType;
}

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=738142