OSDN Git Service

* include/posix.h: Add multiple include header protection.
[pf3gnuchains/gcc-fork.git] / libjava / include / posix.h
1 // posix.h -- Helper functions for POSIX-flavored OSs.
2
3 /* Copyright (C) 2000, 2002  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #ifndef __JV_POSIX_H__
12 #define __JV_POSIX_H__
13
14 /* Required on Tru64 UNIX V4/V5 so <sys/socket.h> defines prototypes of
15    socket functions with socklen_t instead of size_t.  This must be defined
16    early so <standards.h> defines the correct version of __PIIX.  */
17 #define _POSIX_PII_SOCKET
18
19 #include <time.h>
20 #include <sys/types.h>
21
22 #ifdef HAVE_SYS_TIME_H
23 #include <sys/time.h>
24 #endif
25
26 #ifdef HAVE_SYS_SELECT_H
27 #include <sys/select.h>
28 #endif
29
30 #ifdef HAVE_UNISTD_H
31 #include <unistd.h>
32 #endif
33
34 #include <fcntl.h>
35
36 #include <gcj/cni.h>
37
38 extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *);
39 extern jlong _Jv_platform_gettimeofday ();
40 extern void _Jv_platform_initialize (void);
41
42 inline void
43 _Jv_platform_close_on_exec (jint fd)
44 {
45   // Ignore errors.
46   fcntl (fd, F_SETFD, FD_CLOEXEC);
47 }
48
49 #endif