/* * shim/pwd.h — the passwd database WASI does not have. * * anthy's src-diclib/conf.c includes and calls getpwuid(getuid()) to find * the user's home directory (used later for the private dictionary and user * history). WASI has neither pwd.h nor getpwuid, and its does not even * declare getuid. Rather than patch anthy's source, this header sits earlier in * the include path (-isystem) and the implementations live in shim_posix.c. * * The embedder passes HOME through the WASI environment, so pw_dir follows it. */ #ifndef ANTHY_WASM_SHIM_PWD_H #define ANTHY_WASM_SHIM_PWD_H #include struct passwd { char *pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; char *pw_gecos; char *pw_dir; char *pw_shell; }; struct passwd *getpwuid(uid_t uid); struct passwd *getpwnam(const char *name); uid_t getuid(void); uid_t geteuid(void); #endif /* ANTHY_WASM_SHIM_PWD_H */