Re: EDQUOT lurks in most apps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* John Reiser:

> The C runtime library (package glibc) implementation of exit()
> could help by calling close_range() of low-numbered output
> [not input!] file descriptors, especially stdout, and checking
> for errors.

ENOSPC also has this problem.

We would have to fsync (after the implicit fflush), to make sure that
storage actually gets allocated, and that does not meet performance
expectations of users.  The kernel does not offer a mechanism that
detects ENOSPC errors, but does not force the contents to disk.  Closing
a file descriptor is an approximation for some cases because it triggers
non-flushing allocation, but it's tricky to use because it has
unintended side effects for old-style POSIX file locks.

There is some code in gnulib that closes the standard descriptors, but
this is the wrong thing to do from the application side because it can
lead to use-after-free problems.  Applications should just call fflush
and fsync.

Thanks,
Florian

-- 
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux