Changing the line 'foo = times(NULL)' into the following fixed the core dump:
struct tms t;
foo = times(&t);
Then the program runs successfully for 100 times.
By the way, the times() interface is marked as "obsoleted by getrusage(2) and gettimeofday(2)" in the OpenBSD man pages. Anyway, it is also marked as conforming to POSIX in the same man page.
From: "Alan Robertson" <[EMAIL PROTECTED]>
To: "Linux-HA Development List" <[email protected]>,"Matt Soffen" <[EMAIL PROTECTED]>,"David Lee" <[EMAIL PROTECTED]>
Date: Sat, 19 Aug 2006 03:42:15 +0800 (CST)
Subject: [Linux-ha-dev] times(NULL) test -- please try this and let me know the results
> Hi,
>
> I know what Linux does with the attached code, but for the *BSDs and
> also for Solaris and other plaforms, could someone try this C code out
> on each platform and let me know what the results are?
>
> If you have to change it to compile, BY ALL MEANS send me those changes.
>
> Thanks!
> --
> Alan Robertson <[EMAIL PROTECTED]>
>
> "Openness is the foundation and preservative of friendship... Let me
> claim from you at all times your undisguised opinions." - William
> Wilberforce
>
网 易 邮 箱 带 你 率 先 跨 入 3G 时 代 !
3G 海 量 邮 箱 ,20 兆 超 大 附 件 ;网 络 记 事 本 + RSS + 大 容 量 网 盘 ,一 样 也 不 少
_______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
