mailing list of musl libc
 help / color / mirror / 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

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git