Can PGCC support pread/pwrite

I am porting a C++ program previously compiled by G++.

I am not sure that pgCC support pread/pwrite.

Any help will be appreciated.

Hi W.Xue,

pgCC supports all standard Linux system calls, including pread/pwrite. However, since we can’t have PGI specific header files for everything, you sometimes need to add a bit of extra code in order to get the correct prototypes.

For example with pwrite/pread, I extracted the prototype definitions from “unistd.h” and placed them in an extern “C” block so C++ name mangling would not be applied.

#include <unistd.h>

extern "C" {

extern ssize_t pread(int __fd, void *__buf, size_t __nbytes,
                      __off_t __offset);

extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
                       __off_t __offset);


Hope this helps,