From owner-freebsd-standards@FreeBSD.ORG Fri Jan 5 11:10:10 2007 Return-Path: X-Original-To: freebsd-standards@hub.freebsd.org Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E05F16A47C for ; Fri, 5 Jan 2007 11:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1760213C457 for ; Fri, 5 Jan 2007 11:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l05BA9dp072559 for ; Fri, 5 Jan 2007 11:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l05BA9B9072558; Fri, 5 Jan 2007 11:10:09 GMT (envelope-from gnats) Resent-Date: Fri, 5 Jan 2007 11:10:09 GMT Resent-Message-Id: <200701051110.l05BA9B9072558@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jukka Ukkonen Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C201D16A403 for ; Fri, 5 Jan 2007 11:08:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id B111613C448 for ; Fri, 5 Jan 2007 11:08:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l05B8ZfF008052 for ; Fri, 5 Jan 2007 11:08:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l05B8Zl8008051; Fri, 5 Jan 2007 11:08:35 GMT (envelope-from nobody) Message-Id: <200701051108.l05B8Zl8008051@www.freebsd.org> Date: Fri, 5 Jan 2007 11:08:35 GMT From: Jukka Ukkonen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: standards/107561: Missing SUS function tcgetsid() X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 11:10:10 -0000 >Number: 107561 >Category: standards >Synopsis: Missing SUS function tcgetsid() >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jan 05 11:10:09 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Jukka Ukkonen >Release: FreeBSD 6.2-PRERELEASE >Organization: private individual, not representing any organization >Environment: FreeBSD mjolnir 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #1: Fri Jan 5 09:43:02 EET 2007 root@mjolnir:/usr/obj/usr/src/sys/Mjolnir i386 >Description: The SUS function tcgetsid() seems to be missing in FreeBSD. This is SUS compatibility only. This was not strictly required by POSIX at the time it was implemented for SUS, but since SUS clearly is a major driver in the POSIX activities, tcgetsid() might be an obvious future extension to POSIX anyhow. And furthermore there is no sane reason for sticking to POSIX only, if the extension needed to become better compatible with other major specifications happens to be this easy. >How-To-Repeat: No actual problem. The function tcgetsid() is a convenience function and it can always be replaced by ... getsid (tcgetpgrp (fd)) >Fix: #include #include #include #include pid_t tcgetsid (fd) int fd; { int pgrp; if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) return ((pid_t) -1); return (getsid((pid_t) pgrp)); } >Release-Note: >Audit-Trail: >Unformatted: