summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* lib: [c] add ignore_result()Karel Zak2011-01-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: add --submounts optionKarel Zak2011-01-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [env] consolidate safe_getenv() usageKarel Zak2011-01-031-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup mangle() usageKarel Zak2011-01-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use better format for utab, improve bind mountsKarel Zak2011-01-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rewrite mountinfo/fstab parsers to use sscanf()Karel Zak2011-01-031-0/+5
| | | | | | | | The old solution (without scanf()) was based on old code from mount(8). It seems that the modern libc is able to provide all necessary functionality by sscanf() and %ms directive. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add unmangle/mangle() functions to APIKarel Zak2011-01-031-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add /etc/fstab.d supportKarel Zak2011-01-031-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add wrappers for "at" functionsKarel Zak2011-01-032-0/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: complete rewriteDavidlohr Bueso2010-12-091-0/+1
| | | | | | Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: use /sys/dev/block/.../loop/backing_fileKarel Zak2010-12-011-0/+1
| | | | | | | | | | | | | | | | | The basic loopdev attributes are available in sysfs since kernel 2.6.37. This patch uses the backing_file attribute from sysfs for very long filenames (the LOOP_GET_STATUS ioctl uses only 64 bytes for the filename). old version: # losetup -a /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_*) new version: # losetup -a /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_name/ext2.img) Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add missing headerKarel Zak2010-11-301-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] move strmode() from namei.c to strutils.cKarel Zak2010-11-241-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [xalloc] add xstrdup()Karel Zak2010-11-241-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [tt] add TT_FL_RIGHT, add columns list parserKarel Zak2010-11-241-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] general purpose string handling functionsDavidlohr Bueso2010-11-234-19/+28
| | | | | | | | | | | | | 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>
* lib: add fallback for nl_langinfo()Karel Zak2010-11-151-0/+73
| | | | | | | | The fallback ignores locales and returns hardcoded static strings. It should be enough to include "nls.h" to work with nl_langinfo() on all systems. Signed-off-by: Karel Zak <kzak@redhat.com>
* xalloc: general purpose memory allocation handling wrappersDavidlohr Bueso2010-10-211-0/+46
| | | | | | | [kzak@redhat.com: - use %zu for size_t] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix MBR detection on iPod and cleanup vfat codeKarel Zak2010-10-151-0/+6
| | | | | | | | | | | - move all FAT code to superblocks/vfat.c only - add a generic function to verify FAT superblock and use it in FAT prober as well as in MBR parser - add a more robust FAT cluster_count check (it seems that iPod contains an "almost valid" FAT superblock before MBR) Reported-by: Davidlohr Bueso <dave.bueso@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: cleanup blkdev.hKarel Zak2010-08-241-37/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add BLKDISCARDZEROESKarel Zak2010-08-241-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix CPU_EQUAL_S macroKarel Zak2010-06-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add CPU_EQUAL_S definition for old/obscure libcKarel Zak2010-06-141-0/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: update include/Makefile.amKarel Zak2010-06-071-7/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: tt.c - fix minimal width of columnKarel Zak2010-06-031-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add tt.c (Tree and Table output)Karel Zak2010-06-032-0/+71
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: move shlibs/.../list.h to the include/ directoryKarel Zak2010-06-032-0/+198
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: add new commandKarel Zak2010-06-031-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: move NR_CPUS determination to lib/cpuset.cKarel Zak2010-06-011-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add fallback for libc (uClibc) without CPU_ALLOCKarel Zak2010-06-011-0/+45
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: use libc based cpu_set_tKarel Zak2010-06-011-14/+9Star
| | | | | | | 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>
* taskset: move bitmap routines to lib/cpuset.cKarel Zak2010-06-011-0/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsfreeze: new commandHajime Taira2010-05-141-0/+5
| | | | | | | | | | [kzak@redhat.com: - cleanup - add long options - add note about DM to the man page - use err.h and nls.h] Signed-off-by: Hajime Taira <htaira@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: support non-ascii characters in inputKarel Zak2010-05-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | On Sat, Apr 03, 2010 at 12:58:48PM +0000, Jorge wrote: > When you want to write changes to disk you're asked for a > confirmation, like this one: > > Are you sure you want to write the partition table to disk? (yes > or no) > > There is no problem on the English version, but when you launch the > program in Spanish you get this: > > ¿Está seguro de que desea escribir la tabla de particiones en el > disco? > (sí o no): > > You can't type the "í" character. Trying to do so will end in no > input at all. That is, typing in my keyboard "´" then "i" leads to > nothing. So you can't write changes to disk, and you must launch the > program in English for it to operate. Reported-by: Jorge <yo@jorgesuarezdelis.name> Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/205327 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: revert ugly ENOMEDIUM supportKarel Zak2010-04-271-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swaplabel: new commandJason Borden2010-04-021-2/+6
| | | | | | | | | | | Print or change the label / UUID of a swap area. [kzak@redhat.com: - code refactoring - add long options - clean up Makefile.am] Signed-off-by: Jason Borden <jborden@bluehost.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: move DELETED_SUFFIX to include/pathnames.hKarel Zak2010-04-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: move write_all() to include/writeall.hKarel Zak2010-04-012-1/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add strtosize() functionKarel Zak2010-03-302-0/+9
| | | | | | | | | | This function int strtosize(const char *str, uintmax_t *res) supports {K,M,G,T,E,P}iB and {K,M,G,T,E,P}B suffixes. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add #ifndef around min() max() macrosKarel Zak2010-03-161-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: factor out and update multibyte alignment codePádraig Brady2010-03-162-0/+44
| | | | | | | | | | | | | * include/mbsalign.h: New module interface * lib/mbsalign.c: Updated implementation synced from coreutils * include/Makefile.am: Add mbsalign.h * misc-utils/Makefile.am: Make cal dependent on mbsalign module * misc-utils/cal.c: Call mbsalign() [kzak@redhat.com: - use min() macro from c.h] Signed-off-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: report ambivalent FS detection, improve brute force detectionKarel Zak2010-03-151-0/+1
| | | | | | | | | | | | | | | | | | | The ambivalent probing result should be properly reported and user should be informed that the problem is possible to bypass by "-t <type>" or resolved by wipefs(8). The mount(8) command uses a brute force stage (calls mount(2) for all /{proc,etc}/fylesystems) if there is not any other way how to detect the filesystem type. The brute force stage should not be restricted by libblkid. It's possible that libblkid is not able to detect slightly corrupted filesystem, but kernel is able to mount such filesystem. Note that the brute force stage should not be used if libblkid returns ambivalent probing result. In this case user's intervention is required (e.g. mount -t <type>). Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add mangle.c for mtab (fstab or swaps) encodingKarel Zak2010-03-102-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* liblkid: move getsize.c code to lib/Karel Zak2010-03-101-1/+5
| | | | | | .. and cleanup blkdev_get_size() usage in libblkid. Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add min/max macrosKarel Zak2010-02-121-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_probe_all_removable()Karel Zak2010-02-011-0/+2
| | | | | | | | | | | | | | The libblkid probing is based on devices from /proc/partitions by default. This file usually does not contain removable devices (e.g. CDROMs) and this kind of devices are invisible for libblkid. The blkid_probe_all_removable() function adds removable block devices to blkid cache. The probing is based on information from the /sys directory. The devices which were detected by this function won't be written to blkid.tab cache file. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=533874 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: and libblkid: covert /dev/dm-N to /dev/mapper/<name>Karel Zak2009-10-261-0/+1
| | | | | | | | | | | | | * mount(8) uses private device-mapper names in mtab * libblkid returns private device-mapper names when evaluate udev /dev/disk-by symlinks. * on systems where DM is fully integrated with udev the /dev/mapper/<name> files are symlinks to /dev/dm-N. It means we need a special care to hide private device-mapper names. Signed-off-by: Karel Zak <kzak@redhat.com>
* include: use c.h in canonicalize.hKarel Zak2009-10-161-4/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add c.h with fundamental C definitionsKarel Zak2009-10-162-0/+50
| | | | | | | | | Add: * ARRAY_SIZE with array type check * PATH_MAX, TRUE and FALSE macros * dummy __attribute__ for non-gcc compilers Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: fix broken zone checkingKarel Zak2009-10-151-0/+16
| | | | | | | | | | | | | This bug has been introduced by commit 95356e8b744439336925eeb36f01399f1ee8a5e9. The fsck.minix code assumes that isset() macro returns boolean, unfortunately the generic implementation from libc returns integer. This patch also add a fallback for the bitmap macros to include/bitops.h. Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl> Signed-off-by: Karel Zak <kzak@redhat.com>