Skip to content

Conversation

@shauryarane05
Copy link

@shauryarane05 shauryarane05 commented Mar 23, 2025

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): [e.g. x86_64 or N/A]
  • Platform(s): [e.g. kvm, xen or N/A]
  • Application(s): [e.g. app-python3 or N/A]

Additional configuration

Description of changes

Changes:

  • Removed __*xstat_helper() functions and merged their logic
    directly into *stat() functions.
  • Updated __*xstat() functions to call *stat() functions, ensuring
    consistency with Musl’s implementation.
  • Prevents infinite loops caused by Musl's system call mechanism
    when calling stat() functions.
  • Proposed relocation of __*xstat() functions to lib/nolibc as
    they belong in Unikraft’s internal libc-like interface.

Testing:

  • Built Unikraft with these changes to ensure no compilation issues.
  • Verified functionality of stat(), lstat(), fstat(), etc.,
    with no infinite loops when used with Musl.
    Signed-off-by: shauryarane05 [email protected]

@github-actions github-actions bot added area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/nolibc Only neccessary subset of libc functionality lib/syscall_shim lib/vfscore VFS Core Interface labels Mar 23, 2025
@shauryarane05
Copy link
Author

@razvand hey I need to do a little formatting in the code but can you confirm if the changes are correct or is there any feedback i need to work on

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shauryarane05 how did you test this? I get a lot of build errors regarding syscalls definitions, similar to this:

In file included from /projects/unikraft/catalog-core/repos/unikraft/lib/vfscore/main.c:56:
/projects/unikraft/catalog-core/repos/unikraft/lib/vfscore/main.c: At top level:
/projects/unikraft/catalog-core/repos/unikraft/lib/syscall_shim/include/uk/syscall.h:123:46: error: conflicting types for ‘uk_syscall_do_stat’; have ‘long int(long int,  long int)’
  123 | #define __UK_NAME2SCALLDO_FN(name) UK_CONCAT(uk_syscall_do_, name)

@shauryarane05
Copy link
Author

shauryarane05 commented Mar 24, 2025

@StefanJum
I tested it with https://github.com/unikraft/app-nginx and https://github.com/unikraft/app-sqlite
it built without any errors.
how are you testing it or any library you think i missed while building these apps as i followed the setup steps in the md file to build these apps

@StefanJum
Copy link
Member

StefanJum commented Mar 24, 2025 via email

@shauryarane05
Copy link
Author

ok I am looking into it once more, made a few mistakes will update them

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

Labels

area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/nolibc Only neccessary subset of libc functionality lib/syscall_shim lib/vfscore VFS Core Interface

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

2 participants