From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9395 Path: news.gmane.org!not-for-mail From: fedor_qd@mail.ru Newsgroups: gmane.linux.lib.musl.general Subject: RE: missing decription struct named FILE Date: Fri, 26 Feb 2016 07:54:38 +0300 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456462500 25187 80.91.229.3 (26 Feb 2016 04:55:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Feb 2016 04:55:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9408-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 26 05:54:59 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 1aZAQd-0001Ru-9Z for gllmg-musl@m.gmane.org; Fri, 26 Feb 2016 05:54:59 +0100 Original-Received: (qmail 13724 invoked by uid 550); 26 Feb 2016 04:54:57 -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 13706 invoked from network); 26 Feb 2016 04:54:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:To:Reply-to:From; bh=tWgWs27bjSFhcs1nYnDK3NJHZhMroyTuV9KFDyUFftU=; b=Yjx/2JySJ8AYZ1m+8r4NFyQoKDBHTomoRmqNeFGMQ57eA31i6onSsfr8aUmpPRuaTbz5LNwhQJ6bF1KWiCtDzcbG6BWlVwDIk8C/6VG6Tg7Xhhc5/KQoe3YJUVPmpnTHc5G1Wn/+LeY4quLrrV6V1uBqZ6JH2U6nA96xPqiRymo=; X-Mailer: EPOC Email Version 2.10 Content-Language: i-default X-Mras: Ok Xref: news.gmane.org gmane.linux.lib.musl.general:9395 Archived-At: =D0=B8=D1=81=D1=85=D0=BE=D0=B4=D0=BD=D0=BE=D0=B5 =D1=81=D0=B1=D1=89 =D0=A2=D0=B5=D0=BC=D0=B0: Re: [musl] missing decription struct named = FILE =D0=9E=D1=82: Rich Felker =D0=94=D0=B0=D1=82=D0=B0: 25.02.2016 22.53 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. I understand. > 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. I want replace in my project existing sscanf implementation in builtin = libc by musl variant. I need understand how works FILE struct and use = existing APIs defined in my system libc. 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 - - - =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD = =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD = =EF=BF=BD=EF=BF=BD=EF=BF=BD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