2 * linux/include/asm-arm/posix_types.h
4 * Copyright (C) 1996-1998 Russell King.
6 * Copyright (C) 2011 Andes Technology Corporation
7 * Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
8 * Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
9 * Copyright (C) 2017 Rick Chen (rick@andestech.com)
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
16 * 27-06-1996 RMK Created
17 * 25-10-2017 Modified for arch RISCV
19 #ifndef __ARCH_RISCV_POSIX_TYPES_H
20 #define __ARCH_RISCV_POSIX_TYPES_H
23 * This file is generally used by user-level software, so you need to
24 * be a little careful about namespace pollution etc. Also, we cannot
25 * assume GCC is being used.
28 typedef unsigned short __kernel_dev_t
;
29 typedef unsigned long __kernel_ino_t
;
30 typedef unsigned short __kernel_mode_t
;
31 typedef unsigned short __kernel_nlink_t
;
32 typedef long __kernel_off_t
;
33 typedef int __kernel_pid_t
;
34 typedef unsigned short __kernel_ipc_pid_t
;
35 typedef unsigned short __kernel_uid_t
;
36 typedef unsigned short __kernel_gid_t
;
38 typedef __SIZE_TYPE__ __kernel_size_t
;
40 typedef unsigned int __kernel_size_t
;
42 typedef int __kernel_ssize_t
;
43 typedef int __kernel_ptrdiff_t
;
44 typedef long __kernel_time_t
;
45 typedef long __kernel_suseconds_t
;
46 typedef long __kernel_clock_t
;
47 typedef int __kernel_daddr_t
;
48 typedef char *__kernel_caddr_t
;
49 typedef unsigned short __kernel_uid16_t
;
50 typedef unsigned short __kernel_gid16_t
;
51 typedef unsigned int __kernel_uid32_t
;
52 typedef unsigned int __kernel_gid32_t
;
54 typedef unsigned short __kernel_old_uid_t
;
55 typedef unsigned short __kernel_old_gid_t
;
58 typedef long long __kernel_loff_t
;
62 #if defined(__KERNEL__) || defined(__USE_ALL)
64 #else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
66 #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
69 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
72 #define __FD_SET(fd, fdsetp) \
73 (((fd_set *)fdsetp)->fds_bits[fd >> 5] |= (1 << (fd & 31)))
76 #define __FD_CLR(fd, fdsetp) \
77 (((fd_set *)fdsetp)->fds_bits[fd >> 5] &= ~(1 << (fd & 31)))
80 #define __FD_ISSET(fd, fdsetp) \
81 ((((fd_set *)fdsetp)->fds_bits[fd >> 5] & (1 << (fd & 31))) != 0)
84 #define __FD_ZERO(fdsetp) \
85 (memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
89 #endif /* __ARCH_RISCV_POSIX_TYPES_H */