commit 1447fd3e0b2acca6e0ecc67956f93e6f563b81e4 parent 3509d9b0ff6e82ff7467f71c0a149eee1cc860a0 Author: xplshn <anto@xplshn.com.ar> Date: Tue, 24 Nov 2026 14:59:50 -0300 backends: _posix, not _other Diffstat:
54 files changed, 812 insertions(+), 812 deletions(-)
diff --git a/cmd/dev/cc/ospredef_darwin.c b/cmd/dev/cc/ospredef_darwin.c @@ -3,7 +3,7 @@ #include "util.h" #include "cc.h" -#if defined(__APPLE__) && !defined(ARUU_FORCE_OTHER) +#if defined(__APPLE__) && !defined(ARUU_FORCE_POSIX) const char ospredef[] = "#define __APPLE__ 1\n" "#define __unix__ 1\n"; #endif diff --git a/cmd/dev/cc/ospredef_freebsd.c b/cmd/dev/cc/ospredef_freebsd.c @@ -3,7 +3,7 @@ #include "util.h" #include "cc.h" -#if defined(__FreeBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__FreeBSD__) && !defined(ARUU_FORCE_POSIX) const char ospredef[] = "#define __FreeBSD__ 1\n" "#define __unix__ 1\n"; #endif diff --git a/cmd/dev/cc/ospredef_linux.c b/cmd/dev/cc/ospredef_linux.c @@ -3,7 +3,7 @@ #include "util.h" #include "cc.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) const char ospredef[] = "#define __linux__ 1\n" "#define __unix__ 1\n"; #endif diff --git a/cmd/dev/cc/ospredef_netbsd.c b/cmd/dev/cc/ospredef_netbsd.c @@ -3,7 +3,7 @@ #include "util.h" #include "cc.h" -#if defined(__NetBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__NetBSD__) && !defined(ARUU_FORCE_POSIX) const char ospredef[] = "#define __NetBSD__ 1\n" "#define __unix__ 1\n"; #endif diff --git a/cmd/dev/cc/ospredef_openbsd.c b/cmd/dev/cc/ospredef_openbsd.c @@ -3,7 +3,7 @@ #include "util.h" #include "cc.h" -#if defined(__OpenBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__OpenBSD__) && !defined(ARUU_FORCE_POSIX) const char ospredef[] = "#define __OpenBSD__ 1\n" "#define __unix__ 1\n"; #endif diff --git a/cmd/dev/cc/ospredef_other.c b/cmd/dev/cc/ospredef_other.c @@ -1,11 +0,0 @@ -/* see license file for copyright and license details */ -#include <stdbool.h> -#include "util.h" -#include "cc.h" - -/* a system with no file of its own is taken for some unix */ -#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \ - || defined(__APPLE__)) \ - || defined(ARUU_FORCE_OTHER) -const char ospredef[] = "#define __unix__ 1\n"; -#endif diff --git a/cmd/dev/cc/ospredef_posix.c b/cmd/dev/cc/ospredef_posix.c @@ -0,0 +1,11 @@ +/* see license file for copyright and license details */ +#include <stdbool.h> +#include "util.h" +#include "cc.h" + +/* a system with no file of its own is taken for some unix */ +#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \ + || defined(__APPLE__)) \ + || defined(ARUU_FORCE_POSIX) +const char ospredef[] = "#define __unix__ 1\n"; +#endif diff --git a/ninqu.rules b/ninqu.rules @@ -41,19 +41,19 @@ (rule LIBUTIL_OBJ (glob "shared/libutil/*.c") (skip "diskutil_freebsd.c" "diskutil_linux.c" "diskutil_netbsd.c" - "diskutil_openbsd.c" "diskutil_other.c" - "filesystem_linux.c" "filesystem_other.c" + "diskutil_openbsd.c" "diskutil_posix.c" + "filesystem_linux.c" "filesystem_posix.c" "getopt_darwin.c" "getopt_dragonfly.c" "getopt_freebsd.c" - "getopt_linux.c" "getopt_netbsd.c" "getopt_openbsd.c" "getopt_other.c" - "net_linux.c" "net_other.c" + "getopt_linux.c" "getopt_netbsd.c" "getopt_openbsd.c" "getopt_posix.c" + "net_linux.c" "net_posix.c" "passwd_dragonfly.c" "passwd_freebsd.c" "passwd_linux.c" - "passwd_netbsd.c" "passwd_openbsd.c" "passwd_other.c" - "proc_linux.c" "proc_other.c" - "reboot_linux.c" "reboot_other.c" - "session_linux.c" "session_other.c" - "sysinfo_linux.c" "sysinfo_other.c" - "timer_linux.c" "timer_other.c" - "tty_linux.c" "tty_other.c") + "passwd_netbsd.c" "passwd_openbsd.c" "passwd_posix.c" + "proc_linux.c" "proc_posix.c" + "reboot_linux.c" "reboot_posix.c" + "session_linux.c" "session_posix.c" + "sysinfo_linux.c" "sysinfo_posix.c" + "timer_linux.c" "timer_posix.c" + "tty_linux.c" "tty_posix.c") (dep $(MATCH) FEATURES_H) (after NOFORK_LIST_H) (out "$(STEM).o") @@ -64,36 +64,36 @@ "shared/libutil/diskutil_linux.c" "shared/libutil/diskutil_netbsd.c" "shared/libutil/diskutil_openbsd.c" - "shared/libutil/diskutil_other.c" + "shared/libutil/diskutil_posix.c" "shared/libutil/filesystem_linux.c" - "shared/libutil/filesystem_other.c" + "shared/libutil/filesystem_posix.c" "shared/libutil/getopt_darwin.c" "shared/libutil/getopt_dragonfly.c" "shared/libutil/getopt_freebsd.c" "shared/libutil/getopt_linux.c" "shared/libutil/getopt_netbsd.c" "shared/libutil/getopt_openbsd.c" - "shared/libutil/getopt_other.c" + "shared/libutil/getopt_posix.c" "shared/libutil/net_linux.c" - "shared/libutil/net_other.c" + "shared/libutil/net_posix.c" "shared/libutil/passwd_dragonfly.c" "shared/libutil/passwd_freebsd.c" "shared/libutil/passwd_linux.c" "shared/libutil/passwd_netbsd.c" "shared/libutil/passwd_openbsd.c" - "shared/libutil/passwd_other.c" + "shared/libutil/passwd_posix.c" "shared/libutil/proc_linux.c" - "shared/libutil/proc_other.c" + "shared/libutil/proc_posix.c" "shared/libutil/reboot_linux.c" - "shared/libutil/reboot_other.c" + "shared/libutil/reboot_posix.c" "shared/libutil/session_linux.c" - "shared/libutil/session_other.c" + "shared/libutil/session_posix.c" "shared/libutil/sysinfo_linux.c" - "shared/libutil/sysinfo_other.c" + "shared/libutil/sysinfo_posix.c" "shared/libutil/timer_linux.c" - "shared/libutil/timer_other.c" + "shared/libutil/timer_posix.c" "shared/libutil/tty_linux.c" - "shared/libutil/tty_other.c") + "shared/libutil/tty_posix.c") (dep $(MATCH) "shared/diskutil.h" "shared/filesystem.h" "shared/net.h" "shared/passwd.h" "shared/proc.h" "shared/reboot.h" "shared/session.h" "shared/sysinfo.h" "shared/timer.h" "shared/util.h" FEATURES_H) diff --git a/shared/libutil/diskutil_freebsd.c b/shared/libutil/diskutil_freebsd.c @@ -2,7 +2,7 @@ #include "../diskutil.h" #include "../util.h" -#if defined(__FreeBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__FreeBSD__) && !defined(ARUU_FORCE_POSIX) #include <dirent.h> #include <stdio.h> #include <stdlib.h> diff --git a/shared/libutil/diskutil_linux.c b/shared/libutil/diskutil_linux.c @@ -2,7 +2,7 @@ #include "../diskutil.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <linux/fs.h> #include <stdio.h> #include <stdlib.h> diff --git a/shared/libutil/diskutil_netbsd.c b/shared/libutil/diskutil_netbsd.c @@ -1,7 +1,7 @@ /* see LICENSE file for copyright and license details */ #include "../diskutil.h" -#if defined(__NetBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__NetBSD__) && !defined(ARUU_FORCE_POSIX) #include <sys/types.h> #include <sys/disklabel.h> #include <sys/dkio.h> diff --git a/shared/libutil/diskutil_openbsd.c b/shared/libutil/diskutil_openbsd.c @@ -2,7 +2,7 @@ #include "../diskutil.h" #include "../util.h" -#if defined(__OpenBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__OpenBSD__) && !defined(ARUU_FORCE_POSIX) #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/shared/libutil/diskutil_other.c b/shared/libutil/diskutil_other.c @@ -1,25 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../diskutil.h" - -/* a kernel with no backend: a device's size is what fstat says, and the - * list of disks is what opens under the names most systems give them */ -#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) \ - || defined(ARUU_FORCE_OTHER) -void -blockdev_sys_size(struct BlockDev *dev) -{ - (void)dev; -} - -void -blockdev_sys_reread(struct BlockDev *dev) -{ - (void)dev; -} - -struct BlockDevInfo * -blockdev_get_list(void) -{ - return blockdev_probe_list(); -} -#endif diff --git a/shared/libutil/diskutil_posix.c b/shared/libutil/diskutil_posix.c @@ -0,0 +1,25 @@ +/* see LICENSE file for copyright and license details */ +#include "../diskutil.h" + +/* a kernel with no backend: a device's size is what fstat says, and the + * list of disks is what opens under the names most systems give them */ +#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) \ + || defined(ARUU_FORCE_POSIX) +void +blockdev_sys_size(struct BlockDev *dev) +{ + (void)dev; +} + +void +blockdev_sys_reread(struct BlockDev *dev) +{ + (void)dev; +} + +struct BlockDevInfo * +blockdev_get_list(void) +{ + return blockdev_probe_list(); +} +#endif diff --git a/shared/libutil/filesystem_linux.c b/shared/libutil/filesystem_linux.c @@ -5,7 +5,7 @@ #include "../paths.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <mntent.h> #include <stdio.h> #include <stdlib.h> diff --git a/shared/libutil/filesystem_other.c b/shared/libutil/filesystem_other.c @@ -1,93 +0,0 @@ -#include "../filesystem.h" - -#include <errno.h> -#include <string.h> -#include <sys/statvfs.h> -#include <sys/types.h> - -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -int -fs_get_status(const char *path, struct FilesystemStatus *status) -{ - (void)path; - memset(status, 0, sizeof(*status)); - errno = ENOTSUP; - return -1; -} - -int -fs_get_mounts(struct FilesystemMount **mounts, size_t *count) -{ - *mounts = NULL; - *count = 0; - errno = ENOTSUP; - return -1; -} - -void -fs_free_mounts(struct FilesystemMount *mounts, size_t count) -{ - (void)mounts; - (void)count; -} - -/* sys/types.h has them on most systems. without them, the split of - * the first unixes: 8 bits each */ -unsigned int -fs_devmajor(dev_t dev) -{ -#if defined(major) - return major(dev); -#else - return ((unsigned int)dev >> 8) & 0xff; -#endif -} - -unsigned int -fs_devminor(dev_t dev) -{ -#if defined(minor) - return minor(dev); -#else - return (unsigned int)dev & 0xff; -#endif -} - -dev_t -fs_makedev(unsigned int ma, unsigned int mi) -{ -#if defined(makedev) - return makedev(ma, mi); -#else - return (dev_t)((ma & 0xff) << 8 | (mi & 0xff)); -#endif -} - -/* statvfs is what posix has: no number for the kind of filesystem */ -int -fs_get_info(const char *path, int fd, struct FilesystemInfo *info) -{ - struct statvfs st; - - if ((path ? statvfs(path, &st) : fstatvfs(fd, &st)) < 0) - return -1; - info->id = st.f_fsid; - info->namelen = st.f_namemax; - info->type = 0; - info->bsize = st.f_bsize; - info->frsize = st.f_frsize; - info->blocks = st.f_blocks; - info->bfree = st.f_bfree; - info->bavail = st.f_bavail; - info->files = st.f_files; - info->ffree = st.f_ffree; - return 0; -} - -const char * -fs_type_name(long type) -{ - (void)type; - return "unknown"; -} -#endif diff --git a/shared/libutil/filesystem_posix.c b/shared/libutil/filesystem_posix.c @@ -0,0 +1,93 @@ +#include "../filesystem.h" + +#include <errno.h> +#include <string.h> +#include <sys/statvfs.h> +#include <sys/types.h> + +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +int +fs_get_status(const char *path, struct FilesystemStatus *status) +{ + (void)path; + memset(status, 0, sizeof(*status)); + errno = ENOTSUP; + return -1; +} + +int +fs_get_mounts(struct FilesystemMount **mounts, size_t *count) +{ + *mounts = NULL; + *count = 0; + errno = ENOTSUP; + return -1; +} + +void +fs_free_mounts(struct FilesystemMount *mounts, size_t count) +{ + (void)mounts; + (void)count; +} + +/* sys/types.h has them on most systems. without them, the split of + * the first unixes: 8 bits each */ +unsigned int +fs_devmajor(dev_t dev) +{ +#if defined(major) + return major(dev); +#else + return ((unsigned int)dev >> 8) & 0xff; +#endif +} + +unsigned int +fs_devminor(dev_t dev) +{ +#if defined(minor) + return minor(dev); +#else + return (unsigned int)dev & 0xff; +#endif +} + +dev_t +fs_makedev(unsigned int ma, unsigned int mi) +{ +#if defined(makedev) + return makedev(ma, mi); +#else + return (dev_t)((ma & 0xff) << 8 | (mi & 0xff)); +#endif +} + +/* statvfs is what posix has: no number for the kind of filesystem */ +int +fs_get_info(const char *path, int fd, struct FilesystemInfo *info) +{ + struct statvfs st; + + if ((path ? statvfs(path, &st) : fstatvfs(fd, &st)) < 0) + return -1; + info->id = st.f_fsid; + info->namelen = st.f_namemax; + info->type = 0; + info->bsize = st.f_bsize; + info->frsize = st.f_frsize; + info->blocks = st.f_blocks; + info->bfree = st.f_bfree; + info->bavail = st.f_bavail; + info->files = st.f_files; + info->ffree = st.f_ffree; + return 0; +} + +const char * +fs_type_name(long type) +{ + (void)type; + return "unknown"; +} +#endif diff --git a/shared/libutil/getopt_darwin.c b/shared/libutil/getopt_darwin.c @@ -3,7 +3,7 @@ #include <unistd.h> -#if defined(__APPLE__) && !defined(ARUU_FORCE_OTHER) +#if defined(__APPLE__) && !defined(ARUU_FORCE_POSIX) extern int optreset; void diff --git a/shared/libutil/getopt_dragonfly.c b/shared/libutil/getopt_dragonfly.c @@ -3,7 +3,7 @@ #include <unistd.h> -#if defined(__DragonFly__) && !defined(ARUU_FORCE_OTHER) +#if defined(__DragonFly__) && !defined(ARUU_FORCE_POSIX) extern int optreset; void diff --git a/shared/libutil/getopt_freebsd.c b/shared/libutil/getopt_freebsd.c @@ -3,7 +3,7 @@ #include <unistd.h> -#if defined(__FreeBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__FreeBSD__) && !defined(ARUU_FORCE_POSIX) extern int optreset; void diff --git a/shared/libutil/getopt_linux.c b/shared/libutil/getopt_linux.c @@ -4,7 +4,7 @@ #include <unistd.h> /* glibc and musl both start over when optind is 0 */ -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) void getopt_reset(void) { diff --git a/shared/libutil/getopt_netbsd.c b/shared/libutil/getopt_netbsd.c @@ -3,7 +3,7 @@ #include <unistd.h> -#if defined(__NetBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__NetBSD__) && !defined(ARUU_FORCE_POSIX) extern int optreset; void diff --git a/shared/libutil/getopt_openbsd.c b/shared/libutil/getopt_openbsd.c @@ -3,7 +3,7 @@ #include <unistd.h> -#if defined(__OpenBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__OpenBSD__) && !defined(ARUU_FORCE_POSIX) extern int optreset; void diff --git a/shared/libutil/getopt_other.c b/shared/libutil/getopt_other.c @@ -1,15 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../util.h" - -#include <unistd.h> - -/* the one reset posix names */ -#if !(defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) \ - || defined(__OpenBSD__) || defined(__APPLE__)) \ - || defined(ARUU_FORCE_OTHER) -void -getopt_reset(void) -{ - optind = 1; -} -#endif diff --git a/shared/libutil/getopt_posix.c b/shared/libutil/getopt_posix.c @@ -0,0 +1,15 @@ +/* see LICENSE file for copyright and license details */ +#include "../util.h" + +#include <unistd.h> + +/* the one reset posix names */ +#if !(defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) \ + || defined(__OpenBSD__) || defined(__APPLE__)) \ + || defined(ARUU_FORCE_POSIX) +void +getopt_reset(void) +{ + optind = 1; +} +#endif diff --git a/shared/libutil/net_linux.c b/shared/libutil/net_linux.c @@ -5,7 +5,7 @@ #include "../paths.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <arpa/inet.h> #include <ctype.h> #include <errno.h> diff --git a/shared/libutil/net_other.c b/shared/libutil/net_other.c @@ -1,239 +0,0 @@ -#include "../net.h" - -#include <errno.h> -#include <stddef.h> - -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -int -net_get_interfaces(struct NetInterface **ifaces, int *count) -{ - *ifaces = NULL; - *count = 0; - errno = ENOTSUP; - return -1; -} - -int -net_get_routes(struct NetRoute **routes, int *count) -{ - *routes = NULL; - *count = 0; - errno = ENOTSUP; - return -1; -} - -int -net_get_stats(const char *ifname, struct NetStats *stats) -{ - (void)ifname; - (void)stats; - errno = ENOTSUP; - return -1; -} - -int -net_set_flags(const char *name, unsigned int flags, int set) -{ - (void)name; - (void)flags; - (void)set; - errno = ENOTSUP; - return -1; -} - -int -net_set_mtu(const char *name, int mtu) -{ - (void)name; - (void)mtu; - errno = ENOTSUP; - return -1; -} - -int -net_set_metric(const char *name, int metric) -{ - (void)name; - (void)metric; - errno = ENOTSUP; - return -1; -} - -int -net_set_mac(const char *name, const unsigned char *mac) -{ - (void)name; - (void)mac; - errno = ENOTSUP; - return -1; -} - -int -net_set_mask(const char *name, const char *mask) -{ - (void)name; - (void)mask; - errno = ENOTSUP; - return -1; -} - -int -net_set_broadcast(const char *name, const char *broadcast) -{ - (void)name; - (void)broadcast; - errno = ENOTSUP; - return -1; -} - -int -net_set_dstaddr(const char *name, const char *dstaddr) -{ - (void)name; - (void)dstaddr; - errno = ENOTSUP; - return -1; -} - -int -net_add_addr(const char *name, const char *addr, int prefix) -{ - (void)name; - (void)addr; - (void)prefix; - errno = ENOTSUP; - return -1; -} - -int -net_del_addr(const char *name, const char *addr, int prefix) -{ - (void)name; - (void)addr; - (void)prefix; - errno = ENOTSUP; - return -1; -} - -int -net_add_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) -{ - (void)dst; - (void)gateway; - (void)dev; - (void)prefix; - (void)metric; - errno = ENOTSUP; - return -1; -} - -int -net_del_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) -{ - (void)dst; - (void)gateway; - (void)dev; - (void)prefix; - (void)metric; - errno = ENOTSUP; - return -1; -} - -int -net_flush_addrs(const char *dev) -{ - (void)dev; - errno = ENOTSUP; - return -1; -} - -int -net_set_txqueuelen(const char *name, int qlen) -{ - (void)name; - (void)qlen; - errno = ENOTSUP; - return -1; -} - -int -net_set_name(const char *name, const char *newname) -{ - (void)name; - (void)newname; - errno = ENOTSUP; - return -1; -} - -int -net_tun_open(void) -{ - errno = ENOTSUP; - return -1; -} - -int -net_tun_attach(int fd, char *name, size_t namesz, int tap) -{ - (void)fd; - (void)name; - (void)namesz; - (void)tap; - errno = ENOTSUP; - return -1; -} - -int -net_tun_persist(int fd, int on) -{ - (void)fd; - (void)on; - errno = ENOTSUP; - return -1; -} - -int -net_tun_owner(int fd, uid_t uid) -{ - (void)fd; - (void)uid; - errno = ENOTSUP; - return -1; -} - -int -net_bind_device(int fd, const char *name) -{ - (void)fd; - (void)name; - errno = ENOTSUP; - return -1; -} - -int -net_get_hwaddr(int fd, const char *name, unsigned char *mac, size_t n) -{ - (void)fd; - (void)name; - (void)mac; - (void)n; - errno = ENOTSUP; - return -1; -} - -int -net_set_lease( - const char *name, - const unsigned char ip[4], - const unsigned char mask[4], - const unsigned char gw[4] -) -{ - (void)name; - (void)ip; - (void)mask; - (void)gw; - errno = ENOTSUP; - return -1; -} -#endif diff --git a/shared/libutil/net_posix.c b/shared/libutil/net_posix.c @@ -0,0 +1,239 @@ +#include "../net.h" + +#include <errno.h> +#include <stddef.h> + +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +int +net_get_interfaces(struct NetInterface **ifaces, int *count) +{ + *ifaces = NULL; + *count = 0; + errno = ENOTSUP; + return -1; +} + +int +net_get_routes(struct NetRoute **routes, int *count) +{ + *routes = NULL; + *count = 0; + errno = ENOTSUP; + return -1; +} + +int +net_get_stats(const char *ifname, struct NetStats *stats) +{ + (void)ifname; + (void)stats; + errno = ENOTSUP; + return -1; +} + +int +net_set_flags(const char *name, unsigned int flags, int set) +{ + (void)name; + (void)flags; + (void)set; + errno = ENOTSUP; + return -1; +} + +int +net_set_mtu(const char *name, int mtu) +{ + (void)name; + (void)mtu; + errno = ENOTSUP; + return -1; +} + +int +net_set_metric(const char *name, int metric) +{ + (void)name; + (void)metric; + errno = ENOTSUP; + return -1; +} + +int +net_set_mac(const char *name, const unsigned char *mac) +{ + (void)name; + (void)mac; + errno = ENOTSUP; + return -1; +} + +int +net_set_mask(const char *name, const char *mask) +{ + (void)name; + (void)mask; + errno = ENOTSUP; + return -1; +} + +int +net_set_broadcast(const char *name, const char *broadcast) +{ + (void)name; + (void)broadcast; + errno = ENOTSUP; + return -1; +} + +int +net_set_dstaddr(const char *name, const char *dstaddr) +{ + (void)name; + (void)dstaddr; + errno = ENOTSUP; + return -1; +} + +int +net_add_addr(const char *name, const char *addr, int prefix) +{ + (void)name; + (void)addr; + (void)prefix; + errno = ENOTSUP; + return -1; +} + +int +net_del_addr(const char *name, const char *addr, int prefix) +{ + (void)name; + (void)addr; + (void)prefix; + errno = ENOTSUP; + return -1; +} + +int +net_add_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) +{ + (void)dst; + (void)gateway; + (void)dev; + (void)prefix; + (void)metric; + errno = ENOTSUP; + return -1; +} + +int +net_del_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) +{ + (void)dst; + (void)gateway; + (void)dev; + (void)prefix; + (void)metric; + errno = ENOTSUP; + return -1; +} + +int +net_flush_addrs(const char *dev) +{ + (void)dev; + errno = ENOTSUP; + return -1; +} + +int +net_set_txqueuelen(const char *name, int qlen) +{ + (void)name; + (void)qlen; + errno = ENOTSUP; + return -1; +} + +int +net_set_name(const char *name, const char *newname) +{ + (void)name; + (void)newname; + errno = ENOTSUP; + return -1; +} + +int +net_tun_open(void) +{ + errno = ENOTSUP; + return -1; +} + +int +net_tun_attach(int fd, char *name, size_t namesz, int tap) +{ + (void)fd; + (void)name; + (void)namesz; + (void)tap; + errno = ENOTSUP; + return -1; +} + +int +net_tun_persist(int fd, int on) +{ + (void)fd; + (void)on; + errno = ENOTSUP; + return -1; +} + +int +net_tun_owner(int fd, uid_t uid) +{ + (void)fd; + (void)uid; + errno = ENOTSUP; + return -1; +} + +int +net_bind_device(int fd, const char *name) +{ + (void)fd; + (void)name; + errno = ENOTSUP; + return -1; +} + +int +net_get_hwaddr(int fd, const char *name, unsigned char *mac, size_t n) +{ + (void)fd; + (void)name; + (void)mac; + (void)n; + errno = ENOTSUP; + return -1; +} + +int +net_set_lease( + const char *name, + const unsigned char ip[4], + const unsigned char mask[4], + const unsigned char gw[4] +) +{ + (void)name; + (void)ip; + (void)mask; + (void)gw; + errno = ENOTSUP; + return -1; +} +#endif diff --git a/shared/libutil/passwd_dragonfly.c b/shared/libutil/passwd_dragonfly.c @@ -6,7 +6,7 @@ /* getpwnam already returns the hash to root, master.passwd holds it and * pwd_mkdb rebuilds the databases from it */ -#if defined(__DragonFly__) && !defined(ARUU_FORCE_OTHER) +#if defined(__DragonFly__) && !defined(ARUU_FORCE_POSIX) char * pw_shadow_hash(const char *name) { diff --git a/shared/libutil/passwd_freebsd.c b/shared/libutil/passwd_freebsd.c @@ -6,7 +6,7 @@ /* getpwnam already returns the hash to root, master.passwd holds it and * pwd_mkdb rebuilds the databases from it */ -#if defined(__FreeBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__FreeBSD__) && !defined(ARUU_FORCE_POSIX) char * pw_shadow_hash(const char *name) { diff --git a/shared/libutil/passwd_linux.c b/shared/libutil/passwd_linux.c @@ -12,7 +12,7 @@ #include "../text.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <errno.h> #include <shadow.h> #include <stdio.h> diff --git a/shared/libutil/passwd_netbsd.c b/shared/libutil/passwd_netbsd.c @@ -6,7 +6,7 @@ /* getpwnam already returns the hash to root, master.passwd holds it and * pwd_mkdb rebuilds the databases from it */ -#if defined(__NetBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__NetBSD__) && !defined(ARUU_FORCE_POSIX) char * pw_shadow_hash(const char *name) { diff --git a/shared/libutil/passwd_openbsd.c b/shared/libutil/passwd_openbsd.c @@ -6,7 +6,7 @@ /* getpwnam already returns the hash to root, master.passwd holds it and * pwd_mkdb rebuilds the databases from it */ -#if defined(__OpenBSD__) && !defined(ARUU_FORCE_OTHER) +#if defined(__OpenBSD__) && !defined(ARUU_FORCE_POSIX) char * pw_shadow_hash(const char *name) { diff --git a/shared/libutil/passwd_other.c b/shared/libutil/passwd_other.c @@ -1,26 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../passwd.h" - -#include <errno.h> -#include <stddef.h> - -/* no shadow file: the hash is the one the passwd entry holds */ -#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ - || defined(__DragonFly__)) \ - || defined(ARUU_FORCE_OTHER) -char * -pw_shadow_hash(const char *name) -{ - (void)name; - errno = 0; - return NULL; -} - -int -pw_shadow_update(const char *name, const char *newhash) -{ - (void)name; - (void)newhash; - return 1; -} -#endif diff --git a/shared/libutil/passwd_posix.c b/shared/libutil/passwd_posix.c @@ -0,0 +1,26 @@ +/* see LICENSE file for copyright and license details */ +#include "../passwd.h" + +#include <errno.h> +#include <stddef.h> + +/* no shadow file: the hash is the one the passwd entry holds */ +#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ + || defined(__DragonFly__)) \ + || defined(ARUU_FORCE_POSIX) +char * +pw_shadow_hash(const char *name) +{ + (void)name; + errno = 0; + return NULL; +} + +int +pw_shadow_update(const char *name, const char *newhash) +{ + (void)name; + (void)newhash; + return 1; +} +#endif diff --git a/shared/libutil/proc_linux.c b/shared/libutil/proc_linux.c @@ -16,7 +16,7 @@ #include <dirent.h> #include <time.h> -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) int parsecmdline(pid_t pid, char *buf, size_t siz) diff --git a/shared/libutil/proc_other.c b/shared/libutil/proc_other.c @@ -1,103 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../proc.h" -#include "../util.h" - -#include <errno.h> -#include <stdlib.h> -#include <string.h> - -/* a kernel with no backend yet: its process table is not read, and every - * tool that wants it says why. proc_linux.c is the one that reads it */ -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) - -int -parsecmdline(pid_t pid, char *buf, size_t siz) -{ - (void)pid; - (void)buf; - (void)siz; - errno = ENOTSUP; - return -1; -} - -int -parsestat(pid_t pid, struct procstat *ps) -{ - (void)pid; - (void)ps; - errno = ENOTSUP; - return -1; -} - -int -parsestatus(pid_t pid, struct procstatus *pstatus) -{ - (void)pid; - (void)pstatus; - errno = ENOTSUP; - return -1; -} - -int -pidfile(const char *file) -{ - char *end; - - errno = 0; - strtol(file, &end, 10); - return *end == '\0' && errno == 0; -} - -int -proc_each(proc_fn *fn, void *arg) -{ - (void)fn; - (void)arg; - errno = ENOTSUP; - return -1; -} - -int -proc_info(pid_t pid, struct procinfo *p) -{ - (void)pid; - memset(p, 0, sizeof *p); - errno = ENOTSUP; - return -1; -} - -int -proc_args(pid_t pid, char *buf, size_t n) -{ - return parsecmdline(pid, buf, n); -} - -int -proc_cwd(pid_t pid, char *buf, size_t n) -{ - (void)pid; - (void)buf; - (void)n; - errno = ENOTSUP; - return -1; -} - -void -proc_ttyname(unsigned major, unsigned minor, char *buf, size_t n) -{ - (void)major; - (void)minor; - if (n) - strlcpy(buf, "?", n); -} - -ssize_t -proc_selfexe(char *buf, size_t n) -{ - (void)buf; - (void)n; - errno = ENOTSUP; - return -1; -} - -#endif diff --git a/shared/libutil/proc_posix.c b/shared/libutil/proc_posix.c @@ -0,0 +1,103 @@ +/* see LICENSE file for copyright and license details */ +#include "../proc.h" +#include "../util.h" + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +/* a kernel with no backend yet: its process table is not read, and every + * tool that wants it says why. proc_linux.c is the one that reads it */ +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) + +int +parsecmdline(pid_t pid, char *buf, size_t siz) +{ + (void)pid; + (void)buf; + (void)siz; + errno = ENOTSUP; + return -1; +} + +int +parsestat(pid_t pid, struct procstat *ps) +{ + (void)pid; + (void)ps; + errno = ENOTSUP; + return -1; +} + +int +parsestatus(pid_t pid, struct procstatus *pstatus) +{ + (void)pid; + (void)pstatus; + errno = ENOTSUP; + return -1; +} + +int +pidfile(const char *file) +{ + char *end; + + errno = 0; + strtol(file, &end, 10); + return *end == '\0' && errno == 0; +} + +int +proc_each(proc_fn *fn, void *arg) +{ + (void)fn; + (void)arg; + errno = ENOTSUP; + return -1; +} + +int +proc_info(pid_t pid, struct procinfo *p) +{ + (void)pid; + memset(p, 0, sizeof *p); + errno = ENOTSUP; + return -1; +} + +int +proc_args(pid_t pid, char *buf, size_t n) +{ + return parsecmdline(pid, buf, n); +} + +int +proc_cwd(pid_t pid, char *buf, size_t n) +{ + (void)pid; + (void)buf; + (void)n; + errno = ENOTSUP; + return -1; +} + +void +proc_ttyname(unsigned major, unsigned minor, char *buf, size_t n) +{ + (void)major; + (void)minor; + if (n) + strlcpy(buf, "?", n); +} + +ssize_t +proc_selfexe(char *buf, size_t n) +{ + (void)buf; + (void)n; + errno = ENOTSUP; + return -1; +} + +#endif diff --git a/shared/libutil/reboot_linux.c b/shared/libutil/reboot_linux.c @@ -4,7 +4,7 @@ #endif #include "../reboot.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <stddef.h> #include <sys/syscall.h> #include <unistd.h> diff --git a/shared/libutil/reboot_other.c b/shared/libutil/reboot_other.c @@ -1,14 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../reboot.h" - -#include <errno.h> - -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -int -machine_reboot(int how) -{ - (void)how; - errno = ENOTSUP; - return -1; -} -#endif diff --git a/shared/libutil/reboot_posix.c b/shared/libutil/reboot_posix.c @@ -0,0 +1,14 @@ +/* see LICENSE file for copyright and license details */ +#include "../reboot.h" + +#include <errno.h> + +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +int +machine_reboot(int how) +{ + (void)how; + errno = ENOTSUP; + return -1; +} +#endif diff --git a/shared/libutil/session_linux.c b/shared/libutil/session_linux.c @@ -6,7 +6,7 @@ #include "../session.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <stdio.h> #include <string.h> #include <time.h> diff --git a/shared/libutil/session_other.c b/shared/libutil/session_other.c @@ -1,39 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../session.h" - -#include <errno.h> - -/* no login records: who and last have nothing to read */ -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -void -session_record(const char *user) -{ - (void)user; -} - -int -session_each(const char *path, session_fn *fn, void *arg) -{ - (void)path; - (void)fn; - (void)arg; - errno = ENOTSUP; - return -1; -} - -void -session_clear(const char *line) -{ - (void)line; -} - -int -session_lastlog(FILE *fp, uid_t uid, struct SessionEntry *e) -{ - (void)fp; - (void)uid; - (void)e; - errno = ENOTSUP; - return -1; -} -#endif diff --git a/shared/libutil/session_posix.c b/shared/libutil/session_posix.c @@ -0,0 +1,39 @@ +/* see LICENSE file for copyright and license details */ +#include "../session.h" + +#include <errno.h> + +/* no login records: who and last have nothing to read */ +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +void +session_record(const char *user) +{ + (void)user; +} + +int +session_each(const char *path, session_fn *fn, void *arg) +{ + (void)path; + (void)fn; + (void)arg; + errno = ENOTSUP; + return -1; +} + +void +session_clear(const char *line) +{ + (void)line; +} + +int +session_lastlog(FILE *fp, uid_t uid, struct SessionEntry *e) +{ + (void)fp; + (void)uid; + (void)e; + errno = ENOTSUP; + return -1; +} +#endif diff --git a/shared/libutil/sysinfo_linux.c b/shared/libutil/sysinfo_linux.c @@ -7,7 +7,7 @@ #include "../sysinfo.h" #include "../util.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <stddef.h> #include <stdio.h> #include <string.h> diff --git a/shared/libutil/sysinfo_other.c b/shared/libutil/sysinfo_other.c @@ -1,46 +0,0 @@ -#include "../sysinfo.h" - -#include <errno.h> -#include <string.h> - -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -int -get_uptime(long *uptime_secs) -{ - (void)uptime_secs; - errno = ENOTSUP; - return -1; -} - -int -get_meminfo(struct MemInfo *mi) -{ - memset(mi, 0, sizeof(*mi)); - errno = ENOTSUP; - return -1; -} - -ssize_t -get_dmesg(char *buf, size_t len) -{ - (void)buf; - (void)len; - errno = ENOTSUP; - return -1; -} - -int -clear_dmesg(void) -{ - errno = ENOTSUP; - return -1; -} - -int -set_console_level(int level) -{ - (void)level; - errno = ENOTSUP; - return -1; -} -#endif diff --git a/shared/libutil/sysinfo_posix.c b/shared/libutil/sysinfo_posix.c @@ -0,0 +1,46 @@ +#include "../sysinfo.h" + +#include <errno.h> +#include <string.h> + +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +int +get_uptime(long *uptime_secs) +{ + (void)uptime_secs; + errno = ENOTSUP; + return -1; +} + +int +get_meminfo(struct MemInfo *mi) +{ + memset(mi, 0, sizeof(*mi)); + errno = ENOTSUP; + return -1; +} + +ssize_t +get_dmesg(char *buf, size_t len) +{ + (void)buf; + (void)len; + errno = ENOTSUP; + return -1; +} + +int +clear_dmesg(void) +{ + errno = ENOTSUP; + return -1; +} + +int +set_console_level(int level) +{ + (void)level; + errno = ENOTSUP; + return -1; +} +#endif diff --git a/shared/libutil/timer_linux.c b/shared/libutil/timer_linux.c @@ -1,7 +1,7 @@ /* see LICENSE file for copyright and license details */ #include "../timer.h" -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <errno.h> #include <poll.h> #include <stdint.h> diff --git a/shared/libutil/timer_other.c b/shared/libutil/timer_other.c @@ -1,104 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../timer.h" - -/* deadlines on the monotonic clock posix has, which may stop while the - * machine sleeps */ -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -#include <errno.h> -#include <poll.h> -#include <string.h> - -static struct timespec deadline[TIMER_MAX]; /* 0 0 for disarmed */ -static int ntimers; - -static int -armed(int i) -{ - return deadline[i].tv_sec || deadline[i].tv_nsec; -} - -static long long -nsec(const struct timespec *ts) -{ - return ts->tv_sec * 1000000000LL + ts->tv_nsec; -} - -int -timer_init(int n) -{ - if (n > TIMER_MAX) { - errno = EINVAL; - return -1; - } - ntimers = n; - memset(deadline, 0, sizeof(deadline)); - return 0; -} - -int -timer_set(int i, const struct timespec *ts) -{ - struct timespec now; - long long t; - - if (!ts->tv_sec && !ts->tv_nsec) { - memset(&deadline[i], 0, sizeof(deadline[i])); - return 0; - } - if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) - return -1; - t = nsec(&now) + nsec(ts); - deadline[i].tv_sec = t / 1000000000LL; - deadline[i].tv_nsec = t % 1000000000LL; - return 0; -} - -int -timer_left(int i, struct timespec *ts) -{ - struct timespec now; - long long t = 0; - - if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) - return -1; - if (armed(i) && (t = nsec(&deadline[i]) - nsec(&now)) < 1) - t = 1; - ts->tv_sec = t / 1000000000LL; - ts->tv_nsec = t % 1000000000LL; - return 0; -} - -int -timer_wait(int fd) -{ - struct pollfd pfd = {.fd = fd, .events = POLLIN}; - struct timespec now; - long long next, left; - int i, ms, fired; - - for (;;) { - if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) - return -1; - fired = 0; - next = -1; - for (i = 0; i < ntimers; i++) { - if (!armed(i)) - continue; - left = nsec(&deadline[i]) - nsec(&now); - if (left <= 0) { - fired |= 1 << i; - memset(&deadline[i], 0, sizeof(deadline[i])); - } else if (next < 0 || left < next) { - next = left; - } - } - if (fired) - return fired; - ms = next < 0 ? -1 : (int)((next + 999999) / 1000000); - if (poll(&pfd, 1, ms) == -1) - return -1; - if (pfd.revents) - return 0; - } -} -#endif diff --git a/shared/libutil/timer_posix.c b/shared/libutil/timer_posix.c @@ -0,0 +1,104 @@ +/* see LICENSE file for copyright and license details */ +#include "../timer.h" + +/* deadlines on the monotonic clock posix has, which may stop while the + * machine sleeps */ +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +#include <errno.h> +#include <poll.h> +#include <string.h> + +static struct timespec deadline[TIMER_MAX]; /* 0 0 for disarmed */ +static int ntimers; + +static int +armed(int i) +{ + return deadline[i].tv_sec || deadline[i].tv_nsec; +} + +static long long +nsec(const struct timespec *ts) +{ + return ts->tv_sec * 1000000000LL + ts->tv_nsec; +} + +int +timer_init(int n) +{ + if (n > TIMER_MAX) { + errno = EINVAL; + return -1; + } + ntimers = n; + memset(deadline, 0, sizeof(deadline)); + return 0; +} + +int +timer_set(int i, const struct timespec *ts) +{ + struct timespec now; + long long t; + + if (!ts->tv_sec && !ts->tv_nsec) { + memset(&deadline[i], 0, sizeof(deadline[i])); + return 0; + } + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) + return -1; + t = nsec(&now) + nsec(ts); + deadline[i].tv_sec = t / 1000000000LL; + deadline[i].tv_nsec = t % 1000000000LL; + return 0; +} + +int +timer_left(int i, struct timespec *ts) +{ + struct timespec now; + long long t = 0; + + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) + return -1; + if (armed(i) && (t = nsec(&deadline[i]) - nsec(&now)) < 1) + t = 1; + ts->tv_sec = t / 1000000000LL; + ts->tv_nsec = t % 1000000000LL; + return 0; +} + +int +timer_wait(int fd) +{ + struct pollfd pfd = {.fd = fd, .events = POLLIN}; + struct timespec now; + long long next, left; + int i, ms, fired; + + for (;;) { + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) + return -1; + fired = 0; + next = -1; + for (i = 0; i < ntimers; i++) { + if (!armed(i)) + continue; + left = nsec(&deadline[i]) - nsec(&now); + if (left <= 0) { + fired |= 1 << i; + memset(&deadline[i], 0, sizeof(deadline[i])); + } else if (next < 0 || left < next) { + next = left; + } + } + if (fired) + return fired; + ms = next < 0 ? -1 : (int)((next + 999999) / 1000000); + if (poll(&pfd, 1, ms) == -1) + return -1; + if (pfd.revents) + return 0; + } +} +#endif diff --git a/shared/libutil/tty_linux.c b/shared/libutil/tty_linux.c @@ -6,7 +6,7 @@ /* the numbers are the ones linux gives ttys, and the dev the encoding * of tty_nr in /proc/<pid>/stat */ -#if defined(__linux__) && !defined(ARUU_FORCE_OTHER) +#if defined(__linux__) && !defined(ARUU_FORCE_POSIX) #include <sys/stat.h> #include <sys/sysmacros.h> #include <sys/types.h> diff --git a/shared/libutil/tty_other.c b/shared/libutil/tty_other.c @@ -1,46 +0,0 @@ -/* see LICENSE file for copyright and license details */ -#include "../filesystem.h" -#include "../paths.h" -#include "../util.h" - -#include <stddef.h> - -/* a kernel with no backend: the numbers are the ones its dev_t holds, - * and no name is known for them */ -#if !defined(__linux__) || defined(ARUU_FORCE_OTHER) -void -devtotty(int dev, int *tty_maj, int *tty_min) -{ - *tty_maj = fs_devmajor(dev); - *tty_min = fs_devminor(dev); -} - -int -ttytostr(int tty_maj, int tty_min, char *str, size_t n) -{ - (void)tty_maj; - (void)tty_min; - if (n < 2) - return -1; - str[0] = '?'; - str[1] = '\0'; - return 0; -} - -const char * -ttyconsole(void) -{ - return ARUU_PATH_DEVCONSOLE; -} - -const char * -ttyconsterm(void) -{ - return "vt100"; -} - -void -ttyhangup(void) -{ -} -#endif diff --git a/shared/libutil/tty_posix.c b/shared/libutil/tty_posix.c @@ -0,0 +1,46 @@ +/* see LICENSE file for copyright and license details */ +#include "../filesystem.h" +#include "../paths.h" +#include "../util.h" + +#include <stddef.h> + +/* a kernel with no backend: the numbers are the ones its dev_t holds, + * and no name is known for them */ +#if !defined(__linux__) || defined(ARUU_FORCE_POSIX) +void +devtotty(int dev, int *tty_maj, int *tty_min) +{ + *tty_maj = fs_devmajor(dev); + *tty_min = fs_devminor(dev); +} + +int +ttytostr(int tty_maj, int tty_min, char *str, size_t n) +{ + (void)tty_maj; + (void)tty_min; + if (n < 2) + return -1; + str[0] = '?'; + str[1] = '\0'; + return 0; +} + +const char * +ttyconsole(void) +{ + return ARUU_PATH_DEVCONSOLE; +} + +const char * +ttyconsterm(void) +{ + return "vt100"; +} + +void +ttyhangup(void) +{ +} +#endif diff --git a/shared/proc.h b/shared/proc.h @@ -52,7 +52,7 @@ int pidfile(const char *file); /* the process table, as every kernel's tools want it: one row per process in * words that are not any kernel's. proc_linux.c reads it from /proc, and - * proc_other.c says a kernel has no backend yet, so ps, pgrep and pkill + * proc_posix.c says a kernel has no backend yet, so ps, pgrep and pkill * are the same code everywhere and a port is one file */ struct procinfo { pid_t pid, ppid, pgid, sid;