NetBSD Problem Report #45249
From www@NetBSD.org Sat Aug 13 20:41:43 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id C6B6463C767
for <gnats-bugs@gnats.NetBSD.org>; Sat, 13 Aug 2011 20:41:42 +0000 (UTC)
Message-Id: <20110813204142.38CA963BED8@www.NetBSD.org>
Date: Sat, 13 Aug 2011 20:41:42 +0000 (UTC)
From: jmcneill@invisible.ca
Reply-To: jmcneill@invisible.ca
To: gnats-bugs@NetBSD.org
Subject: compat_netbsd32 doesn't support aio(3)
X-Send-Pr-Version: www-1.0
>Number: 45249
>Category: kern
>Synopsis: compat_netbsd32 doesn't support aio(3)
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Aug 13 20:45:01 +0000 2011
>Originator: Jared McNeill
>Release: 5.99.55
>Organization:
>Environment:
>Description:
Running 32-bit binaries on amd64 that use aio(3) fail because compat_netbsd32 doesn't implement these functions.
>How-To-Repeat:
/* compile with cc -m32 */
#include <aio.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int
main(void)
{
struct aiocb aiocb;
struct aiocb *list[1] = { &aiocb };
uint8_t buf[100];
int fd, error;
fd = open("/dev/zero", O_RDONLY, 0);
if (fd == -1)
errx(1, "open /dev/zero");
memset(&aiocb, 0, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = sizeof(buf);
aiocb.aio_offset = 0;
error = aio_read(&aiocb);
if (error == -1)
errx(1, "aio_read");
error = aio_suspend((const struct aiocb * const *)list, 1, NULL);
if (error == -1)
errx(1, "aio_suspend");
close(fd);
printf("ok!\n");
return 0;
}
>Fix:
(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.