Skip to content

Commit 5dd8e3e

Browse files
committed
chore(embedded/appendable): fsync freebsd
Signed-off-by: Jeronimo Irazabal <[email protected]>
1 parent 8891b1c commit 5dd8e3e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//go:build freebsd
2+
// +build freebsd
3+
4+
/*
5+
Copyright 2023 Codenotary Inc. All rights reserved.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
*/
20+
21+
package fileutils
22+
23+
import "os"
24+
25+
func syncDir(path string) error {
26+
f, err := os.Open(path)
27+
if err != nil {
28+
return err
29+
}
30+
31+
defer f.Close()
32+
33+
return f.Sync()
34+
}
35+
36+
func fdatasync(f *os.File) error {
37+
return f.Sync()
38+
}

0 commit comments

Comments
 (0)