Last change
on this file was
5f8c41c,
checked in by Joel Sherrill <joel@…>, on 04/01/22 at 18:18:49
|
Update email address of Fernando Ruiz Casas to <fruizcasas@…>
This was requested to be executed prior to relicensing to BSD-2.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief User Database Access Routines |
---|
5 | * @ingroup libcsupport |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Copyright (c) 1999-2009 Ralf Corsepius <corsepiu@faw.uni-ulm.de> |
---|
10 | * Copyright (c) 1999-2013 Joel Sherrill <joel.sherrill@OARcorp.com> |
---|
11 | * Copyright (c) 2000-2001 Fernando Ruiz Casas <fruizcasas@gmail.com> |
---|
12 | * Copyright (c) 2002 Eric Norum <eric@norum.ca> |
---|
13 | * Copyright (c) 2003 Till Straumann <strauman@slac.stanford.edu> |
---|
14 | * Copyright (c) 2012 Alex Ivanov <alexivanov97@gmail.com> |
---|
15 | * |
---|
16 | * The license and distribution terms for this file may be |
---|
17 | * found in the file LICENSE in this distribution or at |
---|
18 | * http://www.rtems.org/license/LICENSE. |
---|
19 | */ |
---|
20 | |
---|
21 | #ifdef HAVE_CONFIG_H |
---|
22 | #include "config.h" |
---|
23 | #endif |
---|
24 | |
---|
25 | #include "pwdgrp.h" |
---|
26 | |
---|
27 | /* |
---|
28 | * Static, thread-unsafe, buffers |
---|
29 | */ |
---|
30 | static char grbuf[200]; |
---|
31 | static struct group grent; |
---|
32 | |
---|
33 | struct group *getgrnam( |
---|
34 | const char *name |
---|
35 | ) |
---|
36 | { |
---|
37 | struct group *p; |
---|
38 | |
---|
39 | if(getgrnam_r(name, &grent, grbuf, sizeof grbuf, &p)) |
---|
40 | return NULL; |
---|
41 | return p; |
---|
42 | } |
---|
43 | |
---|
44 | struct group *getgrgid( |
---|
45 | gid_t gid |
---|
46 | ) |
---|
47 | { |
---|
48 | struct group *p; |
---|
49 | |
---|
50 | if(getgrgid_r(gid, &grent, grbuf, sizeof grbuf, &p)) |
---|
51 | return NULL; |
---|
52 | return p; |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.