summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2013-03-13include: add timer.hKarel Zak2-0/+32
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13lib/strutils: add strtotimeval_or_err()Karel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12lib/procutils: add simple API to scan /proc/PID/*Karel Zak1-0/+18
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libblkid: rename in sun_disklabel for compatibility with fdiskKarel Zak1-8/+10
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11inlude/pt-sun: add flags and tagsKarel Zak1-7/+23
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libblkid: move sun PT definition to include/Karel Zak2-1/+74
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11lib/strutils: simplify strtosize(), return info about suffixKarel Zak1-0/+21
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11fdisk: add callback for ask-numbers APIKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-04build-sys: add exec_shell.h to distributionBernhard Voelker1-0/+1
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2013-02-20Merge branch 'patch-1' of https://github.com/dtrebbien/util-linuxKarel Zak1-0/+3
* 'patch-1' of https://github.com/dtrebbien/util-linux: Implement mempcpy() in terms of memcpy() if mempcpy() is unavailable
2013-02-19lib/tty: don't truncate output on non-terminalsKarel Zak1-0/+1
for example: $ findmnt | cat $ lslocks > foo the output should not be truncated. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-14unshare,nsenter: spawn shell by defaultZbigniew Jędrzejewski-Szmek1-0/+1
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>
2013-02-06build-sys: add namespace.h to distributionSami Kerola1-0/+1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-02-05setpriv: move paths to pathnames.hKarel Zak1-0/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30Implement mempcpy() in terms of memcpy() if mempcpy() is unavailableDaniel Trebbien1-0/+3
2013-01-25nsenter: fix indentationSami Kerola1-28/+27
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-24include: add missing values to sysfs_cxt initializer definitionSami Kerola1-1/+1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-17unshare,nsenter: Move the old libc handling into a common header namespace.hEric W. Biederman1-0/+43
Move the defitions of CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWUSER, CLONE_NEWPID into namespace.h in case sched.h does not provide those definitions. Are there systems around that are old enough that still need this? Move the definitions of unshare() and setns() into namespace.h for supporting old versions of libc that does not provice these. I have tested this support with setns as I still have systems old enough that glibc does not wrap setns. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-01-10build-sys: add files to distributionSami Kerola1-0/+1
To fix 'make distcheck' compilation. The fdisks/Makemodule.am has one new entry 'dos_part_types.h', the rest is about sorting the list. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-08include/ttyutils: add default chardataWerner Fink1-0/+24
this one moves the init_chardata to include/ttyutils.h as well as to lib/include/ttyutils.c. Also the macros CTL/CTRL are fixed in agetty.c and sulogin.c to use the XOR variant CTL. [kzak@redhat.com: use macro rather than global variable for default chardata] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-08include: cleanup copyright headersKarel Zak8-0/+50
We use the code from include/ and lib/ on many places, so use public domain if possible or LGPL for code copied from libs. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-08include/bitopts: Use the operating system byteswapping functionsKarel Zak1-63/+97
The swap macros are already in libc. Co-Author: Cristian Rodríguez <crrodriguez@opensuse.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-27build-sys: remove consoles.hKarel Zak1-1/+0
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-23sulogin: remove consoles.c from libcommonKarel Zak2-51/+9
- 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-18sulogin: make usleep() workaround workWerner Fink1-3/+7
Simply fix a compile problem found during debugging console.c Signed-off-by: Werner Fink <werner@suse.de>
2012-12-18sulogin: use the linked lists from list.h for consoles listWerner Fink1-2/+4
with this the double linked list feature from util-linux is used instead of the single linked list. [kzak@redhat.com: use list_last_entry() and list INIT macros] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-18include/list: add list_last_entry()Karel Zak1-2/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-17include/list: fix undefined behavior in list_entry() macroSami Liedes1-2/+3
Update list_entry() macro, which is basically the same as the container_of() macro in the kernel, to use offsetof() to fix undefined behavior. Caught using clang -fsanitize=undefined. [kzak@redhat.com: port from e2fsprogs] Signed-off-by: Sami Liedes <sami.liedes@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-26lib/canonicalize: add canonicalize_path_restricted() to canonicalize without ↵Karel Zak1-0/+1
suid permisssions Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-23ipcs: determine ipc limits from /procSami Kerola1-0/+1
Some of the limit values are not dynamic. Like in kernel these values are #defined. [kzak@redhat.com: - use better names for functions, - add ipcutils.{c,h} - read also shmmax from /proc] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-23lib/path: add path_read_u64()Karel Zak1-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-23lib/path: rename functions to be more explicitKarel Zak1-6/+6
... and to have names compatible with lib/sysfs.c Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-23ipcs: add /proc and /sys path definitionsSami Kerola1-0/+11
The necessary proc and sysfs files are tested to be present. When information files are missing the ipcs will use obsolted system calls, and data structures, as fallback. [kzak@redhat.com: - fix #define _PATH_PROC_IPC_MSG "/proc/sys/kernel/sem" typo] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22lib/ttyutils: add get_terminal_name()Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22lib/ttyutils: create .c fileKarel Zak1-32/+3
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: remove global variable consolesKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-08lib/consoles: add code to detect all system consolesWerner Fink2-0/+49
Signed-off-by: Werner Fink <werner@suse.de>
2012-11-08libmount: add private mnt_get_kernel_cmdline_option()Karel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-02build-sys: cleanup cpu_set_t usageKarel Zak1-0/+10
- 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-23lib/sysfs: add SCSI link functionsKarel Zak2-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-23lib/sysfs: add functions for SCSI host attributesKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-23include/sysfs: add SCSI host:channel:target:lun supportKarel Zak1-0/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-22include/c: move usleep() fallback to c.hKarel Zak4-19/+17
To make it available everywhere in code. Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-19include/c: remove MAXHOSTNAMELEN macroKarel Zak1-11/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-19include/xalloc: add xgethostname()Karel Zak1-0/+15
The new function allocates memory by xalloc() for hostname and fill in the buffer by gethostname(). Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-19include/env: unify indentationSami Kerola1-5/+4
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-19include/c: add get_hostname_max() inline functionSami Kerola1-0/+18
Using sysconf(_SC_HOST_NAME_MAX) does not work everywhere. At such even header values for hostname length should be preferred, and if nothing else works guess the maxium being 64 bytes. Based-on-code-by: Karel Zak <kzak@redhat.com> CC: Mike Frysinger <vapier@gentoo.org> References: http://www.spinics.net/lists/util-linux-ng/msg07050.html Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-16lib/color: add module for work with terminal colorsOndrej Oprala1-0/+50
[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-09-11mount: losetup: remove obsolete encryption supportLudwig Nussel1-3/+0
kernel cryptoloop is deprecated since ages and support for cryptoloop in util-linux is incomplete/broken. - no password hashing - last 8 bit of key are always set to zero - no binary keys possible (stops reading key at \n and \0) In the past some Distros added the above features with patches. So remove cryptoloop support from util-linux completely to make sure people won't try using it. Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13lib/sysfs; add sysfs_partno_to_devno()Karel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>