Date: Fri, 26 Feb 2016 07:54:38 +0300 From: fedor_qd@...l.ru To: musl@...ts.openwall.com Subject: RE: missing decription struct named FILE исходное сбщ Тема: Re: [musl] missing decription struct named FILE От: Rich Felker <dalias@...c.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 - - - ������ ���������������� ���������� ������������������ ���������������� "������������������" �� �������� "��������������" - - -
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.