Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-05-29 07:31:53 +00:00
Code Issues Projects Releases Wiki Activity
musl/src/stdio/ofl_add.c

12 lines
172 B
C
Raw Normal View History

refactor stdio open file list handling, move it out of global libc struct functions which open in-memory FILE stream variants all shared a tail with __fdopen, adding the FILE structure to stdio's open file list. replacing this common tail with a function call reduces code size and duplication of logic. the list is also partially encapsulated now. function signatures were chosen to facilitate tail call optimization and reduce the need for additional accessor functions. with these changes, static linked programs that do not use stdio no longer have an open file list at all.
2015-06-16 07:11:19 +00:00
#include "stdio_impl.h"
FILE *__ofl_add(FILE *f)
{
FILE **head = __ofl_lock();
f->next = *head;
if (*head) (*head)->prev = f;
*head = f;
__ofl_unlock();
return f;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 85ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API