Comments (8)
Hi @no92,
I would love to contribute here, but I still have some questions regarding portability issues.
The goal is to implement the mincore
function. Does it require a specific implementation for different sysdeps, or could one generic implementation suffice?
Additionally, it's possible that I lack knowledge in these subjects, but I am eager to learn. I have a strong background in C, and with a bit more context, I'm confident that I can make a meaningful contribution here!
Let me know! :)
from mlibc.
We'd want to leave the actual implementation up to sysdeps. E.g. on Linux mincore
is implemented via a system call, and other systems probably want to do their own thing.
from mlibc.
Okay, I see. Totally makes sense!
So here the goal would be to implement the function for all supported os ?
from mlibc.
That's kinda out of scope for mlibc, I think Linux is the only system we support that currently implements an mincore
syscall, and implementing it ourselves for everyone else would be quite a bit of work on our side. I don't think this even can be implemented without OS support, since it checks for page residency (whether accessing it will not require allocation or loading data from disk), not whether the page is mapped in in general, and pages becoming non-resident is supposed to be transparent, apart from maybe the time it takes to load it back in.
How mlibc deals with this is via sysdeps, which house the system-specific functions required by the various generic libc functions. Most sysdep functions are marked [[gnu::weak]]
, which means that if they're missing, they resolve to NULL at link time. The actual function that uses the sysdep then checks if that's the case, and if so, bails out with an ENOSYS
error (or whatever's appropriate). Once a particular system adds a way to provide the sysdep for mincore
, it can be added, and the generic function will just work on it.
Also, I've just had a look, and we apparently have mincore
in mlibc itself? I might be missing something, but perhaps @no92 meant to make this issue on the Managarm repo? It'd still be appreciated if you took up the task of doing that, but that's probably gonna be a more involved project than just the mlibc side and the Linux sysdep. I apologize for the confusion if that's the case!
from mlibc.
Yeah I didn't notice the linux sysdep. I guess it would be nice to implement it for managarm, as we don't have many cases where a page wouldn't be resident in memory that shouldn't be too hardβ’.
from mlibc.
@no92 so it would not be in this repo but on the Managarm's one ?
from mlibc.
Managarm's sysdeps are implemented in this repo, under sysdeps/managarm
.
from mlibc.
Okay, and you think that it's a good first issue ? @no92
from mlibc.
Related Issues (20)
- mbtowc: is broken HOT 1
- posix: pthread_cancel test fails intermittently on RISC-V Linux HOT 4
- options: allow logging and debugging to be configured by environment variables
- rtdl: env vars LD_LIBRARY_PATH, LD_PRELOAD and friends are unimplemented HOT 1
- rtdl: TCB is not deallocated on thread exit
- options/posix: review locking in syslog implementation HOT 1
- pthread_condattr_* are not correctly implemented HOT 1
- mbtowc does not handle decoding errors
- x86 port HOT 5
- setxid should change credentials for all threads HOT 6
- ansi: strxfrm unimplemented HOT 1
- frigg: slab_pool corruption HOT 2
- calloc() does not check for overflow
- implement `freopen` for `mem_file`
- code formatting rules? HOT 4
- Functions with weak attribute sometimes don't get built into executables if built as a static library HOT 2
- posix_memalign alignment assertion fail
- Certain combinations of TLS segments lead to misaligned TLS pointers
- dirent has wrong ABI on linux HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlibc.