Bug#1497: acct-alpha-5-7 problems
Ian Jackson writes:
>> Please see acct(2). There is not a lot we can do about it as the acct()
>> functions returns either 0 or -1. You get -1 for missing accounting
>> support in the kernel, but also when accounting is already turned
>> on. All I could do is to change the wording of the message to Process
>> accounting not available or already running. but this could irritate
>> new users considerably.
Ian> How about using the value of errno ? acct(1) already seems to be
There is no acct(1) AFAIK, only accton(8).
Ian> able to do this, but you get the standard strerror value for ENOSYS,
Ian> "function not implemented", rather than "this kernel doesn't have
Ian> accounting support compiled into it".
Using 'errno' is a good idea, but it doesn't help either.
I changed 'accton.c' so that it calls 'exit(errno)'. It appears that the
errno is set to '2' in both cases, ie when acct(2) reports 'device or
resource busy' (ie accounting is already running) or a 'function not
implemented' (ie kernel not patched).