grub2: bring back build of aros-side grub2 tools
[AROS.git] / compiler / posixc / getpwuid.c
blob5e99d6380a7b47884e58fc5d2a8e0fec87e94473
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 = {0};
44 if (_return.pw_name == NULL)
45 __fill_passwd(&_return);
47 if (_return.pw_uid == uid)
48 return &_return;
50 return NULL;