[cs631apue] starting functions in GNU Linux mian()

Jan Schaumann jschauma at stevens.edu
Wed Sep 17 09:52:02 EDT 2014


Jin Sun <jsun6 at stevens.edu> wrote:
> https://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodbye-world.pdf

Thanks for posting this link - it's a good explanation of what happens
in the GNU coreutils.

When reading through this, ask yourself why there is no error message
when writing to a full filesystem, but there is an error message when
writing to a non-existant file:

./a.out >/nowhere

This may help you understand the problem that the 'atexit(close_stdout)'
call is trying to solve.  (We will discuss atexit(3) in a future class.)

Most of the other function calls have to do with internationalization
and language settings, to ensure that error or diagnostic messages the
program generates are printed in the correct locale.  This is something
we will not cover in this class; however, if you're interested, always
begin your investigation by looking at the manual pages of the functions
you noted:  bindtextdomain(3), textdomain(3), setlocale(3)

-Jan


More information about the cs631apue mailing list