PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Can PGCC support pread/pwrite

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
xuewei



Joined: 05 Sep 2005
Posts: 1

PostPosted: Tue Jul 04, 2006 2:23 am    Post subject: Can PGCC support pread/pwrite Reply with quote

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

I am not sure that pgCC support pread/pwrite.

Any help will be appreciated.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Wed Jul 05, 2006 11:40 am    Post subject: Reply with quote

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.
Code:
#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,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group