diff options
| author | Peter Eisentraut | 2022-12-08 07:51:38 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2022-12-08 07:58:15 +0000 |
| commit | 2d4f1ba6cfc2f0a977f1c30bda9848041343e248 (patch) | |
| tree | 8fdfef3464578531b8f83b4921fa3b3d5f6dd5dd /src/backend | |
| parent | 4b3e37993254ed098219e62ceffb1b32fac388cb (diff) | |
Update types in File API
Make the argument types of the File API match stdio better:
- Change the data buffer to void *, from char *.
- Change FileWrite() data buffer to const on top of that.
- Change amounts to size_t, from int.
In passing, change the FilePrefetch() amount argument from int to
off_t, to match the underlying posix_fadvise().
Discussion: https://www.postgresql.org/message-id/flat/11dda853-bb5b-59ba-a746-e168b1ce4bdb%40enterprisedb.com
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/storage/file/fd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 4151cafec5..f6c9382023 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -1980,7 +1980,7 @@ FileClose(File file) * to read into. */ int -FilePrefetch(File file, off_t offset, int amount, uint32 wait_event_info) +FilePrefetch(File file, off_t offset, off_t amount, uint32 wait_event_info) { #if defined(USE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) int returnCode; @@ -2031,7 +2031,7 @@ FileWriteback(File file, off_t offset, off_t nbytes, uint32 wait_event_info) } int -FileRead(File file, char *buffer, int amount, off_t offset, +FileRead(File file, void *buffer, size_t amount, off_t offset, uint32 wait_event_info) { int returnCode; @@ -2039,7 +2039,7 @@ FileRead(File file, char *buffer, int amount, off_t offset, Assert(FileIsValid(file)); - DO_DB(elog(LOG, "FileRead: %d (%s) " INT64_FORMAT " %d %p", + DO_DB(elog(LOG, "FileRead: %d (%s) " INT64_FORMAT " %zu %p", file, VfdCache[file].fileName, (int64) offset, amount, buffer)); @@ -2087,7 +2087,7 @@ retry: } int -FileWrite(File file, char *buffer, int amount, off_t offset, +FileWrite(File file, const void *buffer, size_t amount, off_t offset, uint32 wait_event_info) { int returnCode; |
