Kuruganti, Lakshmi writes:
> 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
No ... but I'd expect that the likely cause of such a thing is a
write() in the application using a stale (and since reused) file
descriptor. This should be fairly easy to trap using dtrace or a
debugger.
(If you're not actually on OpenSolaris and you don't have dtrace and
for some reason don't want to use an OpenSolaris system for debug, one
possibility [besides a debugger] would be to make a library that
interposes on open() and write() and checks for any write to wtmpx.)
--
James Carlson, Solaris Networking <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code