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

posix: implement mmap() #59950

Closed
Tracked by #51211
ycsin opened this issue Jul 3, 2023 · 4 comments · Fixed by #73799
Closed
Tracked by #51211

posix: implement mmap() #59950

ycsin opened this issue Jul 3, 2023 · 4 comments · Fixed by #73799
Assignees
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features Good first issue Good for a first time contributor to take

Comments

@ycsin
Copy link
Member

ycsin commented Jul 3, 2023

There are currently 20 missing POSIX functions with trivial implementations, mmap() is one of them.

mmap - map pages of memory

The mmap() function shall establish a mapping between an address space of a process and a memory object.
...

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html

See RFC #51211 for more info.

@ycsin ycsin added Feature Request A request for a new feature Good first issue Good for a first time contributor to take area: POSIX POSIX API Library labels Jul 3, 2023
@ycsin ycsin moved this to LTS3 Goals in Release Plan Jul 3, 2023
@ycsin ycsin added this to the v3.5.0 milestone Jul 3, 2023
@cfriedt cfriedt assigned cfriedt and unassigned cfriedt Jul 4, 2023
@cfriedt cfriedt removed the status in Release Plan Sep 12, 2023
@nashif nashif removed this from Release Plan Sep 13, 2023
@cfriedt cfriedt removed this from the v3.5.0 milestone Oct 13, 2023
@KaiserS0ze
Copy link

Hi @ycsin I am a first-time contributor. Can I take a crack at this?

@ycsin
Copy link
Member Author

ycsin commented Nov 20, 2023

Hi @ycsin I am a first-time contributor. Can I take a crack at this?

Hi, please feel free to submit PR for anything

@cfriedt
Copy link
Member

cfriedt commented Nov 20, 2023

mmap() can actually get very complicated. It certainly isn't trivial.

We can definitely start out simple though.

Where should we get the file descriptor? How do we differentiate between real and special files? Some of these things might be tricky and there could be dependencies on other POSIX API calls (e.g. stat?)

  1. memory (identity / physical)
  2. memory (virtual)
  3. Device memory (physical)
  4. Regular File from file system, read-only (physical)
    ..

@KaiserS0ze
Copy link

Thanks. Yes, I think there are a lot of edge cases. I will start off with a simple implementation.

@nashif nashif added Enhancement Changes/Updates/Additions to existing features and removed Feature Request A request for a new feature labels Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features Good first issue Good for a first time contributor to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants