#include <boost/interprocess/errors.hpp>
#include <boost/interprocess/permissions.hpp>
-#include <string>
-#include <limits>
#include <climits>
+#include <limits>
+#include <string>
#include <boost/move/detail/type_traits.hpp> //make_unsigned
#if defined (BOOST_INTERPROCESS_WINDOWS)
# include <unistd.h>
# include <sys/types.h>
# include <sys/stat.h>
-# include <errno.h>
-# include <cstdio>
# include <dirent.h>
+# include <cerrno>
+# include <cstdio>
# if 0
# include <sys/file.h>
# endif
}
if(offset_t(size) > filesize){
- if(!winapi::set_file_pointer_ex(hnd, filesize, 0, winapi::file_begin)){
+ if(!winapi::set_file_pointer(hnd, filesize, 0, winapi::file_begin)){
return false;
}
//We will write zeros in the end of the file
}
}
else{
- if(!winapi::set_file_pointer_ex(hnd, size, 0, winapi::file_begin)){
+ if(!winapi::set_file_pointer(hnd, size, 0, winapi::file_begin)){
return false;
}
if(!winapi::set_end_of_file(hnd)){
{ return winapi::get_file_size(hnd, size); }
inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
-{ return winapi::set_file_pointer_ex(hnd, off, 0, (unsigned long) pos); }
+{ return winapi::set_file_pointer(hnd, off, 0, (unsigned long) pos); }
inline bool get_file_pointer(file_handle_t hnd, offset_t &off)
-{ return winapi::set_file_pointer_ex(hnd, 0, &off, winapi::file_current); }
+{ return winapi::set_file_pointer(hnd, 0, &off, winapi::file_current); }
inline bool write_file(file_handle_t hnd, const void *data, std::size_t numdata)
{
int ret = -1;
//We need a loop to change permissions correctly using fchmod, since
//with "O_CREAT only" ::open we don't know if we've created or opened the file.
- while(1){
+ while(true){
ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
if(ret >= 0){
::fchmod(ret, perm.get_permissions());