Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postgres/src/port/     Datei vom 11.4.2026 mit Größe 937 B image not shown  

Quelle  win32pwrite.c   Sprache: C

 

/*-------------------------------------------------------------------------
 *
 * win32pwrite.c
 *   Implementation of pwrite(2) for Windows.
 *
 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
 *   src/port/win32pwrite.c
 *
 *-------------------------------------------------------------------------
 */



#include "c.h"

#include <windows.h>

ssize_t
pg_pwrite(int fd, const void *buf, size_t size, off_t offset)
{
 OVERLAPPED overlapped = {0};
 HANDLE  handle;
 DWORD  result;

 handle = (HANDLE) _get_osfhandle(fd);
 if (handle == INVALID_HANDLE_VALUE)
 {
  errno = EBADF;
  return -1;
 }

 /* Avoid overflowing DWORD. */
 size = Min(size, 1024 * 1024 * 1024);

 /* Note that this changes the file position, despite not using it. */
 overlapped.Offset = offset;
 if (!WriteFile(handle, buf, size, &result, &overlapped))
 {
  _dosmaperr(GetLastError());
  return -1;
 }

 return result;
}

Messung
CHZG
1009710098

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland