diff options
Diffstat (limited to 'usr/src/lib/libc/inc/file64.h')
-rw-r--r-- | usr/src/lib/libc/inc/file64.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/usr/src/lib/libc/inc/file64.h b/usr/src/lib/libc/inc/file64.h new file mode 100644 index 0000000000..fd71c1c5df --- /dev/null +++ b/usr/src/lib/libc/inc/file64.h @@ -0,0 +1,95 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 1997-2003 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * This is the header where the internal to libc definition of the FILE + * structure is defined. The exrernal defintion defines the FILE structure + * as an array of longs. This prevents customers from writing code that + * depends upon the implemnetation of stdio. The __fbufsize(3C) man page + * documents a set of routines that customers can use so that they do not + * need access to the FILE structure. + * + * When compiling libc this file MUST be included BEFORE <stdio.h>, and + * any other headers that themselves directly or indirectly include + * <stdio.h>. Failure to do so, will cause the compile of libc to fail, + * since the structure members will not be visible to the stdio routines. + */ + +#ifndef _FILE64_H +#define _FILE64_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <synch.h> +#include <stdio_tag.h> +#include <wchar_impl.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _MBSTATE_T +#define _MBSTATE_T +typedef __mbstate_t mbstate_t; +#endif + +#define rmutex_t mutex_t + +#ifdef _LP64 + +struct __FILE_TAG { + unsigned char *_ptr; /* next character from/to here in buffer */ + unsigned char *_base; /* the buffer */ + unsigned char *_end; /* the end of the buffer */ + ssize_t _cnt; /* number of available characters in buffer */ + int _file; /* UNIX System file descriptor */ + unsigned int _flag; /* the state of the stream */ + rmutex_t _lock; /* lock for this structure */ + mbstate_t _state; /* mbstate_t */ + char __fill[32]; /* filler to bring size to 128 bytes */ +}; + +#else + +/* + * Stuff missing from our 32-bit FILE struct. + */ +struct xFILEdata { + uintptr_t _magic; /* Check: magic number, must be first */ + unsigned char *_end; /* the end of the buffer */ + rmutex_t _lock; /* lock for this structure */ + mbstate_t _state; /* mbstate_t */ +}; + +#define XFILEINITIALIZER { 0, NULL, RECURSIVEMUTEX, DEFAULTMBSTATE } + +#endif /* _LP64 */ + +#ifdef __cplusplus +} +#endif + +#endif /* _FILE64_H */ |