summaryrefslogtreecommitdiff
path: root/src/include/access
diff options
context:
space:
mode:
authorThomas Munro2022-09-29 00:12:11 +0000
committerThomas Munro2022-09-29 00:12:11 +0000
commitb6d8a60aba322678585ebe11dab072a37ac32905 (patch)
tree8caea653f8704c8b3866feca1a795add503f5593 /src/include/access
parent3a5817695a8360011864c1834f8a90ffdfc7f840 (diff)
Restore pg_pread and friends.
Commits cf112c12 and a0dc8271 were a little too hasty in getting rid of the pg_ prefixes where we use pread(), pwrite() and vectored variants. We dropped support for ancient Unixes where we needed to use lseek() to implement replacements for those, but it turns out that Windows also changes the current position even when you pass in an offset to ReadFile() and WriteFile() if the file handle is synchronous, despite its documentation saying otherwise. Switching to asynchronous file handles would fix that, but have other complications. For now let's just put back the pg_ prefix and add some comments to highlight the non-standard side-effect, which we can now describe as Windows-only. Reported-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/20220923202439.GA1156054%40nathanxps13
Diffstat (limited to 'src/include/access')
-rw-r--r--src/include/access/xlogreader.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 6dcde2523a7..e87f91316ae 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -378,11 +378,11 @@ extern void XLogReaderResetError(XLogReaderState *state);
/*
* Error information from WALRead that both backend and frontend caller can
- * process. Currently only errors from pread can be reported.
+ * process. Currently only errors from pg_pread can be reported.
*/
typedef struct WALReadError
{
- int wre_errno; /* errno set by the last pread() */
+ int wre_errno; /* errno set by the last pg_pread() */
int wre_off; /* Offset we tried to read from. */
int wre_req; /* Bytes requested to be read. */
int wre_read; /* Bytes read by the last read(). */