NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/45249: compat_netbsd32 doesn't support aio(3)
>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:
Home |
Main Index |
Thread Index |
Old Index