This header in newer glibc defines the signatures of functions
pidfd_send_signal() and pidfd_open() and when these functions are
defined by libc then we need to include the relevant header to get
the definitions. Clang 15+ has started to error out when function
signatures are missing.
Fixes errors like
misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
pipesz is a utility to examine and adjust the size of pipe buffers.
It uses fctnl F_GETPIPE_SZ and F_SETPIPE_SZ to examine and resize
these buffers. This functionality is unique to Linux and was added in
version 2.6.35. Minor bugfixes were made in 4.9, but these do not
obviate the use of pipesz prior to that release.
Signed-off-by: Nathan Sharp <nwsharp@live.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This GPT UUID is used by BootROM on Marvell Armada 3700 SoC. BootROM
searches for GPT partition with this UUID on attached SATA disk and loads
bootloader from it.
Marvell Armada 3700 SoC is used e.g. on popular EspressoBIN SBC board which
has relatively solid Linux support.
Information about SATA booting and this GPT partition is currently
documented only in development version of ARM Trusted-Firmware-A
documentation:
https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html
It is missing in official documentation for Armada 3720 BootROM and
therefore hard to find it.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Newer versions of FreeBSD will have a glibc compatible
byteswap.h. Currently, this file assumes that FreeBSD requires
bswap{16,32,64} to always be defined. This isn't the case when we're
using the byteswap.h file (which is enabled by HAVE_BYTESWAP_H
define). Assume that if byteswap.h and endian.h are present, then the
proper macros are defined. Otherwise, assume that sys/endian.h is
present and paper over the small differences between the BSDs for this
file.
Signed-off-by: Warner Losh <imp@bsdimp.com>
If we filled the script->child buffer before the child had a chance to read any
input, we'd sleep forever in write_all(pty->master), and the child would sleep
forever in write(1<pty->slave>)
By putting the master PTY in non-blocking mode, we can poll(pty->master,
POLLOUT) and keep supplying more data as the child reads from the buffer
Fixes Debian bug #1003095
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's use the same code for strtoul_or_err() and strtol_or_err() as we
already use for strtoxXX_or_err() functions. It resolves issue with
negative numbers.
This problem has been discovered by "./eject -x -1 -v" where -x is
based on strtoul_or_err(), but accepts negative number (-1).
Reported-by: Enze Li <lienze@kylinos.cn>
Signed-off-by: Karel Zak <kzak@redhat.com>
The MBR partition type 0xF8 is used by the Arm EBBR specification for
protective partitions over fixed-location firmware images.
References: https://github.com/ARM-software/ebbr
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Vladimir Sementsov-Ogievskiy wrote:
> The commit "floppy: reintroduce O_NDELAY fix" was removed from kernel,
> so we faced the bug described and discussed here:
> https://bugzilla.suse.com/show_bug.cgi?id=3D1181018
>
> Discussion in kernel list on reverting the commit:
> https://www.spinics.net/lists/stable/msg493061.html
>
> In short, I can quote Jiri Kosina's comment:
>
> opening floppy device node with O_NONBLOCK is asking for all kinds
> of trouble
>
> So opening floppy with O_NONBLOCK in blkid leads to failure of blkid,
> probable failure of mount and unpleasant error messages in dmesg (see
> also patch 02 for details).
Based on patch from Vladimir.
CC: Jiri Kosina <jkosina@suse.cz>
Reported-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's make the function robust for work with strings and uninitialized
buffers.
Reported-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit implements an extra hint for systemd based distros to
inform users that units currently used by systemd are older than
fstab. This situation is usually unwanted, and 'systemctl
daemon-reload' is recommended.
The message is printed only on terminal to avoid extra messages in
logs, etc.
Addresses: https://github.com/systemd/systemd/pull/20476
Signed-off-by: Karel Zak <kzak@redhat.com>
It's like timercmp() in libc, but for timespec and for stat.st_mtim
(or stat.st_mtime for old struct stat versions).
Signed-off-by: Karel Zak <kzak@redhat.com>
This option is designed to handle the "garden path" user/group ID
mapping:
- The user has one big map in /etc/sub[u,g]id
- The user wants to map as many user and group IDs as they can,
especially the first 1000 users and groups.
The "auto" map is designed to handle this. We find the first map
matching the current user, and then map the whole thing to the ID range
starting at ID 0.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Some platforms do not provide sys/syscall.h. The configure script already
checks for the existance of the file. Include sys/syscall.h only in case
HAVE_SYS_SYSCALL_H has been set.
This is extension to lib/path.c (the same as lib/sysfs.c for block
devices) to read info about processes.
* replaces code from lib/procutils.c
* remove proc_{open,close}_processes(), opendir and readdir is good enough
* add procfs_dirent_*() functions to work with readdir() from /proc
* add new path_cxt based API (will be extended in next commits) for
complex tasks
Signed-off-by: Karel Zak <kzak@redhat.com>
Both HiFive Unleashed and HiFive Unmatched bootloaders seek for the same
UUIDs to load the next stage bootloader: the current name makes partitions
on Unmatched board appear as 'Unleashed'.
Fix that by removing the 'Unleashed' part of the current naming so it
fits both.
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Call this function everytime after changing either relative LBA partition
offset or LBA partition size to ensure that CHS values are in sync with
LBA.
This should fix partition CHS values after moving or deleting partition.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>