digitalmars.D - linux api functions
- llee (1/1) Sep 07 2007 I'm trying to call shmget(), and getpagesize(). I've imported std.c.linu...
- Anders Bergh (4/5) Sep 07 2007 extern (C) int shmget(int /*key_t*/ key, size_t size, int shmflg);
- Regan Heath (11/19) Sep 07 2007 To find out for certain look for the definition of key_t in the C
I'm trying to call shmget(), and getpagesize(). I've imported std.c.linux.linux, but the compiler doesn't recognize either function. can anyone tell me what I need to do to call these functions?
Sep 07 2007
On 9/7/07, llee <llee goucher.edu> wrote:I'm trying to call shmget(), and getpagesize(). I've imported std.c.linux.linux, but the compiler doesn't recognize either function. can anyone tell me what I need to do to call these functions?extern (C) int shmget(int /*key_t*/ key, size_t size, int shmflg); extern (C) int getpagesize(); I'm not sure what key_t should be in D, but I think it's int.
Sep 07 2007
Anders Bergh wrote:On 9/7/07, llee <llee goucher.edu> wrote:To find out for certain look for the definition of key_t in the C headers in /usr/include (or similar). Of course it is possible another OS defines it differently, so best thing to do is define it in your D source using a alias, eg. version(<yourOS>) { alias int key_t; } extern (C) int shmget(key_t key, size_t size, int shmflg); extern (C) int getpagesize(); ReganI'm trying to call shmget(), and getpagesize(). I've imported std.c.linux.linux, but the compiler doesn't recognize either function. can anyone tell me what I need to do to call these functions?extern (C) int shmget(int /*key_t*/ key, size_t size, int shmflg); extern (C) int getpagesize(); I'm not sure what key_t should be in D, but I think it's int.
Sep 07 2007