Is there any function from which we can only read? Open in read_only mode?
Not sure what function "last" command uses but it opens wtmpx in read mode ,
some thing similar for utmpx? 

open("/var/adm/wtmpx", O_RDONLY)                = 3 

-----Original Message-----
From: Dan Mick [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2008 7:21 PM
To: Kuruganti, Lakshmi
Cc: opensolaris-code@opensolaris.org
Subject: Re: [osol-code] utmpx corruption

Lakshmi wrote:
> All, Not sure if this is the right group to post this question, but any
help is highly appreciated , we are having an issue of utmpx getting
corrupted and loosing "boot time" information, uptime will not return system
up time.
> 
> After lot of investigation , we figured out that apart from system binaries
which are updating utmpx file at the time of corruption , there is a program
(customized to our environment ) is running which is supposed to be reading
only from utmpx file , we verified the source code and the C library  this
program is using is "getutxent()" but this file is opening utmpx as
Read,write and create mode? is this normal? we suspect that while the file is
open in this mode how are writes to utmpx file by other binaries handled? we
are not sure but are trying to figure out how exactly this file is getting
corrupted..
> 
>  open("/var/adm/utmpx", O_RDWR|O_CREAT, 0644)    = 8
>  open("/var/adm/utmpx", O_RDWR)                  = 9

Here's the functino from libc:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/g
en/getutx.c#getutxent_frec

so, yes, it's intentional, for better or worse.

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to