Pid first free number
Using ttstpshell you can list processes with ps comand.
If you open a session this new process appear with it`s pid.
The question is:
Can I know which is my first free pid number?
Alternative which is the higher pid number used?
Any predefined varaible?
NOTE: I do not want to use bshcmd6.x for this purpose.
Thank's in advance.
I assume you want to use this in a program script. The predefined variable 'pid' contains the pid of the current process. If you will check the pid right in the before.program (for instance) of your script, you can be pretty sure that pid + 1 gives you the 'first free pid'...
May I ask what the purpose of your requirement is? I assume it has to do with starting a new subprocess...? There may be different (neater) ways to accomplish your requirements... So please specify...
What I want to know is if the user has started new sessions in a defined interval. This sessions can be closed at the time I want to know the first free pid.
The purpose is to check user activity.
It will be a background session running at certain intervals and check if the users has started new sessions. This sessions could be closed in this cut or opened; I only want to Know if pids are getting higher.
I have tried this:
Global variable with value max.pid starting with this process pid.
Each 15 seconds, use get.var(max.pid + counter,"prog.name$",str.prog.name)
and counter descending till get.var returns 1.
It is not a start of the art method, but I do not find any better.
You can use the pstat() function. It will show you all the current running processes with their PIDs, names and more...
I hope it helps,
Sorry for my ignorance.
This function it is not in standard BaaN programers manual.
But yes it is in BaaNBoard.
Let us look more BaaNBoard.
|All times are GMT +2. The time now is 15:54.|
©2001-2017 - Baanboard.com - Baanforums.com