1 /* Generic definitions of functions used by static libc main startup.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19 /* Targets should override this file if the default definitions below
20 will not work correctly very early before TLS is initialized. */
21
22 #include <unistd.h>
23
24 /* Use macro instead of inline function to avoid including <stdio.h>. */
25 #define _startup_fatal(message) __libc_fatal ((message))
26
27 static inline uid_t
startup_getuid(void)28 startup_getuid (void)
29 {
30 return __getuid ();
31 }
32
33 static inline uid_t
startup_geteuid(void)34 startup_geteuid (void)
35 {
36 return __geteuid ();
37 }
38
39 static inline gid_t
startup_getgid(void)40 startup_getgid (void)
41 {
42 return __getgid ();
43 }
44
45 static inline gid_t
startup_getegid(void)46 startup_getegid (void)
47 {
48 return __getegid ();
49 }
50