Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing sys/stat.h #464

Open
JayFoxRox opened this issue Apr 21, 2021 · 2 comments
Open

Missing sys/stat.h #464

JayFoxRox opened this issue Apr 21, 2021 · 2 comments

Comments

@JayFoxRox
Copy link
Member

JayFoxRox commented Apr 21, 2021

Here's a hack I've been using locally:

echo "#pragma once // Generated" > $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "#include <stddef.h>" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "struct _stat { size_t st_size; int st_mode; int st_mtime; int st_atime; int st_nlink; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "struct _stati64 { size_t st_size; int st_mode; int st_mtime; int st_atime; int st_nlink; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "static int _stati64(const char* x, ...) { return 0; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h

I hope that someone will implement this properly.

There's more functionality in this, but this is enough for my current projects

@LukeUsher
Copy link
Contributor

My view on this would be that we shouldn’t fix this: sys/stat.h is a POSIX/UNIX api and should not be assumed to be present in non-posix environments such as Xbox.

@glebm
Copy link
Contributor

glebm commented Jul 1, 2022

Yeah I agree, will fix this on DevilutionX side (same for sys/types.h)

I initially was under the wrong impression that NXDK aims to be somewhat POSIX compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants