Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libgfortran / intrinsics / getXid.c
blob345cace2c0a998f79a8dfc22ec54b09789640601
1 /* Wrapper for the unix get{g,p,u}id functions.
2 Copyright (C) 2004 Free Software Foundation, Inc.
4 This file is part of the GNU Fortran 95 runtime library (libgfortran).
6 Libgfortran is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 In addition to the permissions in the GNU General Public License, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of this file into combinations with other programs,
14 and to distribute those combinations without any restriction coming
15 from the use of this file. (The General Public License restrictions
16 do apply in other respects; for example, they cover modification of
17 the file, and distribution when not linked into a combine
18 executable.)
20 Libgfortran is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 You should have received a copy of the GNU General Public
26 License along with libgfortran; see the file COPYING. If not,
27 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. */
30 #include "config.h"
32 #if HAVE_SYS_TYPES_H
33 #include <sys/types.h>
34 #endif
35 #if HAVE_UNISTD_H
36 #include <unistd.h>
37 #endif
39 #include "libgfortran.h"
41 #ifdef HAVE_GETGID
42 extern GFC_INTEGER_4 PREFIX(getgid) (void);
43 export_proto_np(PREFIX(getgid));
45 GFC_INTEGER_4
46 PREFIX(getgid) (void)
48 return getgid ();
50 #endif
52 #ifdef HAVE_GETPID
53 extern GFC_INTEGER_4 PREFIX(getpid) (void);
54 export_proto_np(PREFIX(getpid));
56 GFC_INTEGER_4
57 PREFIX(getpid) (void)
59 return getpid ();
61 #endif
63 #ifdef HAVE_GETUID
64 extern GFC_INTEGER_4 PREFIX(getuid) (void);
65 export_proto_np(PREFIX(getuid));
67 GFC_INTEGER_4
68 PREFIX(getuid) (void)
70 return getuid ();
72 #endif