Skip to main content

Uniface 9: Returning the PID of the current process

  • November 19, 2018
  • 2 replies
  • 0 views

Jan Cees Boogaard

Returning the PID of the current process

Author: a.widdowson@midlandhr.co.uk (awiddowson)

Hi all,

Anyone know of a way for a userver to return it's own process id. We could call out to 3gl which returns the value but I wondered if there was a simpler way???

Thanks,

Wid

 

2 replies

Jan Cees Boogaard

Returning the PID of the current process

Author: a.widdowson@midlandhr.co.uk (awiddowson)

Hi all,

Anyone know of a way for a userver to return it's own process id. We could call out to 3gl which returns the value but I wondered if there was a simpler way???

Thanks,

Wid

 

... but isn't using a 3gl callout an easy way to use functions not directly implmented in uniface?

 

Success, Uli


Author: ulrich-merkel (ulrichmerkel@web.de)

Jan Cees Boogaard

Returning the PID of the current process

Author: a.widdowson@midlandhr.co.uk (awiddowson)

Hi all,

Anyone know of a way for a userver to return it's own process id. We could call out to 3gl which returns the value but I wondered if there was a simpler way???

Thanks,

Wid

 

Hi

No, no native Uniface way to o that, but a 3gl activate will do, and it's easy : just use the getpid() POSIX function (_getpid() on Windows, as Microsoft says, it's not standard ANSI...). You can use the same library to keep low level related things together, and then activate such a signature :

variable
numeric vPid
endvariables

activate "SYSFUNCS".getpid(vPid)
 

 


Author: richard.gill (richard.gill@agfa.com)