/* * shim/fcntl.h — the record-locking constants WASI hides. * * anthy's src-worddic/priv_dic.c takes a write lock on the private dictionary with * struct flock + fcntl(fd, F_SETLKW, &lck). WASI has neither record locks nor the * constants: the wasi-sdk sysroot's fcntl.h keeps struct flock (line 28) but hides * F_RDLCK/F_WRLCK/F_UNLCK/F_SETLK/F_SETLKW behind * `#ifdef __wasilibc_unmodified_upstream`. * * So this header pulls in the real one with #include_next and adds only the missing * macros, letting the call compile. fcntl() itself is in libc.a and returns an error * for a lock request; anthy's caller already handles that by closing the lock fd and * carrying on, and the embedder uses the read-only main dictionary anyway. */ #ifndef ANTHY_WASM_SHIM_FCNTL_H #define ANTHY_WASM_SHIM_FCNTL_H #include_next #ifndef F_RDLCK #define F_RDLCK 0 #endif #ifndef F_WRLCK #define F_WRLCK 1 #endif #ifndef F_UNLCK #define F_UNLCK 2 #endif #ifndef F_GETLK #define F_GETLK 5 #endif #ifndef F_SETLK #define F_SETLK 6 #endif #ifndef F_SETLKW #define F_SETLKW 7 #endif #endif /* ANTHY_WASM_SHIM_FCNTL_H */