Subject: port-sparc64/20283: mkfifo() lossage on sparc64
To: None <gnats-bugs@gnats.netbsd.org>
From: None <grant@netbsd.org>
List: netbsd-bugs
Date: 02/11/2003 02:44:03
>Number:         20283
>Category:       port-sparc64
>Synopsis:       mkfifo() lossage on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 10 07:45:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6N
>Organization:
>Environment:
System: NetBSD u10 1.6N NetBSD 1.6N (U10) #0: Mon Feb 10 19:10:41 EST 2003 grant@u10:/work/src/sys/arch/sparc64/compile/U10 sparc64
Architecture: sparc64
Machine: sparc64
>Description:
During the configure of shells/zsh, the following is used to test for
working named FIFOs:

#include "confdefs.h"

#include <fcntl.h>
#include <signal.h>
main()
{
	char c;
	int fd;
	int pid, ret;
	unlink("/tmp/fifo$$");
	#ifdef HAVE_MKFIFO
	if(mkfifo("/tmp/fifo$$", 0600) < 0)
	#else
	if(mknod("/tmp/fifo$$", 0010600, 0) < 0)
	#endif
		exit(1);
	pid = fork();
	if(pid < 0)
		exit(1);
	if(pid) {
		fd = open("/tmp/fifo$$", O_RDONLY);
		exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
	}
	fd = open("/tmp/fifo$$", O_WRONLY);
	ret = (fd < 0 || write(fd, "x", 1) < 1);
	unlink("/tmp/fifo$$");
	exit(ret);
}

if mkfifo() is used, the following results:

# ps alx | grep conftest
  0 19465  8200   0   2  0   24   608 fifo     S    p2 0:00.01 ./conftest
  0 19466 19465   1 -22  0    0     0 -        ZW   p2 0:00.00 (conftest)

>How-To-Repeat:
>Fix:
unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: