X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 43B243945C27
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
Subject: Re: Why is taskset still not in util-linux?
From: Mark Geisert <mark@maxrnd.com>
To: moss@cs.umass.edu, cygwin@cygwin.com
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>
 <dca24f26-9da9-591c-19c1-8020e5de3a4e@maxrnd.com>
Message-ID: <79d7afa5-a07b-04df-c259-b76c61390f8c@maxrnd.com>
Date: Thu, 19 Mar 2020 22:54:45 -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: <dca24f26-9da9-591c-19c1-8020e5de3a4e@maxrnd.com>
X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE,
 SPF_NONE 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 <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <http://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 02K5tS8C032229

Mark Geisert wrote:
> Eliot Moss wrote:
>> On 3/16/2020 7:34 PM, Mark Geisert wrote:
>>  > Mark Geisert wrote:
>>  >> Eliot Moss wrote:
>>  >>>
>>  >>> Dear cygwin-ers --
>>  >>>
>>  >>> Something I had asked about a while ago was the absence os taskset in 
>> cygwin's
>>  >>> util-linux.  At the time, it was pointed out that the necessary get/set
>>  >>> affinity library/system calls were not yet supported.  These were added a
>>  >>> while ago, so it would seem that taskset ought to work.  In fact, I think
>>  >>> someone got it going on their own.  Can we add it to util-linux now,
>>  >>> officially?  I think this was intended but perhaps was overlooked or
>>  >>> something.
>>  >>
>>  >> Report noted; thanks.  A solution is being worked.
>>  >
>>  > There's been no forward progress on this.  If you're comfortable getting 
>> the util-linux source
>>  > package through Cygwin setup*.exe, you can follow the steps shown in
>>  > https://cygwin.com/pipermail/cygwin-apps/2020-March/039855.html to build 
>> (with cygport) a local copy
>>  > of util-linux that includes a taskset.exe you can move into /usr/local/bin, 
>> for example.
>>  >
>>  > You might try that route if you're up for it.  Feel free to ask questions 
>> here if you hit a snag.
>>  > HTH,
>>
>> Thank you, Mark.  I decided to give it a try and got some distance, but hit a 
>> snag.
>>
>> First, I had to change configure.ac to add control to disable ionice (Cygwin
>> does not support a required syscall) while still trying to build taskset.
>> Previously taskset and ionice (and one other program) were controlled by the
>> single --enable-schedutils.
>>
>> Now, including sched.h does not provide the prototypes for sched_getaffinity,
>> etc.  I found a previous post that suggests we need to do -D_GNU_SOURCE for it
>> to work.  I am not sure of the best place to stick that, but I will see about
>> maybe a one line patch to taskset.c or something.
> 
> Rats.  Sorry you've hit some snags.  Are you compiling directly with 'make' or 
> the preferred 'cygport util-linux.cygport build'?  With the latter I didn't need 
> to make any changes to the source tree; all mods were accomplished with the new 
> patch file and changes to util-linux.cygport itself.

I've reproduced your snags.  It/they are due to my having forgotten another tiny 
update that should have been part of the 2.33.1-cygwin-cpuset.patch file.  If 
you 'echo "#define SYS_sched_getaffinity 42" > /usr/local/include/sys/syscall.h' 
and then back out your other fix attempts, the build using cygport should work.

..mark
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

