This is probably a noob question, but I don't even know what to google for.
I'm trying to implement a fuse filesystem and am having trouble passing structs, probably stemming from me being inexperienced with C++.
static int getStat(std::string path, struct stat *stout)
{
...
struct stat *st = new struct stat();
lstat(path.c_str(), st);
// lstat correctly filled st according to gdb
...
stout = st;
// values are correctly copied to stout according to gdb
}
void something()
{
struct stat *st = new struct stat(); // this might also be stack allocated by fuse, idk
getStat("/", st);
// but st is all zero now !?
}
What am I missing? How do I get my data out of the function correctly?