9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Skip Tavakkolian <skip.tavakkolian@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] atexit() & atexitdont()
Date: Thu,  6 Nov 2014 13:44:30 -0800	[thread overview]
Message-ID: <CAJSxfmKik1eRPMWygD+9ZNk-23Wr0VOHjxp9Nj94nRkJKOpCPg@mail.gmail.com> (raw)
In-Reply-To: <CAJSxfm+7LvauADA+5uCG3AhM3vWdkrOBKZFtL7CCVcda7ShFZA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

i'm wondering if "print" is the right instrument for knowing the order is
right.

On Thu, Nov 6, 2014 at 1:42 PM, Skip Tavakkolian <skip.tavakkolian@gmail.com
> wrote:

> according to the man page:
>
> "Before calling _exits with msg as an argument, exits calls in reverse
> order all the functions recorded by atexit."
>
> so i think your result should be f2, f1, f1.
>
>
> On Thu, Nov 6, 2014 at 1:26 PM, erik quanstrom <quanstro@quanstro.net>
> wrote:
>
>> On Thu Nov  6 16:07:56 EST 2014, lego12239@yandex.ru wrote:
>> >   Hi, all.
>> >
>> > I looked at atexit() and atexitdont() and i don't understand why these
>> > functions are implemented with a static array instead of singly linked
>> list?
>> > May be somebody with a greater plan9 experience can help me with my
>> question.
>>
>> perhaps a linked list would make sense, but atexits(2) doesn't say which
>> order
>> the functions will be run in.  and it doesn't seem like a great idea to
>> depend on
>> atexits running things in a particular order.
>>
>> - erik
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 1913 bytes --]

  reply	other threads:[~2014-11-06 21:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 21:05 Oleg
2014-11-06 21:26 ` erik quanstrom
2014-11-06 21:42   ` Skip Tavakkolian
2014-11-06 21:44     ` Skip Tavakkolian [this message]
2014-11-06 22:50       ` lego12239
2014-11-06 22:45   ` Oleg
2014-11-07  7:17   ` k0ga
2014-11-07  8:02     ` Oleg
2014-11-07  8:19 ` Charles Forsyth
2014-11-07  9:44   ` Oleg
2014-11-07 10:22     ` Charles Forsyth
2014-11-07 11:05       ` Oleg
2014-11-07 10:57     ` Steffen Nurpmeso
2014-11-07 11:49       ` Charles Forsyth
2014-11-07 12:19         ` Oleg
2014-11-07 12:27           ` Charles Forsyth
2014-11-07 19:53             ` erik quanstrom
2014-11-07 20:30               ` Oleg
2014-11-07 19:25         ` Steffen Nurpmeso
2014-11-07 17:45 sl

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=CAJSxfmKik1eRPMWygD+9ZNk-23Wr0VOHjxp9Nj94nRkJKOpCPg@mail.gmail.com \
    --to=skip.tavakkolian@gmail.com \
    --cc=9fans@9fans.net \
    /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.
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).