An empty entry is a valid type of wtmp entry. It means that an empty file or file with zeros is not interpreted as an error.
-The utmp file format uses fixed sizes of strings, which means that very long strings are impossible to store in the file and impossible to display by last. The usual limits are 32 bytes for a user and line name and 256 bytes for a hostname.
+The utmp file format uses fixed sizes of strings, which means that very long strings are impossible to store in the file and impossible to display by *last*. The usual limits are 32 bytes for a user and line name and 256 bytes for a hostname.
== AUTHORS
to fit a number of cached content checksums.
*-d*, *--respect-dir*::
-Only try to link files with the same directory name. The top-level directory (as specified on the hardlink command line) is ignored. For example, *hardlink --respect-dir /foo /bar* will link /foo/some/file with /bar/some/file, but not /bar/other/file. If combined with *--respect-name*, then entire paths (except the top-level directory) are compared.
+Only try to link files with the same directory name. The top-level directory (as specified on the hardlink command line) is ignored. For example, *hardlink --respect-dir /foo /bar* will link _/foo/some/file_ with _/bar/some/file_, but not _/bar/other/file_. If combined with *--respect-name*, then entire paths (except the top-level directory) are compared.
*-f*, *--respect-name*::
Only try to link files with the same (base)name. It's strongly recommended to use long options rather than *-f* which is interpreted in a different way by other *hardlink* implementations.
Listening socket.
SOCK.NETS <``number``>::
-Inode identifying network namespace where the socket belogs to.
+Inode identifying network namespace where the socket belongs to.
SOCK.PROTONAME <``string``>::
Protocol name.
File system, partition, or device containing the file.
STTYPE <``string``>::
-Raw file types returned from stat(2): BLK, CHR, DIR, FIFO, LINK, REG, SOCK, or UNKN.
+Raw file types returned from *stat*(2): BLK, CHR, DIR, FIFO, LINK, REG, SOCK, or UNKN.
TCP.LADDR <``string``>::
Local L3 (INET.LADDR or INET6.LADDR) address and local TCP port.
*-Z*, *--context*::
Show security context of the file or "?" if not available.
-The support for security contexts is optional and does not have to be compiled to the namei.
+The support for security contexts is optional and does not have to be compiled to the *namei* binary.
include::man-common/help-version.adoc[]
*taskset -p* _mask pid_
//TRANSLATORS: Keep {colon} untranslated.
-When a cpu-list is specified for an existing process, the 'p' and 'c' options must be grouped together{colon}::
+When a cpu-list is specified for an existing process, the *-p* and *-c* options must be grouped together{colon}::
*taskset -pc* _cpu-list pid_
//TRANSLATORS: Keep {colon} untranslated.
== RETURN VALUE
-*Taskset* returns 0 in its affinity-getting mode as long as the provided PID exists.
+*taskset* returns 0 in its affinity-getting mode as long as the provided PID exists.
-*Taskset* returns 0 in its affinity-setting mode as long as the underlying *sched_setaffinity()* system call does. The success of the command does not guarantee that the specified thread has actually migrated to the indicated CPU(s), but only that the thread will not migrate to a CPU outside the new affinity mask. For example, the affinity of the kernel thread kswapd can be set, but the thread may not immediately migrate and is not guaranteed to ever do so:
+*taskset* returns 0 in its affinity-setting mode as long as the underlying *sched_setaffinity*(2) system call does. The success of the command does not guarantee that the specified thread has actually migrated to the indicated CPU(s), but only that the thread will not migrate to a CPU outside the new affinity mask. For example, the affinity of the kernel thread kswapd can be set, but the thread may not immediately migrate and is not guaranteed to ever do so:
$ ps ax -o comm,psr,pid | grep kswapd +
kswapd0 4 82 +
This field describes the mount options associated with the filesystem.
-It is formatted as a comma-separated list of options and is optional for mount(8) or swapon(8). The usual convention is to use at least "defaults" keyword there.
+It is formatted as a comma-separated list of options and is optional for *mount*(8) or *swapon*(8). The usual convention is to use at least "defaults" keyword there.
It usually contains the type of mount (*ro* or *rw*, the default is *rw*), plus any additional options appropriate to the filesystem type (including performance-tuning options). For details, see *mount*(8) or *swapon*(8).
Basic filesystem-independent options are:
*defaults*::
-use default options. The default depends on the kernel and the filesystem. mount(8) does not have any hardcoded set of default options. The kernel default is usually rw, suid, dev, exec, auto, nouser, and async.
+use default options. The default depends on the kernel and the filesystem. *mount*(8) does not have any hardcoded set of default options. The kernel default is usually rw, suid, dev, exec, auto, nouser, and async.
*noauto*::
do not mount when *mount -a* is given (e.g., at boot time)
*user*::
return NULL;
}
-static struct clock_ops cmos_interface = {
+static const struct clock_ops cmos_interface = {
N_("Using direct ISA access to the clock"),
get_permissions_cmos,
read_hardware_clock_cmos,
/*
* return &cmos if cmos clock present, NULL otherwise.
*/
-struct clock_ops *probe_for_cmos_clock(void)
+const struct clock_ops *probe_for_cmos_clock(void)
{
return &cmos_interface;
}
*/
#include <asm/ioctl.h>
#include <errno.h>
+#include <linux/rtc.h>
+#include <linux/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include "hwclock.h"
-/*
- * Get defines for rtc stuff.
- *
- * Getting the rtc defines is nontrivial. The obvious way is by including
- * <linux/mc146818rtc.h> but that again includes <asm/io.h> which again
- * includes ... and on sparc and alpha this gives compilation errors for
- * many kernel versions. So, we give the defines ourselves here. Moreover,
- * some Sparc person decided to be incompatible, and used a struct rtc_time
- * different from that used in mc146818rtc.h.
- */
-
-/*
- * On Sparcs, there is a <asm/rtc.h> that defines different ioctls (that are
- * required on my machine). However, this include file does not exist on
- * other architectures.
- */
-/* One might do:
-#ifdef __sparc__
-# include <asm/rtc.h>
-#endif
- */
-#ifdef __sparc__
-/* The following is roughly equivalent */
-struct sparc_rtc_time
-{
- int sec; /* Seconds 0-59 */
- int min; /* Minutes 0-59 */
- int hour; /* Hour 0-23 */
- int dow; /* Day of the week 1-7 */
- int dom; /* Day of the month 1-31 */
- int month; /* Month of year 1-12 */
- int year; /* Year 0-99 */
-};
-#define RTCGET _IOR('p', 20, struct sparc_rtc_time)
-#define RTCSET _IOW('p', 21, struct sparc_rtc_time)
-#endif
-
-/*
- * struct rtc_time is present since 1.3.99.
- * Earlier (since 1.3.89), a struct tm was used.
- */
-struct linux_rtc_time {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
-};
-
-/* RTC_RD_TIME etc have this definition since 1.99.9 (pre2.0-9) */
-#ifndef RTC_RD_TIME
-# define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time)
-# define RTC_SET_TIME _IOW('p', 0x0a, struct linux_rtc_time)
-# define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */
-# define RTC_UIE_OFF _IO('p', 0x04) /* Update int. enable off */
-#endif
-
-/* RTC_EPOCH_READ and RTC_EPOCH_SET are present since 2.0.34 and 2.1.89 */
-#ifndef RTC_EPOCH_READ
-# define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
-# define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
-#endif
-
#ifndef RTC_PARAM_GET
struct rtc_param {
- uint64_t param;
+ __u64 param;
union {
- uint64_t uvalue;
- int64_t svalue;
- uint64_t ptr;
+ __u64 uvalue;
+ __s64 svalue;
+ __u64 ptr;
};
- uint32_t index;
- uint32_t __pad;
+ __u32 index;
+ __u32 __pad;
};
# define RTC_PARAM_GET _IOW('p', 0x13, struct rtc_param)
static int open_rtc(const struct hwclock_control *ctl)
{
- static const char *fls[] = {
+ static const char * const fls[] = {
#ifdef __ia64__
"/dev/efirtc",
"/dev/misc/efirtc",
static int do_rtc_read_ioctl(int rtc_fd, struct tm *tm)
{
int rc = -1;
- char *ioctlname;
-#ifdef __sparc__
- /* some but not all sparcs use a different ioctl and struct */
- struct sparc_rtc_time stm;
-#endif
- ioctlname = "RTC_RD_TIME";
rc = ioctl(rtc_fd, RTC_RD_TIME, tm);
-#ifdef __sparc__
- if (rc == -1) { /* sparc sbus */
- ioctlname = "RTCGET";
- rc = ioctl(rtc_fd, RTCGET, &stm);
- if (rc == 0) {
- tm->tm_sec = stm.sec;
- tm->tm_min = stm.min;
- tm->tm_hour = stm.hour;
- tm->tm_mday = stm.dom;
- tm->tm_mon = stm.month - 1;
- tm->tm_year = stm.year - 1900;
- tm->tm_wday = stm.dow - 1;
- tm->tm_yday = -1; /* day in the year */
- }
- }
-#endif
-
if (rc == -1) {
- warn(_("ioctl(%s) to %s to read the time failed"),
- ioctlname, rtc_dev_name);
+ warn(_("ioctl(RTC_RD_NAME) to %s to read the time failed"),
+ rtc_dev_name);
return -1;
}
{
int rc = -1;
int rtc_fd;
- char *ioctlname;
rtc_fd = open_rtc_or_exit(ctl);
- ioctlname = "RTC_SET_TIME";
rc = ioctl(rtc_fd, RTC_SET_TIME, new_broken_time);
-#ifdef __sparc__
- if (rc == -1) { /* sparc sbus */
- struct sparc_rtc_time stm;
-
- stm.sec = new_broken_time->tm_sec;
- stm.min = new_broken_time->tm_min;
- stm.hour = new_broken_time->tm_hour;
- stm.dom = new_broken_time->tm_mday;
- stm.month = new_broken_time->tm_mon + 1;
- stm.year = new_broken_time->tm_year + 1900;
- stm.dow = new_broken_time->tm_wday + 1;
-
- ioctlname = "RTCSET";
- rc = ioctl(rtc_fd, RTCSET, &stm);
- }
-#endif
-
if (rc == -1) {
- warn(_("ioctl(%s) to %s to set the time failed"),
- ioctlname, rtc_dev_name);
+ warn(_("ioctl(RTC_SET_TIME) to %s to set the time failed"),
+ rtc_dev_name);
hwclock_exit(ctl, EXIT_FAILURE);
}
if (ctl->verbose)
- printf(_("ioctl(%s) was successful.\n"), ioctlname);
+ printf(_("ioctl(RTC_SET_TIME) was successful.\n"));
return 0;
}
return rtc_dev_name;
}
-static struct clock_ops rtc_interface = {
+static const struct clock_ops rtc_interface = {
N_("Using the rtc interface to the clock."),
get_permissions_rtc,
read_hardware_clock_rtc,
};
/* return &rtc if /dev/rtc can be opened, NULL otherwise */
-struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl)
+const struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl)
{
const int rtc_fd = open_rtc(ctl);
-static int resolve_rtc_param_alias(const char *alias, uint64_t *value)
+static int resolve_rtc_param_alias(const char *alias, __u64 *value)
{
const struct hwclock_param *param = &hwclock_params[0];
return 1;
}
+/* kernel uapi __u64 can be defined differently than uint64_t */
+static int strtoku64(const char *str, __u64 *num, int base)
+{
+ return ul_strtou64(str, (uint64_t *) &num, base);
+}
+
/*
* Get the Hardware Clock parameter setting from the kernel.
*/
/* handle name */
if (resolve_rtc_param_alias(name, ¶m.param) != 0
- && ul_strtou64(name, ¶m.param, 0) != 0) {
+ && strtoku64(name, ¶m.param, 0) != 0) {
warnx(_("could not convert parameter name to number"));
return 1;
}
/* handle name */
tok = strtok(opt, "=");
if (resolve_rtc_param_alias(tok, ¶m.param) != 0
- && ul_strtou64(tok, ¶m.param, 0) != 0) {
+ && strtoku64(tok, ¶m.param, 0) != 0) {
warnx(_("could not convert parameter name to number"));
goto done;
}
warnx(_("expected <param>=<value>"));
goto done;
}
- if (ul_strtou64(tok, ¶m.uvalue, 0) != 0) {
+ if (strtoku64(tok, ¶m.uvalue, 0) != 0) {
warnx(_("could not convert parameter value to number"));
goto done;
}
UL_DEBUG_DEFINE_MASKNAMES(hwclock) = UL_DEBUG_EMPTY_MASKNAMES;
/* The struct that holds our hardware access routines */
-static struct clock_ops *ur;
+static const struct clock_ops *ur;
/* Maximal clock adjustment in seconds per day.
(adjtime() glibc call has 2145 seconds limit on i386, so it is good enough for us as well,
const char *(*get_device_path) (void);
};
-extern struct clock_ops *probe_for_cmos_clock(void);
-extern struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl);
+extern const struct clock_ops *probe_for_cmos_clock(void);
+extern const struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl);
/* hwclock.c */
extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
Note that a read-only bind will create a read-only mountpoint (VFS entry), but the original filesystem superblock will still be writable, meaning that the _olddir_ will be writable, but the _newdir_ will be read-only.
-It's also possible to change nosuid, nodev, noexec, noatime, nodiratime, relatime and nosymfollow VFS entry flags via a "remount,bind" operation. The other flags (for example filesystem-specific flags) are silently ignored. The classic mount(2) system call does not allow to change mount options recursively (for example with *-o rbind,ro*). The recursive semantic is possible with a new mount_setattr(2) kernel system call and it's supported since libmount from util-linux v2.39 by a new experimental "recursive" option argument (e.g. *-o rbind,ro=recursive*). For more details see the *FILESYSTEM-INDEPENDENT MOUNT OPTIONS* section for more details.
+It's also possible to change nosuid, nodev, noexec, noatime, nodiratime, relatime and nosymfollow VFS entry flags via a "remount,bind" operation. The other flags (for example filesystem-specific flags) are silently ignored. The classic *mount*(2) system call does not allow to change mount options recursively (for example with *-o rbind,ro*). The recursive semantic is possible with a new *mount_setattr*(2) kernel system call and it's supported since libmount from util-linux v2.39 by a new experimental "recursive" option argument (e.g. *-o rbind,ro=recursive*). For more details see the *FILESYSTEM-INDEPENDENT MOUNT OPTIONS* section.
Since util-linux 2.31, *mount* ignores the *bind* flag from _/etc/fstab_ on a *remount* operation (if *-o remount* is specified on command line). This is necessary to fully control mount options on remount by command line. In previous versions the bind flag has been always applied and it was impossible to re-define mount options without interaction with the bind semantic. This *mount* behavior does not affect situations when "remount,bind" is specified in the _/etc/fstab_ file.
to get a complete overview of filesystems and VFS options.
The read-only setting (*ro* or *rw*) is interpreted by VFS and the filesystem
-and depends on how the option is specified on the mount(8) command line. The
+and depends on how the option is specified on the *mount*(8) command line. The
default is to interpret it on the filesystem level. The operation "-o bind,remount,ro"
is applied only to the VFS mountpoint, and operation "-o remount,ro" is applied to
VFS and filesystem superblock. This semantic allows create a read-only
--- /dev/null
+#!/bin/bash
+
+#
+# Copyright (C) 2023 Thomas Weißschuh <thomas@t-8ch.de>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="show"
+
+. "$TS_TOPDIR"/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_HWCLOCK"
+
+ts_skip_nonroot
+ts_skip_qemu_user
+
+"$TS_CMD_HWCLOCK" --show > /dev/null 2> "$TS_ERRLOG" || ts_die
+
+ts_finalize
*-C, --table-column* _properties_::
Define one column by comma separated list of column attributes.
This option can be used more than once, every use defines just one column.
-The properties replace some of --table- options. For example *--table-column
+The properties replace some of *--table-* options. For example *--table-column
name=FOO,right* define one column where text is aligned to right. The option is
mutually exclusive to *--table-columns*.
+