digitalmars.D.learn - How to use Linux message queues?
- Neven (14/14) Nov 14 2014 I've tried importing core.sys.posix.sys.msg however I get the
- Sean Kelly (2/2) Nov 14 2014 Sounds like a module that should be in core.sys.linux. Care to
- Gary Willoughby (6/8) Nov 14 2014 Yes, these are usually added when someone requires them.
- Neven (9/11) Nov 14 2014 Ok, I've tried to make a module, though since I'm a D beginner
- Gary Willoughby (5/16) Nov 15 2014 Not a bad start. A little tip, use c_long and c_ulong from
- Gary Willoughby (3/5) Nov 15 2014 Incidentally, where are you studying? It would be nice to know
- Neven (8/14) Nov 15 2014 I submitted a pull request.
I've tried importing core.sys.posix.sys.msg however I get the error that is doesn't exist. I sort of solved the problem with: extern (C) int msgget ( key_t key, int msgflg ); extern (C) int msgsnd ( int msqid, msgbuf *msgp, int msgsz, int msgflg ); struct msgbuf { long mtype; /* type of message */ int a; int b; }; though this is ugly and I don't have useful constants located in C headers. I'm wondering is there a better way to utilize Linux message queue IPC in D?
Nov 14 2014
Sounds like a module that should be in core.sys.linux. Care to submit a pull request?
Nov 14 2014
On Friday, 14 November 2014 at 16:45:45 UTC, Sean Kelly wrote:Sounds like a module that should be in core.sys.linux. Care to submit a pull request?Yes, these are usually added when someone requires them. Neven, if you're able, submitting a pull request to druntime of the complete module would be awesome. You can see how the others are structure here: https://github.com/D-Programming-Language/druntime/tree/master/src/core/sys/posix/sys
Nov 14 2014
On Friday, 14 November 2014 at 16:45:45 UTC, Sean Kelly wrote:Sounds like a module that should be in core.sys.linux. Care to submit a pull request?Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes) could you first feedback my code? I'm unsure in few parts which I commented on. I spent some time reading manuals, reading through ipc.d for info how to do it, and reading msg.h in my distro (Linux Mint x86-64 17) includes. http://pastebin.com/xxJe2FYa
Nov 14 2014
On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote:On Friday, 14 November 2014 at 16:45:45 UTC, Sean Kelly wrote:Not a bad start. A little tip, use c_long and c_ulong from core.stdc.config instead of long/ulong when interfacing with C. This is because its size changes when compiled on different architectures.Sounds like a module that should be in core.sys.linux. Care to submit a pull request?Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes) could you first feedback my code? I'm unsure in few parts which I commented on. I spent some time reading manuals, reading through ipc.d for info how to do it, and reading msg.h in my distro (Linux Mint x86-64 17) includes. http://pastebin.com/xxJe2FYa
Nov 15 2014
On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote:Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes)Incidentally, where are you studying? It would be nice to know where D is being taught.
Nov 15 2014
On Saturday, 15 November 2014 at 12:04:45 UTC, Gary Willoughby wrote:On Saturday, 15 November 2014 at 00:33:02 UTC, Neven wrote:I submitted a pull request. D isn't officially taught and as far as I know only I use it on faculty. We were instructed we could use whatever language we like to code our exercises and later demonstrate its correctness. My faculty is FER - http://www.fer.unizg.hr/en Link is English version of faculty web page.Ok, I've tried to make a module, though since I'm a D beginner (also a student who fiddles with D for Operating system classes)Incidentally, where are you studying? It would be nice to know where D is being taught.
Nov 15 2014