summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* lib: [sysfs.c] add sysfs_readlink and name/path functionsKarel Zak2011-05-181-2/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [at.c] add readlink_at(), fix semantic for absolute pathsKarel Zak2011-05-181-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [sysfs.c] make sysfs_read_* function more robustKarel Zak2011-05-181-3/+5
| | | | | | | The functions does not modify result if the requested sysfs attribute does not exist. Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: cleanup argv parsing, utmp update, use writeall(), etc.Werner Fink2011-05-171-0/+2
| | | | | | | | | | | Next cleanup, that is split off special character parsing in do_prompt() and parse_args(), handle name of line of virtual console and use it in utmp update as well as the session id. Also move the initial TERM variable to open_tty() as we use this later in open_tty(). Use writeall() but avoid repeat to often for EAGAIN (compare with info page of the (g)libc, description of the macro EAGAIN). Signed-off-by: Werner Fink <werner@suse.de>
* libblkid: use stuff from sysfs.h and at.hKarel Zak2011-05-161-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add generic sysfs utilsKarel Zak2011-05-162-0/+61
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [tt.c] support key="value" output formatKarel Zak2011-05-101-7/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* procutils: include missing headerDavidlohr Bueso2011-05-051-0/+2
| | | | | | | | | To be able to use DIR we need to include the dirent.h header. This fixes issues such as: ../include/procutils.h:5: error: syntax error before "DIR" ../include/procutils.h:5: warning: no semicolon at end of struct or union Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* lib: [procutils.c]: add missing files. Sorry.Karel Zak2011-05-041-0/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>