pid_t or Q_PID?

Oswald Buddenhagen ossi at kde.org
Fri Jun 15 11:11:22 BST 2007


On Fri, Jun 15, 2007 at 12:17:37AM +0200, David Faure wrote:
> On Thursday 14 June 2007, Simon Hausmann wrote:
> > Yes, so what's the point of exposing the pid? Code that uses it is
> > problematic (as you point out) and it's inherently unportable.
> > That's why I don't like it in high-level API.
> 
> I believe it's used for startup notification purposes.
> 
that's just one system-specific use; others are conceivable. there is no
point in "defining them away" - even if tt always tries to convince me
otherwise when similar issues come up. ;)
and then there is the user (no, not the programmer). to him, the pid is
the only useful identfication of the process.

i'd apply the attached patch asap. it shadows a very similar existing
function, so i expect to introduce no "retro-trap" by commiting it right
away.
QProcess::startDetached() uses qint64 for the pid, but i think this is
overkill, no? dw means dword which should always fit into int. on unix,
the pid always fits into an int, too.
fwiw, this is another case where i definitely would prefer an inline
function - there is just no point in not inlining it.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kproc-pid.diff
Type: text/x-diff
Size: 969 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070615/b05b12fe/attachment.diff>


More information about the kde-core-devel mailing list