digitalmars.D - Missing functions core.sys.linux.sched
- Begah (10/10) Jun 15 2020 Hey everyone!
- Adam D. Ruppe (7/10) Jun 15 2020 They probably just forgot to add it.
- Begah (5/15) Jun 15 2020 Thanks that works, i guess DMD links with the up-to-date C
- Adam D. Ruppe (6/8) Jun 15 2020 yeah, the C function headers just have the prototype, the actual
- Sebastiaan Koppe (4/15) Jun 15 2020 Laeeth ran dpp across a few missing ones as well.
- Begah (2/19) Jun 15 2020 It wasn't in there but thanks for the heads up!
Hey everyone! I started working with network namespaces in linux and there's a function is sched.h in C that allows a threat to switch namespace : setns (https://man7.org/linux/man-pages/man2/setns.2.html) I have checked both sched.d files from dmd and ldc and both are missing this function, although dmd's sched.d seems to be more complete than ldc's. Is there a reason for the missing function aside from not being up to date? What are the options for adding it? A C library for just this function?
Jun 15 2020
On Monday, 15 June 2020 at 13:34:14 UTC, Begah wrote:Is there a reason for the missing function aside from not being up to date? What are the options for adding it? A C library for just this function?They probably just forgot to add it. You can add it to your own code easily. Copy paste this into your code somewhere: extern(C) int setns(int fd, int nstype); And you can call it. A PR to druntime to add that to the official thing would prolly be accepted to.
Jun 15 2020
On Monday, 15 June 2020 at 13:57:37 UTC, Adam D. Ruppe wrote:On Monday, 15 June 2020 at 13:34:14 UTC, Begah wrote:Thanks that works, i guess DMD links with the up-to-date C libraries! If i find the time i'll try to check was is missing to possibly do a PR.Is there a reason for the missing function aside from not being up to date? What are the options for adding it? A C library for just this function?They probably just forgot to add it. You can add it to your own code easily. Copy paste this into your code somewhere: extern(C) int setns(int fd, int nstype); And you can call it. A PR to druntime to add that to the official thing would prolly be accepted to.
Jun 15 2020
On Monday, 15 June 2020 at 14:52:02 UTC, Begah wrote:Thanks that works, i guess DMD links with the up-to-date C libraries!yeah, the C function headers just have the prototype, the actual code it links to is whatever actually exists on your system. there's nothing special about it being in druntime, that's just for user convenience to have a list of things so they don't have to copy/paste themselves out of the man pages.
Jun 15 2020
On Monday, 15 June 2020 at 13:34:14 UTC, Begah wrote:Hey everyone! I started working with network namespaces in linux and there's a function is sched.h in C that allows a threat to switch namespace : setns (https://man7.org/linux/man-pages/man2/setns.2.html) I have checked both sched.d files from dmd and ldc and both are missing this function, although dmd's sched.d seems to be more complete than ldc's. Is there a reason for the missing function aside from not being up to date? What are the options for adding it? A C library for just this function?Laeeth ran dpp across a few missing ones as well. https://github.com/symmetryinvestments/symmetry-linux No idea if it is in there, but just so that you know.
Jun 15 2020
On Monday, 15 June 2020 at 14:19:50 UTC, Sebastiaan Koppe wrote:On Monday, 15 June 2020 at 13:34:14 UTC, Begah wrote:It wasn't in there but thanks for the heads up!Hey everyone! I started working with network namespaces in linux and there's a function is sched.h in C that allows a threat to switch namespace : setns (https://man7.org/linux/man-pages/man2/setns.2.html) I have checked both sched.d files from dmd and ldc and both are missing this function, although dmd's sched.d seems to be more complete than ldc's. Is there a reason for the missing function aside from not being up to date? What are the options for adding it? A C library for just this function?Laeeth ran dpp across a few missing ones as well. https://github.com/symmetryinvestments/symmetry-linux No idea if it is in there, but just so that you know.
Jun 15 2020