NetBSD Problem Report #154

From gnats  Fri Mar  4 09:43:15 1994
Received: from IBM.rhrz.uni-bonn.de (ibm.rhrz.uni-bonn.de [131.220.224.1]) by sun-lamp.cs.berkeley.edu (8.6.5/8.6.5) with SMTP id JAA13131 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 4 Mar 1994 09:43:02 -0800
Message-Id: <m0pcZuS-001oDNC@oink.rhein.de>
Date: Fri, 4 Mar 94 14:27 MET
From: noses@oink.rhein.de
Reply-To: noses@uran.cs.bonn.edu
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: <unistd.h> access()
X-Send-Pr-Version: 3.2

>Number:         154
>Category:       lib
>Synopsis:       function returns 1 in case of success
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 04 09:50:01 +0000 1994
>Closed-Date:    Mon Mar 07 09:14:16 +0000 1994
>Last-Modified:  Thu Jan 02 18:10:03 +0000 2014
>Originator:     Noses
>Release:        netbsd-current as of today
>Organization:
"	"
>Environment:

System: NetBSD oink 0.9a OINK#55 i386


>Description:

	Function access () in unistd.h doesn't return 0 on success - it's 
	returning 1. This is breaking sliplogin which is expecting 0 to be
	returned. Probably other programs are breaking too.
>How-To-Repeat:

	Run sliplogin. Write a short example using access().
>Fix:

	Change the function in the library or document this un-Posixish
	behaviour and adapt ther rest of the system accordingly.

Achim
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: cgd 
State-Changed-When: Fri Mar 4 14:23:43 PST 1994 
State-Changed-Why:  
seems to work OK to me: 
234 [sun-lamp] tmp % cat foo.c 
#include <unistd.h> 

main() 
{ 
printf("%dn", access("/netbsd", R_OK)); 
printf("%dn", access("/netbsd", W_OK)); 
printf("%dn", access("/netbsd", X_OK)); 
printf("%dn", access("/netbsd", R_OK|W_OK)); 
printf("%dn", access("/netbsd", W_OK|X_OK)); 
printf("%dn", access("/netbsd", R_OK|X_OK)); 
printf("%dn", access("/netbsd", R_OK|X_OK|W_OK)); 
} 
235 [sun-lamp] tmp % cc foo.c 
236 [sun-lamp] tmp % a.out 
0 
-1 
0 
-1 
-1 
0 
-1 
237 [sun-lamp] tmp %  

i'm betting that this is not a bug. waiting for user demonstration. 
State-Changed-From-To: feedback->closed 
State-Changed-By: cgd 
State-Changed-When: Mon Mar 7 01:14:16 PST 1994 
State-Changed-Why:  
the bug report was filed in error, or so says the reporter! 
it was unverifiable, by me and by him. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.