How do I unset TXTBSY on a daemon's binary?

A.V.Raman A.Raman at massey.ac.nz
Fri May 10 14:23:00 AEST 1991


Hi all,

I've got two questions regarding a daemon I'm writing.

1. What is the accepted procedure to unset the TXTBSY flag on the binary
   after the daemon backgrounds itself?
2. How do I find out if a particular user is logged on from within a C
   program.

I need to do (1) because I want to be able to make changes to the code
and compile and reinstall it,  but the changes are not so important that
the currently running daemon needs to be killed and restarted.  Currently
when I try to install a new version when the old daemon is running, I
get the error message: Text file busy.

I need to do (2) because I want to find out whether I must write a 
user or mail him regarding some status change he required.  I tried doing
a man -k on "user", "wtmp", "logg" etc., but none gives me any info about
a C library function / System call that tells me whether a particular user
is logged on.

Thanks in advance.

- &



More information about the Comp.unix.questions mailing list