Commit Graph

14 Commits

Author SHA1 Message Date
Davidlohr Bueso dd29a76293 taskset: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-05-11 10:06:58 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Davidlohr Bueso f2f0dcaf11 schedutils: remove unneeded header files
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-02-08 16:23:28 +01:00
Davidlohr Bueso 8abcf29002 lib: [strutils] general purpose string handling functions
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)

A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-23 21:06:49 +01:00
Karel Zak 2429509658 taskset: proper numbers parsing
Reported-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-09-30 23:29:14 +02:00
Karel Zak bae91ecf07 taskset: move NR_CPUS determination to lib/cpuset.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:11:26 +02:00
Karel Zak de87877662 taskset: add NLS support, use err.h, cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:10:01 +02:00
Karel Zak ff5a6d2067 taskset: use libc based cpu_set_t
The glibc already supports dynamically allocated CPU sets. We don't
have to maintains our private non-compatible implementation.

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:06:50 +02:00
Karel Zak efcb71f8ff taskset: move bitmap routines to lib/cpuset.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:04:44 +02:00
Karel Zak bf928360f2 build-sys: remove hardcoded _GNU_SOURCE
We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-09-20 00:57:01 +02:00
Cliff Wickman f7e3dc0533 taskset: independent of hardcoded NR_CPUS max.
This patch makes the taskset command independent of the system's maximum
number of cpus (CONFIG_NR_CPUS).  The maximum for CONFIG_NR_CPUS is a
moving target.

With this patch the size of the systems's cpumask_t is gotten from
sched_getaffinity(2).

This patch uses variable length bitmasks borrowed from Paul Jackson's
variable size bitmask routines (hence I kept his copyright notice).
This replaces the use of the glibc CPU_SETSIZE, CPU_SET, CPU_ZERO and
CPU_ISSET macros which depend on a hardcoded size for cpu_set_t.

(also fixes one little nit: the -V option is "-v" in the built-in help, so
 changed the built-in help)

Signed-off-by: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-19 15:00:10 +02:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00