aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libps: support getting RPC names for WAIT outputSamuel Thibault2020-11-235-24/+51
| | | | | | | | | | | * libps/Makefile (SRCS): Add ../utils/msgids.c. (../utils/msgids-CPPFLAGS): Add DATADIR macro. * libps/spec.c: Include "../utils/msgids.h". (get_rpc_name): Implement with msgid_info. * utils/msgids.c (parse_opt): Move end code to ... (msgids_scan_std): ... new function. * utils/msgids.h (msgids_scan_std): New prototype. * utils/ps.c (main): Call msgids_scan_std.
* libshouldbeinlibc: Fix printing truncated backtraceSamuel Thibault2020-11-221-2/+5
| | | | | * libshouldbeinlibc/assert-backtrace.c (__assert_fail_base_backtrace): If returned backtrace is smaller than skip we cannot print anything.
* acpi: Fix table name truncationSamuel Thibault2020-11-221-1/+2
| | | | | | | | | | | | | | | | | | | * acpi/acpifs.c (create_dir_entry): Fix terminating entry->name string. diff --git a/eth-multiplexer/vdev.c b/eth-multiplexer/vdev.c index 367623d9..c76cfbfd 100644 --- a/eth-multiplexer/vdev.c +++ b/eth-multiplexer/vdev.c @@ -139,7 +139,8 @@ add_vdev (char *name, size_t size) vdev->dev_port = ports_get_right (vdev); ports_port_deref (vdev); - strncpy (vdev->name, name, IFNAMSIZ); + strncpy (vdev->name, name, IFNAMSIZ-1); + vdev->name[IFNAMSIZ-1] = '\0'; vdev->if_header_size = ETH_HLEN; vdev->if_mtu = ETH_MTU; vdev->if_header_format = HDR_ETHERNET;
* eth-multiplexer: Fix interface name truncationSamuel Thibault2020-11-221-1/+2
| | | | * eth-multiplexer/vdev.c (add_vdev): Fix terminating vdev->name string.
* libfshelp-tests: Fix warningSamuel Thibault2020-11-221-3/+3
| | | | | * libfshelp-tests/test-fcntl.c (parse_args): Do not call error() with a NULL pointer.
* libfshelp-tests: Fix warningSamuel Thibault2020-11-221-2/+2
| | | | | * libfshelp-tests/test-lockf.c (parse_args): Do not call error() with a NULL pointer.
* test-lockf: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | * libfshelp-tests/test-lockf.c (main): Fix format for off_t.
* libfshelp-tests: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | | * libfshelp-tests/test-flock.c (parse_args): Do not call error() with a NULL pointer.
* libfshelp-tests: Fix warningSamuel Thibault2020-11-221-0/+1
| | | | * libfshelp-tests/race.c: Include <stdlib.h>
* clookup: Fix warningSamuel Thibault2020-11-221-2/+2
| | | | | * sutils/clookup.c (file_name_lookup_carefully): Make head a non-const char *.
* crash: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | * trans/crash.c (template_make_file_name): Fix format for time_t.
* mach-defpager: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | * mach-defpager/default_pager.h (panic): Add noreturn function attribute.
* pflocal: Fix warningSamuel Thibault2020-11-221-0/+1
| | | | * pflocal/sock.c: Include <unistd.h>.
* proc: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | | * proc/stubs.c (send_signal): Add missing warning in union inside mach_msg_header_t.
* libtrivfs: Remove unused empty functionSamuel Thibault2020-11-221-6/+0
| | | | * libtrivfs/make-node.c (init_node): Remove unused empty function.
* libfshelp: Fix extern inline definitionsRomain Naour2020-11-213-3/+7
| | | | | | | | | | | | | | | | | | | | The commit [1] updated rlock.h and fshelp.h to use FSHELP_DEFINE_EXTERN_INLINE but it's never defined because FSHELP_EXTERN_INLINE is used in libfshelp/extern-inline.c. Update this file to use define FSHELP_DEFINE_EXTERN_INLINE. [1] ca3d36201329f0e21b995d831ce9f6f03b6b985e * libfshelp/extern-inline.c: define FSHELP_DEFINE_EXTERN_INLINE. * libfshelp/fshelp.h: define FSHELP_EXTERN_INLINE __extern_inline if FSHELP_DEFINE_EXTERN_INLINE is not defined. * libfshelp/rlock.h: Likewise Signed-off-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Samuel Thibault <samuel.thibault@gnu.org> Message-Id: <20201120230347.2432672-1-romain.naour@gmail.com>
* console-client: Fix listing nodesSamuel Thibault2020-11-181-4/+14
| | | | | | | | * console-client/trans.c (netfs_get_dirents): Fix counting the start node. Return 0 when there are no entries left, instead of trying to mmap zero bytes. (console_create_consnode): Set inode number, other entries get ignored by glibc's readdir().
* rumpdisk: automatically prepend /dev/Samuel Thibault2020-11-161-12/+9
| | | | | | | to keep coherent with other storeio translators, grub scripts, etc. * rumpdisk/block-rump.c (translate_name): Prepend /dev/ to disk name. (is_disk_device): Do not match heading /dev/.
* rumpdisk: auto-disable when kernel runs disk driversSamuel Thibault2020-11-151-28/+65
| | | | | | | | | | | | | | | | | | | | By default we do not want rumpdisk to step over the kernel drivers. * rumpdisk/block-rump.c: Include <device/device.h>. (disabled): New variable. (dev_to_port): Rename to rumpdisk_dev_to_port. (device_init): Rename to rumpdisk_init. Exit if the kernel runs SATA drivers. (device_close): Rename to rumpdisk_device_close. (device_dealloc): Rename to rumpdisk_device_dealloc. (device_shutdown): Rename to rumpdisk_device_shutdown. Do not shutdown when disabled. (device_open): Rename to rumpdisk_device_open. Return D_NO_SUCH_DEVICE when disabled. (device_write): Rename to rumpdisk_device_write. (device_read): Rename to rumpdisk_device_read. (device_get_status): Rename to rumpdisk_device_get_status. (rump_block_emulation_ops): Update refs accordingly.
* libmachdev: Fix spurious send referenceSamuel Thibault2020-11-151-1/+1
| | | | | * libmachdev/trivfs_server.c (trivfs_S_fsys_getpriv): Move the just-copied send rights instead of copying them again.
* libmachdev: Make comments more preciseSamuel Thibault2020-11-151-2/+2
|
* libmachdev: Fix warningSamuel Thibault2020-11-151-0/+1
| | | | * libmachdev/trivfs_server.c: Include <mach/i386/mach_i386.h>.
* libmachdev: Remove duplicate declarationSamuel Thibault2020-11-151-2/+0
| | | | | * libmachdev/ds_routines.c (machdev_is_master_device): Remove duplicate declaration.
* libmachdev: Fix missing backtranslation to port nameSamuel Thibault2020-11-151-0/+1
| | | | | | | | | trivfs happens to set the payload for our control port, and we are not using payload translation for mach_i386, so we need to tell mig how to get back to the port name. * libmachdev/Makefile (mach_i386-MIGSFLAGS): Set -DMACH_PAYLOAD_TO_PORT=ports_payload_get_name.
* MAKEDEV: Set up rump translator and fix netdde translatorSamuel Thibault2020-11-151-2/+8
| | | | | | | * sutils/MAKEDEV.sh (rumpdisk): Set up /dev/rumpdisk and /dev/disk that points to it. (netdde): Point /dev/net to /dev/netdde. (eth*): Use /dev/net instead of /dev/netdde.
* MAKEDEV: Add master and rumpdisk supportSamuel Thibault2020-11-151-5/+17
| | | | | * sutils/MAKEDEV.sh: Add -M option to set the master device node. Add support for wd* devices through rumpdisk.
* MAKEDEV: use bashSamuel Thibault2020-11-141-1/+1
| | | | | | dash's expandarg always calls expandmeta which calls glob64, which stats the parameters. This is dangerous for MAKEDEV since it triggers the translator, which may be strictly unwanted when filling an installed system.
* rumpdisk: Support opening a device several timesSamuel Thibault2020-11-141-55/+58
| | | | | | | | | | * rumpdisk/block-rump.c (struct block_data): Make taken field an integer instead of a boolean. (device_open): When search_bd succeeds, set a new reference and return a new port right. Separate out io_return_t err, int fd, and int ret to avoid confusions. Simplify the error handling path. (device_close): Decrement reference and close rump disk only when reaching zero. Also destroy our port.
* libmachdev: Avoid conflating translator name and pathSamuel Thibault2020-11-143-5/+6
| | | | | | | | | | | | bootstrap translators may not wish to appear in the FS, and the name of the translator does not have to match the path where it is getting installed. * libmachdev/machdev.h (machdev_trivfs_init): Add path parameter. * libmachdev/trivfs_server.c (machdev_trivfs_init): Add path parameter, set devnode only if it is not NULL. (trivfs_S_fsys_init): Only call install_as_translator when devnode is not NULL. * /rumpdisk/main.c (main): Add path parameter.
* libmachdev: Support installing translator in the FSDamien Zammit2020-11-142-24/+63
| | | | | | | | | | | | | | | | | */libmachdev/trivfs_server.c (machdev_ctl): Rename to control_port. (trivfs_S_fsys_init): Fix accordingly. (control): New variable. (bootstrapped, underlying, devnode): New variables. (install_as_translator): New function. (trivfs_S_fsys_init): When bootstrapping, call install_as_translator. (machdev_trivfs_init): Create one port of the control class. (trivfs_S_fsys_getpriv): Use ports_get_send_right on the control port instead of creating another one. (resume_bootstrap_server): Use ports_get_send_right on the control port instead of creating another one. (machdev_trivfs_init): When bootstrapping, Use our control port as fsys.
* rumpdisk: Comment on thread-safety requirementsSamuel Thibault2020-11-141-0/+3
|
* Remove remnants of cthreadsSamuel Thibault2020-11-116-50/+4
| | | | | | | | | | * doc/hurd.texi: Index pthread.h instead of cthreads.h * libports/Makefile (SRCS): Drop stubs.c. * libports/stubs.c: Remove file. * mach-defpager/default_pager.c (default_pager): Drop disabled cthreads calls. * pfinet/kmem_cache.c: Fix comment. * proc/stubs.c: Fix comments.
* pflocal: Set default uid/gid to those of the translatorSamuel Thibault2020-11-111-2/+2
| | | | | * pflocal/sock.c (sock_create): Set uid to getpid () and gid to getgid ().
* pflocal: Record socket creator so io_stat can return itSamuel Thibault2020-11-115-2/+22
| | | | | | | | | | | * pflocal/sock.h (struct sock): Add uid and gid fields. * pflocal/sock.c (sock_create): Set uid and gid to 0. * pflocal/mig-mutate.h (SOCKET_IMPORTS): Import ../libtrivfs/mig-decls.h. (PF_INTRAN, PF_INTRAN_PAYLOAD, PF_DESTRUCTOR): New macros. * pflocal/pf.c: Include hurd/trivfs.h. (S_socket_create): Update parameters. Set sock's uid and gid fields according to pf->user. * pflocal/io.c (S_io_stat): Set st_uid and st_gid according to pf.
* libthreads: Finish emovingSamuel Thibault2020-11-112-14/+0
| | | | | * config.make.in (VERSIONING): Remove. * configure.ac: Do not set VERSIONING.
* libthreads: RemoveSamuel Thibault2020-11-1134-5502/+7
| | | | | | | | | | | | | | | libthreads is most probably completely broken, and not the long-term road anyway. * config.make.in (VERSIONING): Remove. * configure.ac: Test for pfinet assembly compatibility instead of libthreads assembly compatibility. Do not set VERSIONING. * libthreads: Remove directory. * Makefile (lib-subdirs): Remove libthreads. * doc/hurd.texi (Threads Library): Rename references to libthreads into libpthread. * release/rfloppy.copy: Do not objcopy lib/libthreads.so. * release/tool-Makefile (rfloppy-solib): Remove libthreads.
* rumpdisk: Use rump_sys_pread/pwrite instead of lseek+r/w for atomic accessesDamien Zammit2020-11-091-17/+4
| | | | | | TESTED by booting a QEMU passthrough disk via rumpdisk.static Message-Id: <20201109070906.20796-1-damien@zamaudio.com>
* libdiskfs: enable relatime by defaultSamuel Thibault2020-10-102-2/+2
| | | | | | | | | Like Linux does, to avoid writing inodes when just reading files already in the cache. * libdiskfs/init-init.c (_diskfs_relatime): Set to 1. * libdiskfs/opts-std-runtime.c (set_opts): Always _diskfs_relatime from h->relatime.
* libdiskfs: Make relatime also update atime when equal to mtime/ctimeSamuel Thibault2020-10-031-2/+2
| | | | | | | Some tests (such as glibc's tst-atime) require it for instance. * libdiskfs/node-times.c (atime_should_update): Also return 1 when atime is equal to mtime or ctime.
* libdiskfs: Add relatime supportRyan Jeffrey2020-09-3012-12/+93
| | | | | | | | | | | | | | | | | | | | | | | | * doc/hurd.texi (diskfs_set_node_atime): Document relatime behavior. * libdiskfs/diskfs.h (diskfs_set_node_atime): Likewise. * libdiskfs/init-init.c (_diskfs_relatime): Add variable. * libdiskfs/file-statfs.c (ST_RELATIME): Define if not defined already. (diskfs_S_file_statfs): Report ST_RELATIME when _diskfs_relatime is set. * libdiskfs/node-times.c (atime_should_update): New function. (diskfs_set_node_atime): Document relatime behavior. Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/opts-common.c (diskfs_common_options): Add --strictatime and -R/--relatime options. * libdiskfs/opts-std-runtime.c (struct parse_hook): Add relatime field. (set_opts): Set _diskfs_relatime from relatime field. (parse_opt): Parse -R option. * libdiskfs/opts-std-startup.c (parse_startup_opt): Parse -R option. * libdiskfs/priv.h (_diskfs_relatime): Declare variable. (atime_should_update): Declare function. * libdiskfs/opts-append-std.c (diskfs_append_std_options): Add reporting --relatime option. * libdiskfs/conch-fetch.c (iohelp_fetch_shared_data): Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/rdwr-internal.c (_diskfs_rdwr_internal): Likewise.
* pci-arbiter: Probe devices and map regionsJoan Lledó2020-09-132-9/+30
| | | | | | | | | | | This adapts the arbiter to a bug fixed in libpciaccess. We were relying on the library to probe devices and map regions but it's the arbiter who should do it. * pci-arbiter/pcifs.c: * create_fs_tree(): probe the device to find regions and rom * pci-arbiter/func_files.c: * io_region_file(): map region on the first access attempt
* libmachdev: Remove declaration for static functionDamien Zammit2020-09-061-2/+0
| | | | | | This one-liner fixes libmachdev build failure. Message-Id: <20200906020837.329023-1-damien@zamaudio.com>
* libpipe: Enforce write_limit for large writesSamuel Thibault2020-08-071-15/+44
| | | | | | | | We are not supposed to buffer more than the requested buffer size, so we should make the writer wait. * libpipe/pipe.c (pipe_send): Limit write calls to the write_limit, and loop around it to reach the requested amount.
* libmachdev: Introduce startup notification for clean rumpdisk shutdownDamien Zammit2020-08-027-6/+177
| | | | Message-Id: <20200801050538.273196-1-damien@zamaudio.com>
* usermux: Fix extern inline usageSamuel Thibault2020-08-011-1/+1
| | | | | | | | C99 extern inline semantic is different from GNU semantic, so we cannot blindly write "extern inline". * usermux/usermux.h (USERMUX_EI): Define to __extern_inline instead of extern inline.
* libfshelp: Fix extern inline usageSamuel Thibault2020-08-013-2/+7
| | | | | | | | | | | | C99 extern inline semantic is different from GNU semantic, so we cannot blindly write "extern inline". * libfshelp/rlock.h (FSHELP_EXTERN_INLINE): Define to __extern_inline if not already. (rlock_list_init): Mark FSHELP_EXTERN_INLINE instead of extern inline. * libfshelp/fshelp.h (FSHELP_EXTERN_INLINE): Define to __extern_inline instead of extern inline. * libfshelp/extern-inline.c: Include "rlock.h"
* libfshelp: Fix extern inline definitionsSamuel Thibault2020-08-011-3/+3
| | | | | | * libfshelp/fshelp.h (fshelp_rlock_init, fshelp_rlock_po_init, fshelp_rlock_po_fini): Define when FSHELP_DEFINE_EXTERN_INLINE is defined, not DISKFS_DEFINE_EXTERN_INLINE.
* diskfs: Add RPC for fsys_init to bootstrap if presentDamien Zammit2020-07-311-0/+13
| | | | Message-Id: <20200728100837.224336-1-damien@zamaudio.com>
* diskfs: Don't deallocate if dotdot is null in fsys-getroot.cDamien Zammit2020-07-311-1/+2
| | | | Message-Id: <20200728100837.224336-2-damien@zamaudio.com>
* libdiskfs: Refactor fsys_startup invokation for bootstrappingDamien Zammit2020-07-281-20/+38
| | | | | | | When we will have a rump translator before the root filesystem translator, we will want to give to the former a control port on the latter. Message-Id: <20200726073721.202405-1-damien@zamaudio.com>