forked from hashicorp/raft-wal
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from polarsignals/alfonso-wasm
*: allow building wal with GOARCH=wasm GOOS=wasip1
- Loading branch information
Showing
9 changed files
with
240 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:build !wasm | ||
|
||
package fs | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/coreos/etcd/pkg/fileutil" | ||
) | ||
|
||
func syncDir(dir string) error { | ||
f, err := os.Open(dir) | ||
if err != nil { | ||
return err | ||
} | ||
err = f.Sync() | ||
closeErr := f.Close() | ||
if err != nil { | ||
return err | ||
} | ||
return closeErr | ||
} | ||
|
||
func prealloc(f *os.File, sizeInBytes int64, extendFile bool) error { | ||
return fileutil.Preallocate(f, sizeInBytes, extendFile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//go:build wasm | ||
|
||
package fs | ||
|
||
import "os" | ||
|
||
func syncDir(dir string) error { | ||
// TODO(asubiotto): Issue syncing dirs on wasm. | ||
return nil | ||
} | ||
|
||
func prealloc(_ *os.File, _ int64, _ bool) error { | ||
// fileutil.Prealloc relies on unix-only functionality which is unavailable | ||
// on wasm. | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.