Why is taskset still not in util-linux?
Eliot Moss
moss@cs.umass.edu
Sun Mar 22 04:10:03 GMT 2020
Well, I had _thought_ I had done 'cygport install' and run the installed
version, but I seem to have been wrong. I seem to have manually over-written
the proper (stripped) binary with the wrapper!
Anyway, I've got the whole thing working and offer the attached patches for
"thoughtful consideration". I have done away with the need to create an empty
or fake /usr/local/include/sys/syscall.h and changed the source of the
relevant programs to conditional #include <sys/syscall.h> on #indef
__CYGWIN__, which sruck me as more legitimate (the file in questions is
patched anyway). And I improved configure.ac so that the programs controlled
by --enable-schedutils are more independent and can fail individually without
failing the build. Part of that was subtituting, as a patch to configure.ac,
a check for the sched_getaffinity and sched_setaffinity calls in place of the
check for the corresponding syscall. The whole builds and installs. I can
provide the packaged up version (I assume that is the 'dist' hierarchy) if
that would be helpful.
Regards - Eliot
-------------- next part --------------
NAME="util-linux"
VERSION=2.33.1
RELEASE=1
CATEGORY="Base"
SUMMARY="Collection of basic system utilities"
HOMEPAGE="https://github.com/karelzak/util-linux/"
SRC_URI="https://mirrors.edge.kernel.org/pub/linux/utils/${NAME}/v${PV_MAJ_MIN}/${NAME}-${VERSION}.tar.xz"
PATCH_URI="
2.24.2-libintl.patch
2.25.1-cygwin-include.patch
2.24.2-agetty.patch
2.24.2-libblkid-topology.patch
2.32.1-testsuite.patch
2.33.1-cygwin-cpuset.patch
2.33.1-cygwin-cpuset.patch2
2.33.1-cygwin-ionice.patch
2.33.1-cygwin-taskset.patch
"
PKG_NAMES="${NAME} libblkid1 libblkid-devel libfdisk1 libfdisk-devel
libsmartcols1 libsmartcols-devel libuuid1 libuuid-devel uuidd"
util_linux_CONTENTS="
--exclude=*.dll --exclude=uuidd*
bin/*
sbin/*
usr/bin/*
usr/share/bash-completion/
usr/share/doc/${NAME}
usr/share/locale/*/*/util-linux.mo
usr/share/man/man[158]/*
"
libblkid1_CATEGORY="Libs"
libblkid1_SUMMARY="Block device ID library (runtime)"
libblkid1_CONTENTS="usr/bin/cygblkid-1.dll"
libblkid_devel_CATEGORY="Libs"
libblkid_devel_SUMMARY="Block device ID library (development)"
libblkid_devel_CONTENTS="
usr/include/blkid/
usr/lib/libblkid.*
usr/lib/pkgconfig/blkid.pc
usr/share/man/man3/*blkid*
"
libfdisk1_CATEGORY="Libs"
libfdisk1_SUMMARY="Disk partition table manipulation library (runtime)"
libfdisk1_CONTENTS="usr/bin/cygfdisk-1.dll"
libfdisk_devel_CATEGORY="Libs"
libfdisk_devel_SUMMARY="Disk partition table manipulation library (development)"
libfdisk_devel_CONTENTS="
usr/include/libfdisk/
usr/lib/libfdisk.*
usr/lib/pkgconfig/fdisk.pc
"
libsmartcols1_CATEGORY="Libs"
libsmartcols1_SUMMARY="Tabular data formatting library (runtime)"
libsmartcols1_DESCRIPTION="The libsmartcols library is used for smart
adaptive formatting of tabular data."
libsmartcols1_CONTENTS="usr/bin/cygsmartcols-1.dll"
libsmartcols_devel_CATEGORY="Libs"
libsmartcols_devel_SUMMARY="Tabular data formatting library (development)"
libsmartcols_devel_DESCRIPTION=${libsmartcols1_DESCRIPTION}
libsmartcols_devel_CONTENTS="
usr/include/libsmartcols/
usr/lib/libsmartcols.*
usr/lib/pkgconfig/smartcols.pc
"
libuuid1_CATEGORY="Libs"
libuuid1_SUMMARY="Universally Unique ID library (runtime)"
libuuid1_CONTENTS="usr/bin/cyguuid-1.dll"
libuuid_devel_CATEGORY="Libs"
libuuid_devel_SUMMARY="Universally Unique ID library (development)"
libuuid_devel_CONTENTS="
usr/include/uuid/
usr/lib/libuuid.*
usr/lib/pkgconfig/uuid.pc
usr/share/man/man3/*uuid*
"
uuidd_CATEGORY="System"
uuidd_SUMMARY="UUID daemon"
uuidd_CONTENTS="
usr/sbin/uuidd.exe
usr/share/bash-completion/completions/uuidd
usr/share/man/man8/uuidd.8*
var/lib/libuuid/
var/run/uuidd/
"
BUILD_REQUIRES="
bison
gettext-devel
libcrypt-devel
libncurses-devel
libreadline-devel
zlib-devel
"
CPPFLAGS+=" -D__USE_LINUX_IOCTL_DEFS"
# fsck: e2fsprogs
# ipcrm, ipcs: ipc-utils
# kill, mount: cygwin
# login: login
# su: coreutils
# last, mesg, mountpoint, utmpdump, wall: sysvinit
# others are linux-specific or obsolete
CYGCONF_ARGS="
--runstatedir=/var/run
--enable-libuuid
--enable-libuuid-force-uuidd
--enable-libblkid
--enable-libfdisk
--disable-libmount
--disable-mount
--disable-losetup
--disable-fsck
--disable-partx
--enable-uuidd
--disable-mountpoint
--disable-fallocate
--disable-unshare
--disable-nsenter
--disable-setpriv
--disable-eject
--enable-agetty
--enable-cramfs
--enable-bfs
--disable-fdformat
--disable-hwclock
--disable-wdctl
--disable-switch_root
--disable-pivot_root
--disable-ipcrm
--disable-ipcs
--disable-tunelp
--disable-kill
--disable-last
--disable-lslogins
--disable-utmpdump
--disable-line
--disable-mesg
--disable-raw
--enable-rename
--disable-vipw
--disable-newgrp
--disable-chfn-chsh
--disable-login
--enable-nologin
--disable-sulogin
--disable-su
--disable-runuser
--enable-ul
--enable-more
--enable-pg
--disable-setterm
--enable-schedutils
--disable-wall
--disable-write
--disable-use-tty-group
--disable-makeinstall-chown
--disable-makeinstall-setuid
SOLIB_LDFLAGS=-no-undefined
"
# prevents bogus .so symlinks
MAKEOPTS+=" libdir=/usr/lib"
KEEPDIRS="/var/lib/libuuid /var/run/uuidd"
-------------- next part --------------
--- origsrc/util-linux-2.33.1/lib/cpuset.c 2020-03-21 20:48:54.978830500 -0400
+++ src/util-linux-2.33.1/lib/cpuset.c 2020-03-21 21:21:56.238472500 -0400
@@ -20,7 +20,9 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
+#ifndef __CYGWIN__
#include <sys/syscall.h>
+#endif
#include "cpuset.h"
#include "c.h"
-------------- next part --------------
--- origsrc/util-linux-2.33.1/configure.ac 2020-03-21 20:19:20.952384000 -0400
+++ src/util-linux-2.33.1/configure.ac 2020-03-21 20:42:40.640966200 -0400
@@ -2054,8 +2054,13 @@
)
-UL_ENABLE_ALIAS([ionice], [schedutils])
-UL_BUILD_INIT([ionice])
+AC_ARG_ENABLE([ionice],
+ AS_HELP_STRING([--disable-ionice], [disable ionice even if schedutils is enabled]),
+ [], [UL_DEFAULT_ENABLE([ionice], [check])]
+)
+
+UL_BUILD_INIT([ionice], [check])
+UL_REQUIRES_BUILD([ionice], [schedutils])
UL_REQUIRES_SYSCALL_CHECK([ionice],
[UL_CHECK_SYSCALL([ioprio_set],
[alpha], [442],
-------------- next part --------------
--- origsrc/util-linux-2.33.1/configure.ac 2020-03-21 23:12:49.481503500 -0400
+++ src/util-linux-2.33.1/configure.ac 2020-03-21 23:17:20.565468100 -0400
@@ -2052,6 +2052,7 @@
AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
[], [UL_DEFAULT_ENABLE([schedutils], [check])]
)
+UL_BUILD_INIT([schedutils])
UL_ENABLE_ALIAS([ionice], [schedutils])
@@ -2083,12 +2084,11 @@
AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
-UL_ENABLE_ALIAS([taskset], [schedutils])
-UL_BUILD_INIT([taskset])
+UL_BUILD_INIT([taskset], [check])
+UL_REQUIRES_BUILD([taskset], [schedutils])
UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
-UL_REQUIRES_SYSCALL_CHECK([taskset],
- [UL_CHECK_SYSCALL([sched_getaffinity])],
- [sched_getaffinity])
+AC_CHECK_FUNCS([sched_getaffinity sched_setaffinity], [have_schedaffinity=yes],[have_schedaffinity=no])
+UL_REQUIRES_HAVE([taskset], [schedaffinity], [sched affinity functions])
AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
More information about the Cygwin
mailing list