8158 Want named threads API
[unleashed.git] / usr / src / lib / libc / inc / file64.h
blob40504d35ecc2fdeee84d2e620006f52d55c378fb
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * This is the header where the internal to libc definition of the FILE
29 * structure is defined. The exrernal defintion defines the FILE structure
30 * as an array of longs. This prevents customers from writing code that
31 * depends upon the implemnetation of stdio. The __fbufsize(3C) man page
32 * documents a set of routines that customers can use so that they do not
33 * need access to the FILE structure.
35 * When compiling libc this file MUST be included BEFORE <stdio.h>, and
36 * any other headers that themselves directly or indirectly include
37 * <stdio.h>. Failure to do so, will cause the compile of libc to fail,
38 * since the structure members will not be visible to the stdio routines.
41 #ifndef _FILE64_H
42 #define _FILE64_H
44 #pragma ident "%Z%%M% %I% %E% SMI"
46 #include <synch.h>
47 #include <stdio_tag.h>
48 #include <wchar_impl.h>
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
54 #ifndef _MBSTATE_T
55 #define _MBSTATE_T
56 typedef __mbstate_t mbstate_t;
57 #endif
59 #define rmutex_t mutex_t
61 #ifdef _LP64
63 struct __FILE_TAG {
64 unsigned char *_ptr; /* next character from/to here in buffer */
65 unsigned char *_base; /* the buffer */
66 unsigned char *_end; /* the end of the buffer */
67 ssize_t _cnt; /* number of available characters in buffer */
68 int _file; /* UNIX System file descriptor */
69 unsigned int _flag; /* the state of the stream */
70 rmutex_t _lock; /* lock for this structure */
71 mbstate_t _state; /* mbstate_t */
72 char __fill[32]; /* filler to bring size to 128 bytes */
75 #else
78 * Stuff missing from our 32-bit FILE struct.
80 struct xFILEdata {
81 uintptr_t _magic; /* Check: magic number, must be first */
82 unsigned char *_end; /* the end of the buffer */
83 rmutex_t _lock; /* lock for this structure */
84 mbstate_t _state; /* mbstate_t */
85 int _altfd; /* alternate fd if > 255 */
88 #define XFILEINITIALIZER { 0, NULL, RECURSIVEMUTEX, DEFAULTMBSTATE }
90 #endif /* _LP64 */
92 #ifdef __cplusplus
94 #endif
96 #endif /* _FILE64_H */