aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/win32
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-05-24 13:15:03 +0000
committerErlang/OTP <[email protected]>2010-05-24 13:15:03 +0000
commitbe2ebfd0f2b8e15363288d1dab4c177c237e234a (patch)
treeb0f8e2844240211f02f89c6fc09a1945af337d1b /erts/emulator/drivers/win32
parent458dcb10f98bffd241a837cbac7c108eb485f706 (diff)
parent329aff8ed81e94033c836e58bd294a68a8f7be8c (diff)
downloadotp-be2ebfd0f2b8e15363288d1dab4c177c237e234a.tar.gz
otp-be2ebfd0f2b8e15363288d1dab4c177c237e234a.tar.bz2
otp-be2ebfd0f2b8e15363288d1dab4c177c237e234a.zip
Merge branch 'fm/file-operations' into dev
* fm/file-operations: Update preloaded modules Add file:advise/4 - a wrapper to the POSIX syscall posix_fadvise Add file:datasync/1 for syncing file contents only sys.h: Correct the get_int64() macro OTP-8637 fm/file-operations The functions file:advise/4 and file:datasync/1 have been added. (Thanks to Filipe David Manana.)
Diffstat (limited to 'erts/emulator/drivers/win32')
-rw-r--r--erts/emulator/drivers/win32/win_efile.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c
index 89aaad31da..d5f2b79706 100644
--- a/erts/emulator/drivers/win32/win_efile.c
+++ b/erts/emulator/drivers/win32/win_efile.c
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 1997-2010. All Rights Reserved.
+ *
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
/*
@@ -764,6 +764,15 @@ int fd; /* File descriptor for file to close. */
}
int
+efile_fdatasync(errInfo, fd)
+Efile_error* errInfo; /* Where to return error codes. */
+int fd; /* File descriptor for file to sync. */
+{
+ /* Not available in Windows, just call regular fsync */
+ return efile_fsync(errInfo, fd);
+}
+
+int
efile_fsync(errInfo, fd)
Efile_error* errInfo; /* Where to return error codes. */
int fd; /* File descriptor for file to sync. */
@@ -1424,3 +1433,12 @@ efile_symlink(Efile_error* errInfo, char* old, char* new)
errno = ENOTSUP;
return check_error(-1, errInfo);
}
+
+int
+efile_fadvise(Efile_error* errInfo, int fd, Sint64 offset,
+ Sint64 length, int advise)
+{
+ /* posix_fadvise is not available on Windows, do nothing */
+ errno = ERROR_SUCCESS;
+ return check_error(0, errInfo);
+}