From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1500 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Using unistd functions vs calling syscall straight in the code Date: Fri, 10 Aug 2012 16:16:13 +0200 Message-ID: <20120810141613.GA20243@port70.net> References: 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: dough.gmane.org 1344608186 10543 80.91.229.3 (10 Aug 2012 14:16:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2012 14:16:26 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1501-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 10 16:16:27 2012 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 1Szq0o-0005X7-J6 for gllmg-musl@plane.gmane.org; Fri, 10 Aug 2012 16:16:26 +0200 Original-Received: (qmail 17840 invoked by uid 550); 10 Aug 2012 14:16:25 -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 17827 invoked from network); 10 Aug 2012 14:16:25 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1500 Archived-At: * Murali Vijayaraghavan [2012-08-10 21:47:59 +0900]: > You guys do have a unistd implementation which supposedly implements each > of the system calls. But you are not consistent with the use of these > functions to perform the unistd-implemented tasks. Wouldn't it be a lot > cleaner to call these functions instead of calling syscall / syscall_cp > directly from the other (top-level) functions? Was there some rationale or > is it just code evolution? > i don't understand the question can you show with an example what do you mean? calling a libc function is not the same as using a linux syscall, and there is usually a reason why one is used instead of the other.. (the first has posix semantics the second has whatever semantics linux have, even if these happen to be compatible then the first one creates an extra call and an extra internal dependency when static linking is used)