get process id
Brian K. White
brian at aljex.com
Sun Oct 10 13:37:54 PDT 2004
Fairlight wrote:
> On Sun, Oct 10, 2004 at 11:04:15AM -0400, Kenneth Brody, the
> prominent pundit, witicized:
>> Scott Nelson wrote:
>>>
>>> Having a brain clog here.
>>>
>>> SCO OpenServer 5.06, fP 5
>>>
>>> I need to get the process id of a filepro program and use it in a
>>> variable while in the program. I know this has been discussed in
>>> the past, but there is a memory leak here....
>>
>> Must it really be the PID of the filePro program, or just a unique
>> number? (ie: would the PID of a child process called via USER be
>> sufficient?)
>
> Keeping in mind that the PID itself is not unique unless bound to a
> date
> and time, since PID-space recycles at around 32000-ish on most 32bit
> operating systems, and even some 64bit ones (Solaris 7 and 8 come to
> mind).
>From /usr/include/sys/param.h, same on at least 5.0.5-5.0.7:
#define MAXPID 30000 /* max process id */
Lots of other enlightening hard limits in there too.
But then again, it is garunteed to always be unique at any given moment.
If you are trying to protect against another instance of your program
clobbering your instances tmp files, pid works as long as you first remove
or zero-out the filenames you intend to use, to account for the fact that
some previous instance might have had the same pid and failed to clean up
after itself. But you wouldn't have to worry about any other instance having
the same pid at the same time.
btw: anyone who has discovered how handy Midnight Commander is on linux, and
has discovered how annoying the old version from skunkware is that's all
that's available for sco, I've just built mc-4.6.1pre1 and it's up as a
simple tar.bz2 at www.aljex.com/bkw/sco/#mc
You almost certainly need gwxlbs but you almost need that anyways given the
number of other things it provides.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list