[Home]

Summary:ASTERISK-22557: [patch] Use waitpid instead of wait4 when we don't need to read from rusage
Reporter:YvesGael (hurdman)Labels:
Date Opened:2013-09-19 04:25:22Date Closed:2013-11-08 08:58:53.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Applications/app_dahdiras Applications/General Utilities/General
Versions:SVN 1.8.23.1 11.5.1 Frequency of
Occurrence
Related
Issues:
Environment:test into gnu/linuxAttachments:( 0) asterisk-11.5.1-wait4.patch
( 1) asterisk-11.5.1-wait4.patch
Description:Into some src, you use wait4 but you never read or use rusage, into others src, you use waitpid.
It could be great to use waitpid into all src.

i join a patch tested into linux.
Comments:By: Rusty Newton (rnewton) 2013-09-26 17:30:51.187-0500

Hi! I'm having a hard time understanding the description, due to language.

Regardless, I'll have a developer take a look at the patch you have posted.

Please read through: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines#AsteriskIssueGuidelines-DigiumSubmissionLicenseAgreement

You need to [sign the license agreement|https://issues.asterisk.org/jira/secure/DigiumLicense.jspa] and re-attach the patch.

Thanks!

By: ygcheny (ygcheny) 2013-09-27 00:18:52.654-0500

I already signed your license and uploaded my patch.
If you look at the difference between a waitpid and wait4, you will understand my point.
It is not a question of stability and/or bug fixes.
There is just no point in using a wait4 if you do not read the struct return (rusage).
Especially as wait4 is not present in all platform lib C.

best regards.

By: YvesGael (hurdman) 2013-09-27 01:19:10.146-0500

for info :
wait4 is not defined in SUSv2 and SUSv3.
wait3 and wait4 are not defined in IEEE 1003.1 1996-07-12 (POSIX.1).
SUSv2 said "New applications should use waitpid()."

best regards,

By: Rusty Newton (rnewton) 2013-10-18 15:47:04.211-0500

Please remove and re-attach the patch. It does not display on the issue. It appears you attached it while your license was still pending, so it won't show up.

Hit "Send Back" or "Enter Feedback" when you have done this. Thanks!

By: Walter Doekes (wdoekes) 2013-10-28 07:40:27.587-0500

{noformat}
$ man wait4 | grep -i obsolete
      These functions are obsolete; use waitpid(2) or waitid(2) in new programs.
{noformat}

And, if we ever wanted {{rusage}} in the future:
http://git.kernel.org/cgit/docs/man-pages/man-pages.git/commit/?id=d8b13fb4d939978f02db3d49697cbccff2881a30

I say "Ship it". On trunk.

By: Matt Jordan (mjordan) 2013-10-28 07:49:17.370-0500

I agree with Walter, this feels like a trunk only change.