summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* agetty.c: move issue path to pathnames.hSami Kerola2011-04-271-0/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: [tt.c] support fixed width and multiple tt_print_table() callsKarel Zak2011-04-271-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkdev: add blkdev_is_misaligned()Davidlohr Bueso2011-04-121-0/+3
| | | | | | | | | | This functions returns the status of the device's alignment. It will be 0 when aligned, otherwise return the offset. [kzak@redhat.com: - returns 0 if the ioctl failed] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h] add definition wrappers for old libc versionsDavidlohr Bueso2011-03-291-1/+11
| | | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: remove strings.h include dublicateSami Kerola2011-03-081-1/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: [c.h]: typeof to __typeof__ fixSami Kerola2011-03-081-6/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* strutils: new wrapper function strtoll_or_errSami Kerola2011-02-211-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: [xalloc.h]: mention strdup in the file descriptionPetr Uzel2011-02-211-1/+1
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-142-1/+47
| | | | | | | | 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>
* include: [c.h]: add fallback for old libs without O_CLOEXECKarel Zak2011-02-111-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [at.h]: include c.h for PATH_MAXKarel Zak2011-02-111-0/+1
| | | | | Reported-by: Peter Breitenlohner <peb@mppmu.mpg.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: add unused attribute to ignore_result()Karel Zak2011-02-091-1/+3
| | | | | | | | | | | | | | unfortunately, gcc 4.6 void fn (void) { int foo; foo = bar (); } evaluates that foo is never used. The __attribute__((unused)) is necessary... Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: fix __alloc_size__ testKarel Zak2011-02-081-2/+2
| | | | | Reported-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [xalloc.h] include string.hMarek Polacek2011-02-071-0/+1
| | | | | | | xalloc.h needs string.h for declaration of strdup(). Otherwise we can get implicit declaration warning. This patch prevents it. Signed-off-by: Marek Polacek <mpolacek@redhat.com>
* include: [c.h] add fallback for alloc_size attributesKarel Zak2011-02-072-3/+32
| | | | | Reported-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h] move ignore_result() to gcc-only blockKarel Zak2011-02-071-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* provide a workaround if program_invocation_short_name is missingFabian Groffen2011-01-311-0/+36
| | | | | | | | | | | | Try some replacements, such as getexecname() on Solaris and __progname on BSDs and Darwin. When not found, base program_invocation_short_name on the source filename it is used in, as not to require argv[0] to be passed along. This latter approach is not dynamic, but doesn't require code changes for all places where program_invocation_short_name is used now. Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [tt] enlarge output bufferKarel Zak2011-01-251-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: emulate dirfd when necessaryFabian Groffen2011-01-231-0/+9
| | | | | | | | | | | | dirfd is not available on Solaris 10, it is available on latest OpenSolaris releases though. Do some autoconf trickery to determine if providing an alternative dirfd function is necessary and possible. shlibs/blkid/src/read.c: Do not define _XOPEN_SOURCE to 600, or DIR will lose it's dd_fd member again. Rearrange defines and includes to make sense per comments, and not conflict on Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* lib: [xalloc] don't use hardcoded return codeKarel Zak2011-01-231-4/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: check for paths.hFabian Groffen2011-01-201-0/+2
| | | | | | paths.h doesn't exist on Solaris Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* make _IO macros available on SolarisFabian Groffen2011-01-201-0/+3
| | | | | | | | The _IO macro is defined in sys/ioccom.h on various platforms. However, on Solaris it isn't included by ioctl.h, so include it explicitly if available. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* make major and minor available on SolarisKarel Zak2011-01-201-0/+4
| | | | | Reported-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: check for loff_t, it may not existFabian Groffen2011-01-201-0/+4
| | | | | | | On some systems, loff_t does not exist. Define it as int64_t in that case. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* build-sys: add rpmatch.h to Makefile.amKarel Zak2011-01-191-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use WORDS_BIGENDIAN to determine platform byte-orderFabian Groffen2011-01-171-8/+3Star
| | | | | | | | | | | | Autoconf contains the right magic to determine the endianness on many platforms next to Linux. This reverses previous commits to move away from WORDS_BIGENDIAN: "use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN" This is necessary to compile on non Linux platforms like Darwin and Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* include: fix list.h ifdefsKarel Zak2011-01-141-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add fallback for rpmatch()Francesco Cosoleto2011-01-051-0/+9
| | | | | | | | Simple replacement code with hardcoded y/n responses to allow compilation on systems without rpmatch() such as Cygwin. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>