summaryrefslogtreecommitdiff
path: root/lib/Makemodule.am
AgeCommit message (Collapse)AuthorFilesLines
2013-09-11lib: add crc64()Karel Zak1-0/+1
Based on bcache code from Rolf Fokkens. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-10lib: rename time-util.c to timeutils.c, fix headersKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-29lib/time-util: copy time parsing functions from systemdSami Kerola1-0/+1
The functions are copied nearly as-is. Coding style has been modified to match with util-linux project, while the functionality remains untouched. CC: Lennart Poettering <lennart@poettering.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-05-06lib/colors: add support for auto, always and never modesKarel Zak1-0/+4
... to implement --color[=<when>] Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09loopdev: sync capacity after setting itJeff Mahoney1-1/+1
I recently tried to mount an hfsplus file system from an image file with a partition table by using the loop offset and sizelimit options to specify the location of the file system. hfsplus stores some metadata at a set offset from the end of the partition, so it's sensitive to the device size reported by the kernel. It worked with this: But failed with this: /dev/loop0: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /dev/loop1: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /proc/partitions shows the correct number of blocks to match the sizelimit. But if I set a breakpoint in mount before the mount syscall, I could see: 102400000 102432768 The kernel loop driver will set the gendisk capacity of the device at LOOP_SET_STATUS64 but won't sync it to the block device until one of two conditions are met: All open file descriptors referring to the device are closed (and it will sync when re-opened) or if the LOOP_SET_CAPACITY ioctl is called to sync it. Since mount opens the device and passes it directly to the mount syscall after LOOP_SET_STATUS64 without closing and reopening it, the sizelimit argument is effectively ignroed. The capacity needs to be synced immediately for it to work as expected. This patch adds the LOOP_SET_CAPACITY call to loopctx_setup_device since the device isn't yet released to the user, so it's safe to sync the capacity immediately. [kzak@redhat.com: - port to the current git HEAD, - use uint64_t] Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12lib/procutils: add simple API to scan /proc/PID/*Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-14unshare,nsenter: spawn shell by defaultZbigniew Jędrzejewski-Szmek1-1/+2
The behaviour mimics chroot. Possibly it would have been nicer to to query the password database in the new namepace and run the shell of the user there, but it's hard to do correctly. getpwuid() might need to load nss plugins, and the arch in the new namespace might be different (in case of NEWNS mounts), or the hostname might be different, etc. So in general it's not possible to do it reliably. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2012-12-23sulogin: remove consoles.c from libcommonKarel Zak1-6/+0
- move struct chardata to include/ttyutils.h - move console.{h,c} to login-utils/sulogin-* (it's sulogin specific) - fix sulogin and agetty includes Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-19lib/ismounted: basic support for loop devicesKarel Zak1-0/+1
# losetup -a /dev/loop0 /dev/loop0: [2053]:1048578 (/home/fs-images/filesystems/ext2.img) # findmnt /dev/loop0 TARGET SOURCE FSTYPE OPTIONS /mnt/test /dev/loop0 ext3 rw,relatime,data=ordered old version: ./test_ismounted /home/fs-images/filesystems/ext2.img not mounted new version: ./test_ismounted /home/fs-images/filesystems/ext2.img mounted on /mnt/test Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22lib/ttyutils: add test programKarel Zak1-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22lib/ttyutils: create .c fileKarel Zak1-0/+1
Well, now all tty stuff are incline functions in include/ttyutils.h. It's seems more elegant to create regular lib/ttyutils.c for libcommon and write test program. Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-09lib/consoles: add test programKarel Zak1-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-08lib/consoles: add code to detect all system consolesWerner Fink1-0/+1
Signed-off-by: Werner Fink <werner@suse.de>
2012-11-02build-sys: cleanup cpu_set_t usageKarel Zak1-1/+4
- make taskset depend on cpu_set_t - make cpuset.c optional for libcommon and lib/path.c Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-16lib/color: add module for work with terminal colorsOndrej Oprala1-0/+1
[kzak@redhat.com: - split from dmesg patch - add more colors] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13Fix non-Linux buildSamuel Thibault1-4/+5
loopdev.c, test_pager, and get_max_number_of_cpus() are linux-specific. get_linux_version will only work on Linux, let's introduce system_supports_ext4_ext2() which assumes that mounting ext2 with ext4 is not supported on non-Linux systems. [kzak@redhat.com: - use #ifdef SYS_sched_getaffinity rather than __linux__] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-30build-sys: move tests to check_PROGRAMSKarel Zak1-3/+3
Thanks to Mike Frysinger. Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26build-sys: convert lib/ to libcommon.laKarel Zak1-13/+42
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26build-sys: define per-test -DTEST_PROGRAM in lib/Karel Zak1-4/+21
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26build-sys: convert lib/ to moduleKarel Zak1-0/+64
Signed-off-by: Karel Zak <kzak@redhat.com>