posixc.library: add a simple user/grp emulation for purpose of set/get uid functions
[AROS.git] / compiler / posixc / getpwuid.c
blobd1727d8086a0798d34d3bb655b5458b8f533a09c
1 /*
2 Copyright © 2004-2016, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
7 #include <errno.h>
9 #include "__usergrp.h"
11 /*****************************************************************************
13 NAME */
15 #include <pwd.h>
17 struct passwd *getpwuid(
19 /* SYNOPSIS */
20 uid_t uid)
22 /* FUNCTION
24 INPUTS
26 RESULT
28 NOTES
29 Function is not re-entrant. Results will be overwritten by
30 subsequent calls.
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 ******************************************************************************/
42 static struct passwd _return;
44 if (_user.ur_uid == uid)
46 _return.pw_name = _user.ur_name;
47 _return.pw_uid = _user.ur_uid;
48 _return.pw_dir = _user.ur_dir;
49 _return.pw_shell = _user.ur_shell;
50 _return.pw_passwd = _user.ur_passwd;
51 _return.pw_gecos = _user.ur_gecos;
53 return &_return;
56 return NULL;