[
https://issues.apache.org/jira/browse/TS-3508?focusedWorklogId=27059&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27059
]
ASF GitHub Bot logged work on TS-3508:
--------------------------------------
Author: ASF GitHub Bot
Created on: 24/Aug/16 17:51
Start Date: 24/Aug/16 17:51
Worklog Time Spent: 10m
Work Description: Github user PSUdaemon commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/909#discussion_r76105672
--- Diff: iocore/eventsystem/P_UnixSocketManager.h ---
@@ -55,21 +55,52 @@ transient_error()
return transient;
}
+#if !HAVE_ACCEPT4
+int
+accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
+{
+ int fd, err;
+
+ do {
+ fd = accept(sockfd, addr, addrlen);
+ if (likely(fd >= 0))
+ break;
+ } while (transient_error());
+
+ if ((fd >= 0) && (flags & SOCK_CLOEXEC) && (safe_fcntl(fd, F_SETFD,
FD_CLOEXEC) < 0)) {
+ err = errno;
+ close(fd);
+ errno = err;
+ return -1;
+ }
+
+ if ((fd >= 0) && (flags & SOCK_NONBLOCK) && (safe_nonblocking(fd) < 0)) {
+ err = errno;
+ close(fd);
+ errno = err;
+ return -1;
+ }
+
+ return fd;
+}
+#endif
--- End diff --
I don't understand what you mean by this.
Issue Time Tracking
-------------------
Worklog Id: (was: 27059)
Time Spent: 2h 10m (was: 2h)
> Use accept4 on linux systems where available to reduce system calls
> -------------------------------------------------------------------
>
> Key: TS-3508
> URL: https://issues.apache.org/jira/browse/TS-3508
> Project: Traffic Server
> Issue Type: Improvement
> Components: Network
> Reporter: John Plevyak
> Assignee: Phil Sorber
> Fix For: 7.0.0
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> The accept4() syscall can set flags on the accepted socket.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)