mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] aio+fork bug test case
@ 2020-11-16  5:04 Rich Felker
  0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2020-11-16  5:04 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

I'm cleaning up my work spaces and found this draft test case for the
aio+fork bug fixed in 34904d830a9fd1f6fc47218f38c111698303d2fe. I'm
not sure how best to integrate it with libc-test, but posting it here
now so it's not lost. Probably should be edited to use pipe() rather
than relying on stdin blocking.

Rich

[-- Attachment #2: aio_fork.c --]
[-- Type: text/plain, Size: 292 bytes --]

#include <aio.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
	char buf[256];
	int fd = dup(0);
	struct aiocb cb = { .aio_fildes = fd, .aio_buf = buf, .aio_nbytes = sizeof buf };
	aio_read(&cb);

	pid_t pid = fork();
	if (!pid) {
		close(fd);
		_exit(0);
	}
	waitpid(pid, 0, 0);
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-16  5:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  5:04 [musl] aio+fork bug test case Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).