tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: db(3) removal and lastlogx

On Thu, Jun 07, 2012 at 08:36:36AM +0200, Joerg Sonnenberger wrote:
> (1) Just use a sparse file. This requires by far the least amount of
> code, just some verification logic for a file header and writing to "uid
> * size of entry". Writes should be short enough to ensure atomic writes
> even on NFS. Same for reads. No manual locking needed.

After some thinking, I will go with this route. File format will look

magic number
record size
64KB of used bytes, set if any uid / 64K is present.

64K blocks of:
64KB of used bytes, set if uid / 64K matches the block number and uid %
64K is present.

64K records of given size

Each record gets has a version number at the beginning.

lastlogx2 or however to call it gets created at boot, so that the next
time the format changes, statically linked programs can just continue to
write the old format, they might just not be able to read entries.


Home | Main Index | Thread Index | Old Index