From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105641 invoked by alias); 14 Sep 2017 08:05:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 100375 invoked by uid 89); 14 Sep 2017 08:04:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de From: Andreas Schwab To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2] Use execveat syscall in fexecve References: <87bmmmlpe1.fsf@mid.deneb.enyo.de> <2a21b0d6-5f62-a711-2b4a-616ebb798963@linaro.org> X-Yow: Yes, Private DOBERMAN!! Date: Thu, 14 Sep 2017 08:05:00 -0000 In-Reply-To: <2a21b0d6-5f62-a711-2b4a-616ebb798963@linaro.org> (Adhemerval Zanella's message of "Mon, 11 Sep 2017 17:29:42 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-09/txt/msg00591.txt.bz2 On Sep 11 2017, Adhemerval Zanella wrote: > I would prefer it to use INLINE_SYSCALL_CALL. And since the idea is not to > clobber errno I think we can do: > > #ifdef __NR_execvat > INTERNAL_SYSCALL_DECL (err); > int val = INTERNAL_SYSCALL_CALL (execveat, fd, argv, envp, AT_EMPTY_PATH); > if (INTERNAL_SYSCALL_ERROR_P (val, err) != ENOSYS) > return -1; > #endif No, that would be wrong. Either the exec succeeds, then errno no longer exits, otherwise errno needs to be set before we return. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."