What is comp_t format?

What is comp_t format?

Post by Warren A Ri » Thu, 10 Sep 1998 04:00:00



I'm writing a program to read accounting records, and in acct(4) I see
that the fields that contain the CPU utilization figures are in
"comp_t" format, for which there is a typedef above that simply says
"13-bit fraction, 3-bit exponent".  Is there any more info available
(and maybe some examples) about this anywhere?

Warren Ring
Columbus, Ohio

 
 
 

What is comp_t format?

Post by Casper H.S. Dik - Network Security Engine » Thu, 10 Sep 1998 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


Quote:>I'm writing a program to read accounting records, and in acct(4) I see
>that the fields that contain the CPU utilization figures are in
>"comp_t" format, for which there is a typedef above that simply says
>"13-bit fraction, 3-bit exponent".  Is there any more info available
>(and maybe some examples) about this anywhere?

        fraction = comp & 0x1fff;
        exponent = comp >> 13;

        value = fraction << (exponent * 3);

The exponent is base 8.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. formatting a floppy. what am I doing wrong?


: I want to format a floppy disk to have a unix filesystem on it.
: I've tried fdformat with no options, but the disk I get cannot be
: mounted with volcheck, whereas MSDOS disks formatted on a pc are mounted
: allright by the vold daemon.

You need to create file system using the command

    newfs /vol/dev/aliases/floppy0

regards,
Alex

2. RH 5.2 and netatalk troubles

3. Am I using format wrong?

4. Anyone has an input filter for Cannon BJC 4200 ?

5. HELP: Can't read comp_t filds in acct.h

6. Bakcspace key

7. acct.h: comp_t -> float conversion?

8. FreeBSD-4.1.1 running KDE2

9. Converting between comp_t and float/double on SunOS

10. comp_t

11. This clone thing...am I stupid, or am I right?