We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0506d5b commit b61a614Copy full SHA for b61a614
lib/posix/posix.nim
@@ -215,6 +215,11 @@ when defined(osx): # 2001 POSIX evidently does not concern Apple
215
# present size & has no good reason to call this unless it is growing.
216
if fcntl(a1, F_PREALLOCATE, fst.addr) != cint(-1): ftruncate(a1, a2 + a3)
217
else: cint(-1)
218
+elif defined(openbsd):
219
+ proc posix_fallocate*(a1: cint, a2, a3: Off): cint =
220
+ # above assumption: "has no good reason to call this unless it is growing."
221
+ # man ftruncate "it will be extended as if by writing bytes with the value zero."
222
+ return ftruncate(a1, a2 + a3)
223
else:
224
proc posix_fallocate*(a1: cint, a2, a3: Off): cint {.
225
importc, header: "<fcntl.h>".}
0 commit comments