The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/bsd/sys/types.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved.
    3  *
    4  * @APPLE_LICENSE_HEADER_START@
    5  * 
    6  * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
    7  * 
    8  * This file contains Original Code and/or Modifications of Original Code
    9  * as defined in and that are subject to the Apple Public Source License
   10  * Version 2.0 (the 'License'). You may not use this file except in
   11  * compliance with the License. Please obtain a copy of the License at
   12  * http://www.opensource.apple.com/apsl/ and read it before using this
   13  * file.
   14  * 
   15  * The Original Code and all software distributed under the License are
   16  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
   17  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
   18  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
   19  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
   20  * Please see the License for the specific language governing rights and
   21  * limitations under the License.
   22  * 
   23  * @APPLE_LICENSE_HEADER_END@
   24  */
   25 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
   26 /*-
   27  * Copyright (c) 1982, 1986, 1991, 1993, 1994
   28  *      The Regents of the University of California.  All rights reserved.
   29  * (c) UNIX System Laboratories, Inc.
   30  * All or some portions of this file are derived from material licensed
   31  * to the University of California by American Telephone and Telegraph
   32  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
   33  * the permission of UNIX System Laboratories, Inc.
   34  *
   35  * Redistribution and use in source and binary forms, with or without
   36  * modification, are permitted provided that the following conditions
   37  * are met:
   38  * 1. Redistributions of source code must retain the above copyright
   39  *    notice, this list of conditions and the following disclaimer.
   40  * 2. Redistributions in binary form must reproduce the above copyright
   41  *    notice, this list of conditions and the following disclaimer in the
   42  *    documentation and/or other materials provided with the distribution.
   43  * 3. All advertising materials mentioning features or use of this software
   44  *    must display the following acknowledgement:
   45  *      This product includes software developed by the University of
   46  *      California, Berkeley and its contributors.
   47  * 4. Neither the name of the University nor the names of its contributors
   48  *    may be used to endorse or promote products derived from this software
   49  *    without specific prior written permission.
   50  *
   51  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   52  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   53  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   54  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   55  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   56  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   57  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   58  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   59  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   60  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   61  * SUCH DAMAGE.
   62  *
   63  *      @(#)types.h     8.4 (Berkeley) 1/21/94
   64  */
   65 
   66 #ifndef _SYS_TYPES_H_
   67 #define _SYS_TYPES_H_
   68 
   69 #include <sys/appleapiopts.h>
   70 
   71 #ifndef __ASSEMBLER__
   72 #include <sys/cdefs.h>
   73 
   74 /* Machine type dependent parameters. */
   75 #include <machine/types.h>
   76 
   77 #include <machine/ansi.h>
   78 #include <machine/endian.h>
   79 
   80 #ifndef _POSIX_SOURCE
   81 typedef unsigned char   u_char;
   82 typedef unsigned short  u_short;
   83 typedef unsigned int    u_int;
   84 typedef unsigned long   u_long;
   85 typedef unsigned short  ushort;         /* Sys V compatibility */
   86 typedef unsigned int    uint;           /* Sys V compatibility */
   87 #endif
   88 
   89 typedef u_int64_t       u_quad_t;       /* quads */
   90 typedef int64_t         quad_t;
   91 typedef quad_t *        qaddr_t;
   92 
   93 typedef char *          caddr_t;        /* core address */
   94 typedef int32_t         daddr_t;        /* disk address */
   95 typedef int32_t         dev_t;          /* device number */
   96 typedef u_int32_t       fixpt_t;        /* fixed point number */
   97 typedef u_int32_t       gid_t;          /* group id */
   98 typedef u_int32_t       in_addr_t;      /* base type for internet address */
   99 typedef u_int16_t       in_port_t;
  100 typedef u_int32_t       ino_t;          /* inode number */
  101 typedef long            key_t;          /* IPC key (for Sys V IPC) */
  102 typedef u_int16_t       mode_t;         /* permissions */
  103 typedef u_int16_t       nlink_t;        /* link count */
  104 typedef quad_t          off_t;          /* file offset */
  105 typedef int32_t         pid_t;          /* process id */
  106 typedef quad_t          rlim_t;         /* resource limit */
  107 typedef int32_t         segsz_t;        /* segment size */
  108 typedef int32_t         swblk_t;        /* swap offset */
  109 typedef u_int32_t       uid_t;          /* user id */
  110 typedef u_int32_t       useconds_t;     /* microseconds (unsigned) */
  111 
  112 #ifndef _POSIX_SOURCE
  113 /* Major, minor numbers, dev_t's. */
  114 #define major(x)        ((int32_t)(((u_int32_t)(x) >> 24) & 0xff))
  115 #define minor(x)        ((int32_t)((x) & 0xffffff))
  116 #define makedev(x,y)    ((dev_t)(((x) << 24) | (y)))
  117 #endif
  118 
  119 #ifndef _BSD_CLOCK_T_DEFINED_
  120 #define _BSD_CLOCK_T_DEFINED_
  121 typedef _BSD_CLOCK_T_   clock_t;
  122 #endif
  123 
  124 #ifndef _BSD_SIZE_T_DEFINED_
  125 #define _BSD_SIZE_T_DEFINED_
  126 typedef _BSD_SIZE_T_    size_t;
  127 #endif
  128 
  129 #ifndef _BSD_SSIZE_T_DEFINED_
  130 #define _BSD_SSIZE_T_DEFINED_
  131 typedef _BSD_SSIZE_T_   ssize_t;
  132 #endif
  133 
  134 #ifndef _BSD_TIME_T_DEFINED_
  135 #define _BSD_TIME_T_DEFINED_
  136 typedef _BSD_TIME_T_    time_t;
  137 #endif
  138 
  139 #ifndef _POSIX_SOURCE
  140 #define NBBY    8               /* number of bits in a byte */
  141 
  142 /*
  143  * Select uses bit masks of file descriptors in longs.  These macros
  144  * manipulate such bit fields (the filesystem macros use chars).
  145  */
  146 #ifndef FD_SETSIZE
  147 #define FD_SETSIZE      1024
  148 #endif
  149 
  150 typedef int32_t fd_mask;
  151 #define NFDBITS (sizeof(fd_mask) * NBBY)        /* bits per mask */
  152 
  153 #ifndef howmany
  154 #define howmany(x, y)   (((x) + ((y) - 1)) / (y))
  155 #endif
  156 
  157 typedef struct fd_set {
  158         fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  159 } fd_set;
  160 
  161 #define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  162 #define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  163 #define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  164 #define FD_COPY(f, t)   bcopy(f, t, sizeof(*(f)))
  165 #define FD_ZERO(p)      bzero(p, sizeof(*(p)))
  166 
  167 #if defined(__STDC__) && defined(KERNEL)
  168 /*
  169  * Forward structure declarations for function prototypes.  We include the
  170  * common structures that cross subsystem boundaries here; others are mostly
  171  * used in the same place that the structure is defined.
  172  */
  173 struct  proc;
  174 struct  pgrp;
  175 struct  ucred;
  176 struct  rusage;
  177 struct  file;
  178 struct  buf;
  179 struct  tty;
  180 struct  uio;
  181 #endif
  182 
  183 #endif /* !_POSIX_SOURCE */
  184 #endif /* __ASSEMBLER__ */
  185 
  186 struct _pthread_handler_rec
  187 {
  188         void           (*routine)(void *);  /* Routine to call */
  189         void           *arg;                 /* Argument to pass */
  190         struct _pthread_handler_rec *next;
  191 };
  192 
  193 #ifndef __POSIX_LIB__
  194 
  195 #define __PTHREAD_SIZE__           596 
  196 #define __PTHREAD_ATTR_SIZE__      36
  197 #define __PTHREAD_MUTEXATTR_SIZE__ 8
  198 #define __PTHREAD_MUTEX_SIZE__     40
  199 #define __PTHREAD_CONDATTR_SIZE__  4
  200 #define __PTHREAD_COND_SIZE__      24
  201 #define __PTHREAD_ONCE_SIZE__      4
  202 #define __PTHREAD_RWLOCK_SIZE__    124
  203 #define __PTHREAD_RWLOCKATTR_SIZE__ 12
  204 
  205 
  206 typedef struct _opaque_pthread_t { long sig; struct _pthread_handler_rec  *cleanup_stack; char opaque[__PTHREAD_SIZE__];} *pthread_t;
  207 
  208 typedef struct _opaque_pthread_attr_t { long sig; char opaque[__PTHREAD_ATTR_SIZE__]; } pthread_attr_t;
  209 
  210 typedef struct _opaque_pthread_mutexattr_t { long sig; char opaque[__PTHREAD_MUTEXATTR_SIZE__]; } pthread_mutexattr_t;
  211 
  212 typedef struct _opaque_pthread_mutex_t { long sig; char opaque[__PTHREAD_MUTEX_SIZE__]; } pthread_mutex_t;
  213 
  214 typedef struct _opaque_pthread_condattr_t { long sig; char opaque[__PTHREAD_CONDATTR_SIZE__]; } pthread_condattr_t;
  215 
  216 typedef struct _opaque_pthread_cond_t { long sig;  char opaque[__PTHREAD_COND_SIZE__]; } pthread_cond_t;
  217 
  218 typedef struct _opaque_pthread_rwlockattr_t { long sig; char opaque[__PTHREAD_RWLOCKATTR_SIZE__]; } pthread_rwlockattr_t;
  219 
  220 typedef struct _opaque_pthread_rwlock_t { long sig;  char opaque[__PTHREAD_RWLOCK_SIZE__]; } pthread_rwlock_t;
  221 
  222 typedef struct { long sig; char opaque[__PTHREAD_ONCE_SIZE__]; } pthread_once_t;
  223 
  224 #endif /* __POSIX_LIB__ */
  225 
  226 typedef unsigned long pthread_key_t;    /* Opaque 'pointer' */
  227 
  228 #endif /* !_SYS_TYPES_H_ */

Cache object: 234c63c2fc97587f8e1aada5ae3e5a91


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.