From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2966 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Difficulty emulating F_DUPFD_CLOEXEC Date: Sat, 23 Mar 2013 22:12:23 -0400 Message-ID: <20130324021223.GA20323@brightrain.aerifal.cx> References: <20130324015923.GA5905@brightrain.aerifal.cx> <20130324020910.GZ20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1364091154 8303 80.91.229.3 (24 Mar 2013 02:12:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Mar 2013 02:12:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2967-gllmg-musl=m.gmane.org@lists.openwall.com Sun Mar 24 03:13:01 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UJaQd-0001b4-L0 for gllmg-musl@plane.gmane.org; Sun, 24 Mar 2013 03:12:59 +0100 Original-Received: (qmail 26531 invoked by uid 550); 24 Mar 2013 02:12:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26523 invoked from network); 24 Mar 2013 02:12:35 -0000 Content-Disposition: inline In-Reply-To: <20130324020910.GZ20323@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2966 Archived-At: On Sat, Mar 23, 2013 at 10:09:10PM -0400, Rich Felker wrote: > + if (cmd == F_DUPFD_CLOEXEC) { > + int ret = __syscall(SYS_fcntl, fd, F_DUPFD_CLOEXEC, arg); > + if (ret != -EINVAL) return __syscall_ret(ret); It might be desirable, even if F_DUPFD_CLOEXEC succeeded, to also call fcntl(ret, F_SETFD, FD_CLOEXEC)... Reportedly somebody broke F_DUPFD_CLOEXEC somewhere around 3.7.0 so that it silently failed to set the close-on-exec flag. Anybody know how many kernels are affected? Rich