Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
src/core/sys/linux/unistd.d
Outdated
| char* getpass(const(char)* prompt); | ||
|
|
||
| // linux system call number from Linux's asm/unistd.h | ||
| version(X86) |
There was a problem hiding this comment.
Wow, this corresponds to 30x file size :-). Could we add this as a another module and publicly import it here?
There was a problem hiding this comment.
Which file do you suggest?
I put them in this file, because that's where they are defined on Linux.
There was a problem hiding this comment.
I'm not sure, perhaps core.sys.linux.syscalls. I don't have a good answer, and maybe they could go here, indeed.
src/core/sys/linux/unistd.d
Outdated
| // linux system call number from Linux's asm/unistd.h | ||
| version(X86) | ||
| { | ||
| enum SYS_restart_syscall = 0; |
There was a problem hiding this comment.
enum SYS: clong { restart_syscall = 0; ... } is a bit too much (for the C's API)?
There was a problem hiding this comment.
I would prefer this as well! I just wasn't sure about this and there seemed to be a couple of old precedents on SYS_ when I did this (one year ago).
There was a problem hiding this comment.
I think it's fair to use enums here, but that's just my preference. It's easy to generate global enums from it at ctfe anyway, if it's required.
|
LGTM |
32d2cee to
ca51e64
Compare
ca51e64 to
2b51fb7
Compare
Done.
Done. As BTW I also realized that after I added the |
andralex
left a comment
There was a problem hiding this comment.
LGTM. @WalterBright, @MartinNowak ?
362f3d1 to
cb702dd
Compare
|
Wow! It has been 1.5 years since this PR was raised. What is blocking this PR at the moment? I need the syscalls for |
|
@wilzbach there are conflicts. Do you mind rebasing the branch |
|
@wilzbach just wondering, don't you need to add an entry in |
|
ping @MartinNowak @Burgos |
|
Sorry, but I won't be working on this in the forseeable future. Feel free to adopt this PR though. |
|
For future readers, I advise them to use the mir-linux-kernel package. |
So I was just looking at @Darredevil's upcoming fiber library and realized that I had this branch lying here for quite a while (almost a year now).
One way to do system calls is by using
syscallfrom libc, another is the obvious by defining the assembler directly as e.g. https://github.com/kubo39/syscall-d does.Let me know which approach you prefer, but I think adding the syscall numbers can be done in any case.
We have used this approach for mir-random.
See also: