Add BufFileRead variants with short read and EOF detection - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Add BufFileRead variants with short read and EOF detection
Date
Msg-id f3501945-c591-8cc3-5ef0-b72a2e0eaa9c@enterprisedb.com
Whole thread Raw
Responses Re: Add BufFileRead variants with short read and EOF detection  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Add BufFileRead variants with short read and EOF detection  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
Most callers of BufFileRead() want to check whether they read the full 
specified length.  Checking this at every call site is very tedious. 
This patch provides additional variants BufFileReadExact() and 
BufFileReadMaybeEOF() that include the length checks.

I considered changing BufFileRead() itself, but this function is also 
used in extensions, and so changing the behavior like this would create 
a lot of problems there.  The new names are analogous to the existing 
LogicalTapeReadExact().
Attachment

pgsql-hackers by date:

Previous
From: Maxim Orlov
Date:
Subject: Re: Add 64-bit XIDs into PostgreSQL 15
Next
From: Maxim Orlov
Date:
Subject: Re: Add SHELL_EXIT_CODE to psql