1 /* $Id: posix_types.h,v 1.5 1998/08/17 13:59:34 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
9 #ifndef __ARCH_MIPS_POSIX_TYPES_H
10 #define __ARCH_MIPS_POSIX_TYPES_H
13 #define __need_ptrdiff_t
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
22 typedef unsigned long __kernel_dev_t
;
23 typedef unsigned long __kernel_ino_t
;
24 typedef unsigned long __kernel_mode_t
;
25 typedef unsigned long __kernel_nlink_t
;
26 typedef long __kernel_off_t
;
27 typedef long __kernel_pid_t
;
28 typedef long __kernel_ipc_pid_t
;
29 typedef long __kernel_uid_t
;
30 typedef long __kernel_gid_t
;
31 typedef __SIZE_TYPE__ __kernel_size_t
;
32 typedef __SSIZE_TYPE__ __kernel_ssize_t
;
33 typedef int __kernel_ptrdiff_t
;
34 typedef long __kernel_time_t
;
35 typedef long __kernel_suseconds_t
;
36 typedef long __kernel_clock_t
;
37 typedef long __kernel_daddr_t
;
38 typedef char * __kernel_caddr_t
;
41 typedef long long __kernel_loff_t
;
48 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
51 static __inline__
void __FD_SET(unsigned long __fd
, __kernel_fd_set
*__fdsetp
)
53 unsigned long __tmp
= __fd
/ __NFDBITS
;
54 unsigned long __rem
= __fd
% __NFDBITS
;
55 __fdsetp
->fds_bits
[__tmp
] |= (1UL<<__rem
);
59 static __inline__
void __FD_CLR(unsigned long __fd
, __kernel_fd_set
*__fdsetp
)
61 unsigned long __tmp
= __fd
/ __NFDBITS
;
62 unsigned long __rem
= __fd
% __NFDBITS
;
63 __fdsetp
->fds_bits
[__tmp
] &= ~(1UL<<__rem
);
67 static __inline__
int __FD_ISSET(unsigned long __fd
, const __kernel_fd_set
*__p
)
69 unsigned long __tmp
= __fd
/ __NFDBITS
;
70 unsigned long __rem
= __fd
% __NFDBITS
;
71 return (__p
->fds_bits
[__tmp
] & (1UL<<__rem
)) != 0;
75 * This will unroll the loop for the normal constant case (8 ints,
76 * for a 256-bit fd_set)
79 static __inline__
void __FD_ZERO(__kernel_fd_set
*__p
)
81 unsigned long *__tmp
= __p
->fds_bits
;
84 if (__builtin_constant_p(__FDSET_LONGS
)) {
85 switch (__FDSET_LONGS
) {
87 __tmp
[ 0] = 0; __tmp
[ 1] = 0;
88 __tmp
[ 2] = 0; __tmp
[ 3] = 0;
89 __tmp
[ 4] = 0; __tmp
[ 5] = 0;
90 __tmp
[ 6] = 0; __tmp
[ 7] = 0;
91 __tmp
[ 8] = 0; __tmp
[ 9] = 0;
92 __tmp
[10] = 0; __tmp
[11] = 0;
93 __tmp
[12] = 0; __tmp
[13] = 0;
94 __tmp
[14] = 0; __tmp
[15] = 0;
98 __tmp
[ 0] = 0; __tmp
[ 1] = 0;
99 __tmp
[ 2] = 0; __tmp
[ 3] = 0;
100 __tmp
[ 4] = 0; __tmp
[ 5] = 0;
101 __tmp
[ 6] = 0; __tmp
[ 7] = 0;
105 __tmp
[ 0] = 0; __tmp
[ 1] = 0;
106 __tmp
[ 2] = 0; __tmp
[ 3] = 0;
118 #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
120 #endif /* __ARCH_MIPS_POSIX_TYPES_H */