From owner-freebsd-standards@FreeBSD.ORG Sat Aug 4 05:10:06 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99EFA106566C for ; Sat, 4 Aug 2012 05:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 65E2F8FC12 for ; Sat, 4 Aug 2012 05:10:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q745A68U027359 for ; Sat, 4 Aug 2012 05:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q745A6dI027358; Sat, 4 Aug 2012 05:10:06 GMT (envelope-from gnats) Date: Sat, 4 Aug 2012 05:10:06 GMT Message-Id: <201208040510.q745A6dI027358@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: "Jukka A. Ukkonen" Cc: Subject: Re: standards/170346: Changes to support waitid() and related stuff X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Jukka A. Ukkonen" List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2012 05:10:06 -0000 The following reply was made to PR standards/170346; it has been noted by GNATS. From: "Jukka A. Ukkonen" To: bug-followup@FreeBSD.org, jau@iki.fi Cc: Subject: Re: standards/170346: Changes to support waitid() and related stuff Date: Sat, 04 Aug 2012 07:51:29 +0300 This is a multi-part message in MIME format. --------------080906020500020008010404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Oops! Sorry! It seems I forgot the actual waitid() function from the patch. Here is the missing part. --jau --------------080906020500020008010404 Content-Type: text/plain; charset=UTF-8; name="waitid-wait6.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="waitid-wait6.patch" --- /dev/null 2012-08-04 07:33:00.000000000 +0300 +++ lib/libc/gen/waitid.c 2012-07-30 12:43:59.000000000 +0300 @@ -0,0 +1,57 @@ + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +int +__waitid (idtype, id, info, flags) + idtype_t idtype; + id_t id; + siginfo_t *info; + int flags; +{ + int status; + pid_t ret; + + /* + * NOTICE! + * The traditional PID/PGID == 0 to wait for + * any process in the caller's own process group + * still works when the idtype is set to either + * P_PID or P_PGID. + */ + + if (info) { + memset (info, '\0', sizeof (*info)); + } + + /* + * In case you wish to start waiting for any + * processes + * - running in a certain jail (zone), + * - running on a certain cpu, or + * - nailed to a certain CPU set, + * - etc. + * you will have to extend the kern_wait6() in + * the kernel to support such idtype_t flavours. + */ + + ret = _wait6 (idtype, id, &status, flags, NULL, info); + + if (ret < 0) { + ret = -1; + } + else { + ret = 0; + } + + return ((int) ret); +} + +__weak_reference(__waitid, waitid); +__weak_reference(__waitid, _waitid); --------------080906020500020008010404--