home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4317 comp.unix.misc:3237
- Path: sparky!uunet!sybus.sybus.com!myrddin!tscs!bailey
- From: bill@bailey.UUCP (Bill Glidden 882-8369)
- Subject: Re: Process & Signal Question
- Newsgroups: comp.unix.programmer,comp.unix.misc
- Date: 15 Aug 92 05:39:24 GMT
- Distribution: world
- Message-ID: <1759227@bailey.UUCP>
- Organization: Ben Bailey's Home..Tampa Fl.
- Sender: news@bailey.UUCP (GNEWS Version 2.0 news poster.)
- Lines: 18
-
- bill@bailey.UUCP (Bill Glidden 882-8369) writes:
- > herberj@prism.CS.ORST.EDU (John Wesley Herberg) writes:
- > >
- > > 1 - Is there an effecient way for one process to know if another is running
- > > when the only thing you know about it is its name. The way I'm doing it now
- > > is grabbing info for all the processes by using pstat(an HP-UX call) &
- > > searching through that info for a matching process name. Is there some type
- > > of call I could do on the executable to see if it is in use. I noticed
- > > make doesn't allow you to update a file when its being used - how does it know?
- > >
- > Make knows the executable is in use because when you fopen or open a file for
- > create and it is in use, the operating system returns an error condition to
- > the calling program. Of course, I don't recommend this for your situation.
- >
- You could also try opening the executable file in exclusive mode. However,
- that may not be 100% reliable. For instance, someone may be compiling
- the program and your program would not be able to open the file exclusively,
- even if no one is currently executing it.
-