From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9393 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: missing decription struct named FILE Date: Thu, 25 Feb 2016 14:52:56 -0500 Message-ID: <20160225195256.GY9349@brightrain.aerifal.cx> References: <1456425461.468434695@f335.i.mail.ru> <20160225184612.GX9349@brightrain.aerifal.cx> <1456428994.507095195@f336.i.mail.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1456429997 27926 80.91.229.3 (25 Feb 2016 19:53:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2016 19:53:17 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9406-gllmg-musl=m.gmane.org@lists.openwall.com Thu Feb 25 20:53:12 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aZ1yI-0005Dm-RS for gllmg-musl@m.gmane.org; Thu, 25 Feb 2016 20:53:11 +0100 Original-Received: (qmail 23754 invoked by uid 550); 25 Feb 2016 19:53:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 23731 invoked from network); 25 Feb 2016 19:53:08 -0000 Content-Disposition: inline In-Reply-To: <1456428994.507095195@f336.i.mail.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9393 Archived-At: On Thu, Feb 25, 2016 at 10:36:34PM +0300, Fiodar wrote: > I always think that FILE is stable public api and may have specific The public interfaces you can pass FILE* to are a stable public API, but the contents of the pointed-to object, or even whether FILE* is a real pointer or just some other kind of opaque reference is completely unspecified and a matter of implementation internals. > augmentation in various libc implementations/versions. > I use musl libc 1.1.14. I need description all fields and how read, > write an seek operates internally with them. It's not clear what you want to do. If you just want to be able to operate on the underlying file descriptor, you can use fileno() (a standard public function) to get the fd number and use any of the standard functions from unistd.h on it. However mixing use of the stdio functions and direct operations on the fd will cause problems if you don't observe some rules for switching between them. musl also has some lightly abstracted functions for accessing normally hidden parts of the stdio FILE state which were added (somewhat reluctantly) to meed the needs of gnulib. They're declared in stdio_ext.h and defined in src/stdio/ext.c and src/stdio/ext2.c. I would not recommend using them in new programs (they're mainly for legacy compatibility with gnulib) but if the alternative is poking at the FILE structure yourself, they would be a better choice. Rich