NetBSD Problem Report #39796

From kre@munnari.OZ.AU  Fri Oct 24 14:54:33 2008
Return-Path: <kre@munnari.OZ.AU>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 010BD63B966
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 24 Oct 2008 14:54:32 +0000 (UTC)
Message-Id: <200810241454.m9OEsNjx023880@jade.coe.psu.ac.th>
Date: Fri, 24 Oct 2008 21:54:23 +0700 (ICT)
From: kre@munnari.OZ.AU
To: gnats-bugs@gnats.NetBSD.org
Subject: sigpending(2) lies about error returns
X-Send-Pr-Version: 3.95

>Number:         39796
>Category:       kern
>Synopsis:       sigpending(2) lies about error returns
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 24 14:55:00 +0000 2008
>Closed-Date:    Fri Oct 24 15:15:38 +0000 2008
>Last-Modified:  Fri Oct 24 15:15:38 +0000 2008
>Originator:     Robert Elz
>Release:        NetBSD 4.0_STABLE (NetBSD current of today)
>Organization:
	Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 4.0_STABLE NetBSD 4.0_STABLE (JADE-1.696-20080517) #9: Fri May 23 18:55:13 ICT 2008 kre@jade.coe.psu.ac.th:/usr/obj/4/kernels/JADE i386
Architecture: i386
Machine: i386
>Description:
	sigpending(2) claims ...

ERRORS
     The sigpending function does not currently detect any errors.

	That's not correct.

>How-To-Repeat:
	See the following test code (ignore the warning about
	the declaration of exit, I forgot to include stdlib.h
	so sue me ...)

NetBSD-current# cat t.c
#include <signal.h>
#include <stdio.h>

main()
{
        int n;

        n = sigpending((sigset_t *)7);

        if (n != 0)
                perror("sigpending");

        printf("sigpending() returned %d\n", n);

        exit(0);
}
NetBSD-current# cc -o t t.c
t.c: In function 'main':
t.c:15: warning: incompatible implicit declaration of built-in function 'exit'
NetBSD-current# ./t
sigpending: Bad address
sigpending() returned -1
NetBSD-current# 

>Fix:
	Probably best is to change the sentence to say thyat sigpending
	returns no specific errors (aside from the general ones).

	Alternatively, if you like clutter, you could list EFAULT
	specifically, and then make sure that there are none of the
	other "occurs almost anywhere" errors that are possible.

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39796 CVS commit: src/lib/libc/sys
Date: Fri, 24 Oct 2008 15:14:48 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Fri Oct 24 15:14:48 UTC 2008

 Modified Files:
 	src/lib/libc/sys: sigpending.2

 Log Message:
 PR/39796: Robert Elz: Document that sigpending can return EFAULT since it calls
 copyout.


 To generate a diff of this commit:
 cvs rdiff -r1.13 -r1.14 src/lib/libc/sys/sigpending.2

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: christos@NetBSD.org
State-Changed-When: Fri, 24 Oct 2008 11:15:38 -0400
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.