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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 
#define _GNU_SOURCE
#include <sys/socket.h>
#include <errno.h>
#include <fcntl.h>
#include "syscall.h"

int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
{
	if (!flg) return accept(fd, addr, len);
	int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
	if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret;
	if (flg & ~(SOCK_CLOEXEC|SOCK_NONBLOCK)) return ret;
	ret = accept(fd, addr, len);
	if (ret<0) return ret;
	if (flg & SOCK_CLOEXEC)
		__syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
	if (flg & SOCK_NONBLOCK)
		__syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
	return ret;
}
debug log:

solving bbb79507 ...
found bbb79507 in https://inbox.vuxu.org/musl/20230227194654.61114-1-izbyshev@ispras.ru/
found 59ab1726 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 59ab1726bdcb3963170141106b2b575eaacac9ed	src/network/accept4.c

applying [1/1] https://inbox.vuxu.org/musl/20230227194654.61114-1-izbyshev@ispras.ru/
diff --git a/src/network/accept4.c b/src/network/accept4.c
index 59ab1726..bbb79507 100644

Checking patch src/network/accept4.c...
Applied patch src/network/accept4.c cleanly.

index at:
100644 bbb79507837a4b638bbf26f4dde730fccf3f4af3	src/network/accept4.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).