uboot/arch/nds32/include/asm/posix_types.h
<<
>>
Prefs
   1/*
   2 * linux/include/asm-arm/posix_types.h
   3 *
   4 * Copyright (C) 1996-1998 Russell King.
   5 *
   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 *
  10 * This program is free software; you can redistribute it and/or modify
  11 * it under the terms of the GNU General Public License version 2 as
  12 * published by the Free Software Foundation.
  13 *
  14 *  Changelog:
  15 *   27-06-1996 RMK     Created
  16 *   05-03-2010 Modified for arch NDS32
  17 */
  18#ifndef __ARCH_NDS_POSIX_TYPES_H
  19#define __ARCH_NDS_POSIX_TYPES_H
  20
  21/*
  22 * This file is generally used by user-level software, so you need to
  23 * be a little careful about namespace pollution etc.  Also, we cannot
  24 * assume GCC is being used.
  25 */
  26
  27typedef unsigned short          __kernel_dev_t;
  28typedef unsigned long           __kernel_ino_t;
  29typedef unsigned short          __kernel_mode_t;
  30typedef unsigned short          __kernel_nlink_t;
  31typedef long                    __kernel_off_t;
  32typedef int                     __kernel_pid_t;
  33typedef unsigned short          __kernel_ipc_pid_t;
  34typedef unsigned short          __kernel_uid_t;
  35typedef unsigned short          __kernel_gid_t;
  36#ifdef __GNUC__
  37typedef __SIZE_TYPE__           __kernel_size_t;
  38#else
  39typedef unsigned int            __kernel_size_t;
  40#endif
  41typedef int                     __kernel_ssize_t;
  42typedef int                     __kernel_ptrdiff_t;
  43typedef long                    __kernel_time_t;
  44typedef long                    __kernel_suseconds_t;
  45typedef long                    __kernel_clock_t;
  46typedef int                     __kernel_daddr_t;
  47typedef char                    *__kernel_caddr_t;
  48typedef unsigned short          __kernel_uid16_t;
  49typedef unsigned short          __kernel_gid16_t;
  50typedef unsigned int            __kernel_uid32_t;
  51typedef unsigned int            __kernel_gid32_t;
  52
  53typedef unsigned short          __kernel_old_uid_t;
  54typedef unsigned short          __kernel_old_gid_t;
  55
  56#ifdef __GNUC__
  57typedef long long               __kernel_loff_t;
  58#endif
  59
  60typedef struct {
  61#if defined(__KERNEL__) || defined(__USE_ALL)
  62        int     val[2];
  63#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
  64        int     __val[2];
  65#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
  66} __kernel_fsid_t;
  67
  68#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
  69
  70#undef  __FD_SET
  71#define __FD_SET(fd, fdsetp) \
  72                (((fd_set *)fdsetp)->fds_bits[fd >> 5] |= (1<<(fd & 31)))
  73
  74#undef  __FD_CLR
  75#define __FD_CLR(fd, fdsetp) \
  76                (((fd_set *)fdsetp)->fds_bits[fd >> 5] &= ~(1<<(fd & 31)))
  77
  78#undef  __FD_ISSET
  79#define __FD_ISSET(fd, fdsetp) \
  80                ((((fd_set *)fdsetp)->fds_bits[fd >> 5] & (1<<(fd & 31))) != 0)
  81
  82#undef  __FD_ZERO
  83#define __FD_ZERO(fdsetp) \
  84                (memset(fdsetp, 0, sizeof(*(fd_set *) fdsetp)))
  85
  86#endif
  87
  88#endif /* __ARCH_NDS_POSIX_TYPES_H */
  89