gdb/testsuite: add some xfail in gdb.base/startup-with-shell.exp
[binutils-gdb.git] / sim / common / portability.c
blob63b3d51ef62417b2562b1b70d53321dc785a7e58
1 /* Portability shims for missing OS support.
2 Copyright (C) 2021-2024 Free Software Foundation, Inc.
3 Contributed by Mike Frysinger.
5 This file is part of the GNU Simulators.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* This must come before any other includes. */
21 #include "defs.h"
23 #include <unistd.h>
25 #include "portability.h"
27 #ifndef HAVE_GETEGID
28 int getegid(void)
30 return 0;
32 #endif
34 #ifndef HAVE_GETEUID
35 int geteuid(void)
37 return 0;
39 #endif
41 #ifndef HAVE_GETGID
42 int getgid(void)
44 return 0;
46 #endif
48 #ifndef HAVE_GETUID
49 int getuid(void)
51 return 0;
53 #endif
55 #ifndef HAVE_SETGID
56 int setgid(int gid)
58 return -1;
60 #endif
62 #ifndef HAVE_SETUID
63 int setuid(int uid)
65 return -1;
67 #endif