mailing list of musl libc
 help / color / mirror / code / Atom feed
ab3b3787855f8b3d1d3b0be8549faac79e724489 blob 652 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "test.h"

#define TEST(c, ...) ((c) ? 1 : (t_error(#c" failed: " __VA_ARGS__),0))

static void handler_errno(void)
{
	errno = 0;
}

int main(void)
{
	t_setrlim(RLIMIT_NPROC, 0);
	pthread_atfork(handler_errno, handler_errno, handler_errno);

	pid_t pid;
	if (!TEST((pid = fork()) == -1, "fork succeeded despite rlimit\n")) {
		if (!pid) _exit(0);
		while (waitpid(pid, NULL, 0)<0 && errno==EINTR);
	} else {
		TEST(errno != 0, "fork failed but errno was clobbered\n");
	}

	return t_status;
}

debug log:

solving ab3b378 ...
found ab3b378 in https://inbox.vuxu.org/musl/20171110205918.18470-1-koorogi@koorogi.info/

applying [1/1] https://inbox.vuxu.org/musl/20171110205918.18470-1-koorogi@koorogi.info/
diff --git a/src/regression/pthread_atfork-errno-clobber.c b/src/regression/pthread_atfork-errno-clobber.c
new file mode 100644
index 0000000..ab3b378

Checking patch src/regression/pthread_atfork-errno-clobber.c...
1:38: new blank line at EOF.
+
Applied patch src/regression/pthread_atfork-errno-clobber.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 ab3b3787855f8b3d1d3b0be8549faac79e724489	src/regression/pthread_atfork-errno-clobber.c

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).