This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added core.sys.posix.grp (from Posix <grp.h>).
No Solaris declarations for now.
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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**); |