Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Added core.sys.posix.grp (from Posix <grp.h>).
Browse files Browse the repository at this point in the history
No Solaris declarations for now.
  • Loading branch information
s-ludwig committed Jan 2, 2013
1 parent 8cbe014 commit 01d8aeb
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions src/core/sys/posix/grp.d
@@ -0,0 +1,86 @@
/**
* D header file for POSIX.
*
* Copyright: Copyright Sean Kelly 2005 - 2009, Sönke Ludwig 2013.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Sean Kelly, Alex Rønne Petersen, Sönke Ludwig
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/

/* Copyright Sean Kelly 2005 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.sys.posix.grp;

private import core.sys.posix.config;
public import core.sys.posix.sys.types; // for gid_t, uid_t

version (Posix):
extern (C):

//
// Required
//
/*
struct group
{
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
group* getgrnam(in char*);
group* getgrgid(gid_t);
*/

version( linux )
{
struct group
{
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
}
else version( OSX )
{
struct group
{
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
}
else version( FreeBSD )
{
struct group
{
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
}
else
{
static assert(false, "Unsupported platform");
}

group* getgrnam(in char*);
group* getgruid(uid_t);

//
// Thread-Safe Functions (TSF)
//
/*
int getgrnam_r(in char*, group*, char*, size_t, group**);
int getgruid_r(gid_t, group*, char*, size_t, group**);
*/

int getgrnam_r(in char*, group*, char*, size_t, group**);
int getgruid_r(gid_t, group*, char*, size_t, group**);

0 comments on commit 01d8aeb

Please sign in to comment.