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

Add F_SETFD cmd to _fcntl function #588

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Apr 1, 2024

This PR basically makes the std::filesystem::directory_iterator work as expected.

I have used this example:

#include <stdio.h>
#include <filesystem>

int main(void)
{
    std::filesystem::directory_iterator dir_scanner("./");
    for (auto &entry : dir_scanner) {
        printf("%s\n", entry.path().string().c_str());
    }
    return 0;
}

It prints content of folder:

[    9.2121] dopen name host:/Users/fjtrujy/Downloads/filesystem-test-48641ffa 
[    9.2127] dopen fd = 256
[    9.2180] read/write allocate memory 4000
[    9.2182] ./CMakeFiles
[    9.2183] ./Makefile
[    9.2186] ./cmake_install.cmake
[    9.2231] ./filesystem-test.elf
[    9.2233] ./CMakeCache.txt

Cheers.

@fjtrujy fjtrujy requested a review from uyjulian April 1, 2024 21:39
@fjtrujy fjtrujy changed the title Add F_SETFD cmd to _fcntl function Add F_SETFD cmd to _fcntl function Apr 1, 2024
@fjtrujy fjtrujy requested a review from rickgaiser April 1, 2024 21:41
Copy link
Member

@uyjulian uyjulian left a comment

Choose a reason for hiding this comment

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

Lgtm. The POSIX.1-2008 calls can be implemented more fully in the future to make more libraries like libarchive working properly

@uyjulian uyjulian merged commit 314d87e into ps2dev:master Apr 1, 2024
9 checks passed
@fjtrujy fjtrujy deleted the fix_directory_iterator_cpp branch April 4, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants