Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / sim / common / portability.c
CommitLineData
ad9cc209 1/* Portability shims for missing OS support.
88b9d363 2 Copyright (C) 2021-2022 Free Software Foundation, Inc.
ad9cc209
MF
3 Contributed by Mike Frysinger.
4
5This file is part of the GNU Simulators.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20/* This must come before any other includes. */
21#include "defs.h"
22
23#include <unistd.h>
24
25#include "portability.h"
26
27#ifndef HAVE_GETEGID
28int getegid(void)
29{
30 return 0;
31}
32#endif
33
34#ifndef HAVE_GETEUID
35int geteuid(void)
36{
37 return 0;
38}
39#endif
40
41#ifndef HAVE_GETGID
42int getgid(void)
43{
44 return 0;
45}
46#endif
47
48#ifndef HAVE_GETUID
49int getuid(void)
50{
51 return 0;
52}
53#endif
54
55#ifndef HAVE_SETGID
56int setgid(int gid)
57{
58 return -1;
59}
60#endif
61
62#ifndef HAVE_SETUID
63int setuid(int uid)
64{
65 return -1;
66}
67#endif
This page took 0.034174 seconds and 4 git commands to generate.