/* a sample program that use acct()*/
#include <stdlib.h>
#include <sys/acct.h>
#include <stdio.h>

int main() {
    int i;
    
    if((getuid()) ==0 ) {
        i = acct("./junk_acctfile");  /* must be superuser */
        if(i==0)
            printf("ok\n");
        else
            perror("acct() failed");
    }
    else
        printf("Not superuser.\n");
}
