Comments (3)
Sorry for the noise. I think I was on a bad commit.
from wasmer.
I've reverted back to a good commit and this problem remains. I'll investigate and confirm with a wasi-fyi
test case.
from wasmer.
Here's a wasi-fyi test that confirms the problem.
use std::ffi::CString;
use std::fs;
#[link(wasm_import_module = "wasi_snapshot_preview1")]
extern "C" {
pub fn path_open(
fd: i32,
dirflags: i32,
path: i32,
path_len: i32,
oflags: i32,
fs_rights_base: i64,
fs_rights_inheriting: i64,
fdflags: i32,
result_fd: i32,
) -> i32;
}
const ERRNO_SUCCESS: i32 = 0;
const ERRNO_EXIST: i32 = 20;
const OFLAGS_CREAT: i32 = 1;
const OFLAGS_EXCL: i32 = 4;
const RIGHTS_FD_READ: i64 = 2;
const RIGHTS_FD_WRITE: i64 = 64;
fn main() {
unsafe {
let fd = 5;
let path0 = CString::new("fyi/fs_open_dir_excl.dir").unwrap();
let path1 = CString::new("fyi/fs_open_dir_excl.dir/file").unwrap();
let errno = path_open(
fd,
0,
path0.as_ptr() as i32,
path0.as_bytes().len() as i32,
OFLAGS_CREAT | OFLAGS_EXCL,
RIGHTS_FD_READ | RIGHTS_FD_WRITE,
0,
0,
1024,
);
assert_eq!(
errno, ERRNO_EXIST,
"opening an existing directory with excl should fail"
);
let _ = fs::remove_file("/fyi/fs_open_dir_excl.dir/file");
let errno = path_open(
fd,
0,
path1.as_ptr() as i32,
path1.as_bytes().len() as i32,
OFLAGS_CREAT | OFLAGS_EXCL,
RIGHTS_FD_READ | RIGHTS_FD_WRITE,
0,
0,
1024,
);
assert_eq!(
errno, ERRNO_SUCCESS,
"opening a non-existing path with excl should succeed"
);
}
}
from wasmer.
Related Issues (20)
- Read bytes bug ?
- Read bytes do not equal to file size.
- CLI: Newly intalled signal handler impedes normal termination of the program
- fd_renumber bug?
- Secrets: Implement a `secrets` subcommand in the `app` command
- CLI DX Proposal: replace dialoguer for templates
- fd_seek bug.
- fd_write bug.
- path_filestat_get failure.
- Fail to create link file.
- memory profile HOT 1
- Open file error message bug.
- Fail to read link.
- Fail to rename a file.
- Migrate to new macOS CI environments on Github
- Print successfully create link, however, the link file do not exist.
- Fail to delete the file.
- configs: Add HTTPS redirection schema for apps
- Upgrade all hyper / http usage to 1.0
- CLI: Filter app logs by request ID
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmer.