From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id 1A983394D833 for ; Sat, 21 Mar 2020 08:38:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1A983394D833 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=mark@maxrnd.com Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id 02L8bpYB048733; Sat, 21 Mar 2020 01:37:51 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdw8ChpU; Sat Mar 21 00:37:43 2020 Subject: Re: Why is taskset still not in util-linux? To: moss@cs.umass.edu, cygwin References: <1348011a-261a-2a87-d361-4e51fa8dc19f@cs.umass.edu> <85ae12aa-6cc3-5d4c-5df2-25bf811ec6a9@maxrnd.com> <72fea68a-b3d7-e87c-726f-8a5a2587a992@maxrnd.com> <01e3d337-e5fe-f393-7634-3f1881bca315@cs.umass.edu> <79d7afa5-a07b-04df-c259-b76c61390f8c@maxrnd.com> From: Mark Geisert Message-ID: Date: Sat, 21 Mar 2020 01:37:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2020 08:38:56 -0000 Eliot Moss wrote: > On 3/20/2020 9:39 AM, Yaakov Selkowitz wrote: > > > Cygwin doesn't support syscalls.  I'd be very wary of any code which is > > conditional on any #ifdef SYS_*. > > Of course.  AFAICT taskset does not need the syscall, it just needs the > library call to work.  Asking about the syscall is, I suppose, a kind of Linux > shorthand to see if something is supported on the particular platform.  Mark's > suggestion of providing a fake definition of that syscall definition is a > workaround that may disturb the util-linux sources the least. What I did here was definitely a hack. I'm not sure it's the best solution. I fully concur with Yaakov's warning. There's two levels to syscalls as seen in programs like taskset. On one level, configure checks whether a particular syscall exists on the compiling machine because different Linux kernels have different sets of syscalls. On the second level, the program actually uses a call named syscall() to call into specific kernel routines. On Cygwin, what to do about programs that assume they're running on Linux and so make use of the Linux syscall feature? We could dummy up a sys/syscall.h but implementing a full syscall() interface would be a lot of work and do nothing but slow down programs making heavy use of it; it adds a layer of indirection. Yaakov, do you have a general strategy for dealing with syscall usage when you've come across it in all the porting you've done? Cygwin-specific patch? ..mark