mailing list of musl libc
 help / color / mirror / code / Atom feed
From: fedor_qd@mail.ru
To: musl@lists.openwall.com
Subject: RE: missing decription struct named FILE
Date: Fri, 26 Feb 2016 07:54:38 +0300	[thread overview]
Message-ID: <YmmZjlVP8zWG.qZjmZY63@smtp.mail.ru> (raw)



исходное сбщ
Тема: Re: [musl] missing decription struct named FILE
От: Rich Felker <dalias@libc.org>
Дата: 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

- - - ������ ���������������� ���������� ������������������ ���������������� "������������������" �� �������� "��������������" - - -



             reply	other threads:[~2016-02-26  4:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  4:54 fedor_qd [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-02-25 18:37 Fiodar
2016-02-25 18:46 ` Rich Felker
2016-02-25 19:36   ` Re[2]: [musl] " Fiodar
2016-02-25 19:52     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmmZjlVP8zWG.qZjmZY63@smtp.mail.ru \
    --to=fedor_qd@mail.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).