epoc32/include/libc/sys/types.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 
    20 /**
    21  @file
    22  @publishedAll
    23  @released
    24 */
    25 
    26 #ifndef _SYS_TYPES_H
    27 #define _SYS_TYPES_H
    28 
    29 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    30 #include <sys/types1.h>
    31 #endif
    32 
    33 # include <stddef.h>	
    34 # include <machine/types.h>
    35 
    36 # ifndef	_POSIX_SOURCE
    37 #  define	physadr		physadr_t
    38 #  define	quad		quad_t
    39 
    40 typedef	unsigned char	u_char;
    41 typedef	unsigned short	u_short;
    42 typedef	unsigned int	u_int;
    43 typedef	unsigned long	u_long;
    44 typedef	unsigned short	ushort;		/* System V compatibility */
    45 typedef	unsigned int	uint;		/* System V compatibility */
    46 # endif	/*!_POSIX_SOURCE */
    47 
    48 #ifndef __time_t_defined
    49 typedef _TIME_T_ time_t;
    50 #define __time_t_defined
    51 #endif
    52 
    53 typedef	long	daddr_t;
    54 typedef	char *	caddr_t;
    55 
    56 #ifdef __go32_types__
    57 typedef	unsigned long	ino_t;
    58 #else
    59 #ifdef __sparc__
    60 typedef	unsigned long	ino_t;
    61 #else
    62 typedef	unsigned short	ino_t;
    63 #endif
    64 #endif
    65 
    66 typedef	short	dev_t;
    67 
    68 typedef	long	off_t;
    69 
    70 typedef	unsigned short	uid_t;
    71 typedef	unsigned short	gid_t;
    72 typedef int pid_t;
    73 typedef	long	key_t;
    74 typedef int mode_t;
    75 
    76 typedef unsigned int nlink_t;
    77 
    78 # ifndef	_POSIX_SOURCE
    79 #  define	NBBY	8		/* number of bits in a byte */
    80 /**
    81 Select uses bit masks of file descriptors in longs.
    82 These macros manipulate such bit fields (the filesystem macros use chars).
    83 FD_SETSIZE may be defined by the user, but the default here
    84 should be >= NOFILE (param.h).
    85 */
    86 #  ifndef	FD_SETSIZE
    87 #	define	FD_SETSIZE	60
    88 #  endif
    89 typedef	long	fd_mask;
    90 
    91 #  define	NFDBITS	(sizeof (fd_mask) * NBBY)	/* bits per mask */
    92 #  ifndef	howmany
    93 
    94 #	define	howmany(x,y)	(((x)+((y)-1))/(y))
    95 #  endif
    96 
    97 typedef	struct fd_set {
    98 	fd_mask	fds_bits[howmany(FD_SETSIZE, NFDBITS)];
    99 } fd_set;
   100 
   101 # endif	/* _POSIX_SOURCE */
   102 #undef __go32_types__
   103 #endif	/* _SYS_TYPES_H */