Missing sys/stat.h

Open
#464 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
tooling

Research direction

The issue identifies the missing header at lib/xboxrt/libc_extensions/sys/stat.h and shows a local stub with _stat, _stati64, and _stati64(). Start by reading that example and checking how neighboring libc extension headers define and test their interfaces. Done means a proper sys/stat.h provides the needed functionality beyond the stub; the issue does not specify the full required API.

Written by the indexing model from the issue text.

Description

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

Dominant language
C
Stars
600
Forks
97
Avg merge
11h 48m
Merged PRs (30d)
2

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from XboxDev/nxdk

All issues in XboxDev/nxdk

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.