aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* trans/crash: convert to trivfs dynamic classes and bucketsJustus Winter2015-09-271-22/+28
| | | | | | | | | | | | | | | | | libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/crash.c: Convert to dynamic classes and buckets.
* pflocal: convert to trivfs dynamic classes and bucketsJustus Winter2015-09-271-16/+4
| | | | | | | | | | | | | | | | | libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * pflocal/pflocal.c: Convert to dynamic classes and buckets.
* pfinet: convert to trivfs dynamic classes and bucketsJustus Winter2015-09-274-37/+41
| | | | | | | | | | | | | | | | | | | | libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * pfinet/main.c: Convert to dynamic classes and buckets. * pfinet/options.c: Likewise. * pfinet/pfinet.h: Likewise. * pfinet/socket-ops.c: Likewise.
* exec: convert to trivfs dynamic classes and bucketsJustus Winter2015-09-271-19/+32
| | | | | | | | | | | | | | | | | libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * exec/main.c: Convert to dynamic classes and buckets.
* libdiskfs: fflush stdout when pausingJustus Winter2015-09-271-0/+1
| | | | * libdiskfs/boot-start.c (start_execserver): fflush stdout when pausing.
* libdiskfs: improve error handlingJustus Winter2015-09-271-3/+6
| | | | * libdiskfs/boot-start.c (start_execserver): Improve error handling.
* exec: add missing includeJustus Winter2015-09-231-0/+1
| | | | * exec/main.c: Include `argz.h'.
* libports: remove unused variablesJustus Winter2015-09-222-3/+0
| | | | | | | * libports/inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Remove unused variable `bucket'. * libports/inhibit-class-rpcs.c (ports_inhibit_class_rpcs): Remove unused variables `pi' and `rpc'.
* Define TIME_VALUE_TO_TIMESPEC only when not defined alreadySamuel Thibault2015-09-191-0/+2
| | | | | * exec/elfcore.c (TIME_VALUE_TO_TIMESPEC) [TIME_VALUE_TO_TIMESPEC]: Do not redefine macro.
* Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSEDSamuel Thibault2015-09-121-1/+7
| | | | | | | Thanks Svante Signell for the investigation. * pflocal/socket.c (S_socket_connect, S_socket_send): When addr_get_sock returns EADDRNOTAVAIL, translate into ECONNREFUSED.
* Fix build warningSamuel Thibault2015-09-121-3/+3
| | | | * pflocal/sock.h (sock_bind): Move declaration.
* Add support for ANSI.SYS SCP/RCP escape codesJames Clarke2015-09-121-0/+12
| | | | | | | This adds support for CSI s and u, which are equivalent to ESC 7 and 8, saving/restoring the cursor position. * console/display.c (handle_esc_bracket): Added support for CSI s and u.
* Fix detection of terminated dgram pflocal serverSamuel Thibault2015-09-111-9/+8
| | | | | * libpipe/pipe.c (_pipe_no_readers): Break pipe for connection-less pipes too.
* Fix closure of local server socketsSamuel Thibault2015-09-111-1/+24
| | | | | | | | Since bound socks always have a ref for their address, they would never get freed. Thanks Svante Signell for the investigation. * pflocal/sock.h (sock_deref): When `sock' has one ref left and is bound to an address, unbound it, and thus shut it down.
* Fix sock_bind(sock,NULL) supportSamuel Thibault2015-09-111-3/+7
| | | | | | * pflocal/sock.c (sock_bind): When addr is NULL, do not take/release its mutex. When old_addr is also NULL, return EINVAL. When old_addr is not NULL, deref old_addr instead of addr.
* Install port-deref-deferred.h header for ports.hJames Clarke2015-09-101-1/+1
| | | | * libports/Makefile (installhdrs): Add port-deref-deferred.h for ports.h
* Do not install libtrivfs mig stub headersSamuel Thibault2015-09-101-3/+0
| | | | | | They were not usable anyway. * libtrivfs/Makefile (installhdrs): Remove generated mig stub headers.
* libshouldbeinlibc/maptime: use memory fencesJustus Winter2015-09-091-0/+2
| | | | * libshouldbeinlibc/maptime.h (maptime_read): Use memory fences.
* pflocal: avoid nested functionJustus Winter2015-09-091-6/+7
| | | | | * pflocal/io.c (copy_time): Move function out of `S_io_stat', turning it into a static inline function.
* umount: Do not report errors on making the device go awaySamuel Thibault2015-09-091-0/+2
| | | | | | | | This fixes umounting bind mounts or other mounts for which the device can not be made away. * utils/umount.c (do_umount): When the --force option is not passed, ignore errors from file_set_translator call on the device file.
* Also do not realpath "proc" pseudo-deviceSamuel Thibault2015-09-081-1/+1
| | | | * sutils/fstab.c (fstab_find_device): Do not realpath "proc" pseudo-device.
* Make procfs accept none or proc as "device"Samuel Thibault2015-09-081-0/+6
| | | | | | | This allows "mount none /proc -t proc" to work. * procfs/main.c (argp_parser): On ARGP_KEY_ARG, accept and ignore "none" and "proc".
* Fix opening a fifo with O_RDWRSamuel Thibault2015-09-081-1/+1
| | | | | | | We should not wait for a writer in that case, since that will be ourself. * trans/fifo.c (open_hook): Do not wait for a writer when flags contains O_WRITE.
* Fix race condition in ext2fs when remountingJames Clarke2015-09-0613-27/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems, ext2fs.static would regularly hang at startup, as a race condition meant it would process paging requests while remounting. To fix this, libpager has been altered to allow inhibiting and resuming its worker threads, and ext2fs uses this to inhibit paging while remounting. * console/pager.c (pager_requests): New variable. (user_pager_init): Updated call to pager_start_workers to use new pager_requests variable. * daemons/runsystem.sh: Removed artificial delay working around the race condition. * ext2fs/ext2fs.c (diskfs_reload_global_state): Call new inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as non-NULL so it will be munmapped. * ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions. * ext2fs/pager.c (file_pager_requests): New variable. (create_disk_pager): Updated call to pager_start_workers to use new file_pager_requests variable. (inhibit_ext2_pager,resume_ext2_pager): New functions. * fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions. * fatfs/pager.c (file_pager_requests): New variable. (create_fat_pager): Updated call to pager_start_workers to use new file_pager_requests variable. (inhibit_fat_pager,resume_fat_pager): New functions. * libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable. (diskfs_start_disk_pager): Updated call to pager_start_workers to use new diskfs_disk_pager_requests variable. * libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable. * libpager/demuxer.c (struct pager_requests): Renamed struct requests to struct pager_requests. Replaced queue with queue_in and queue_out pointers. Added inhibit_wakeup field. (pager_demuxer): Updated to use new queue_in/queue_out pointers. Only wake up workers if not inhibited. (worker_func): Updated to use new queue_in/queue_out pointers. Final worker thread to sleep notifies the inhibit_wakeup condition variable. (pager_start_workers): Added out parameter for the requests instance. Allocate heap space shared by both queues. Initialise new inhibit_wakeup condition. (pager_inhibit_workers,pager_resume_workers): New functions. * libpager/pager.h (struct pager_requests): Public forward definition. (pager_start_workers): Added out parameter for the requests instance. (pager_inhibit_workers,pager_resume_workers): New functions. * libpager/queue.h (queue_empty): New function. * storeio/pager.c (pager_requests): New variable. (init_dev_paging): Updated call to pager_start_workers to use new pager_requests variable.
* Fix build against glibc 2.21Samuel Thibault2015-08-312-1/+4
| | | | | | * Makeconf (CPPFLAGS): Remove -D_IO_MTSAFE_IO. * libthreads/lockfile.c (_IO_MTSAFE_IO): Define macro. (IS_IN): Define macro to 0.
* libdiskfs: rename `error' variableJustus Winter2015-08-253-62/+62
| | | | | | * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Rename `error' to `err'. * libdiskfs/file-getcontrol.c (diskfs_S_file_getcontrol): Likewise. * libdiskfs/file-syncfs.c (diskfs_S_file_syncfs): Likewise.
* libdiskfs: add missing declarationsJustus Winter2015-08-251-0/+8
| | | | | * libdiskfs/diskfs.h (diskfs_node_disknode): Add missing declaration. (diskfs_disknode_node): Likewise.
* libdiskfs: fix typoJustus Winter2015-08-251-1/+1
| | | | * libdiskfs/diskfs.h: Fix typo.
* libdiskfs: fix parent lookup in the name cacheJustus Winter2015-08-201-1/+1
| | | | * libdiskfs/name-cache.c (diskfs_check_lookup_cache): Drop stray negation.
* ext2fs: provide unconditional debug macroJustus Winter2015-08-151-1/+3
| | | | | | * ext2fs/ext2fs.h (ext2_debug_): New macro that unconditionally prints the given message. (ext2_debug): Use the new macro.
* ext2fs: improve ext2fs debuggingJustus Winter2015-08-151-3/+2
| | | | | * ext2fs/ext2fs.h (ext2_debug): Print to stderr. (printf): Drop declaration.
* Fake full file access only for faked nodesSamuel Thibault2015-08-141-1/+5
| | | | | | | | | Otherwise some scripts may try to modify system files just because they find they seem to be able to. * trans/fakeroot.c (netfs_report_access): When FAKE_MODE is not set on `np', call file_check_access on the underlying node instead of returning O_RDWR|O_EXEC.
* Make fakeroot return file types from underly fsSamuel Thibault2015-08-141-1/+1
| | | | | | | | Fakeroot does not support faking them anyway, and they may change on the underlying fs, e.g. when creating a local socket. * trans/fakeroot.c (netfs_validate_stat): Return S_IFMT part of st_mode as provided by underlying filesystem.
* libports: clarify why we emulate protected payloadsJustus Winter2015-08-142-0/+10
| | | | | | | | | | | | | | | | The Hurd uses protected payloads to improve the receiver lookup on the server side to the point that we no longer do a hash table lookup in the dispatch code. If the kernel does not support protected payloads, we degrade gracefully, do one lookup in libports' dispatching code, and emulate the protected payload feature to still save one hash table lookup in the intrans function. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Add comment. * libports/manage-one-thread.c (ports_manage_port_operations_one_thread): Likewise.
* pflocal: fix receiver lookupJustus Winter2015-08-141-1/+1
| | | | | * pflocal/mig-decls.h (begin_using_addr_payload): Use `ports_lookup_payload'.
* Print which path init tried to execvSamuel Thibault2015-08-081-1/+1
| | | | * init/init.c (main): On execv failure, print which path failed.
* exec: fix setting the name of early serversJustus Winter2015-07-142-18/+33
| | | | | | | | | | | | Previously, the exec server did not set the name of the servers started before the proc server. Instead this was done by the startup server, but this was merely a workaround, missing notably the startup server itself. * exec/exec.c (set_name): New function. (do_exec): Move the code setting the name to a new function, and also call it if the proc server is not started yet. * startup/startup.c (run): Drop hack.
* Do not keep mutex locked while waiting for authenticate loopSamuel Thibault2015-07-043-0/+9
| | | | | | | * libdiskfs/io-reauthenticate.c (diskfs_S_io_reauthenticate): Release the node lock while blocking on the auth server and client. * libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Likewise. * pfinet/io-ops.c (S_io_reauthenticate): Likewise.
* utils/rpcscan: new utilityJustus Winter2015-06-302-3/+407
| | | | | * utils/rpcscan.c: New file. * utils/Makefile: Add `rpcscan'.
* utils: split-off the message id parsingJustus Winter2015-06-304-197/+298
| | | | | | | * utils/rpctrace.c: Move all the code handling the message id files... * utils/msgids.c: ... to a new file. * utils/msgids.h: And add the relevand declarations. * utils/Makefile (SRCS): Add the new file.
* Cope with scripts which chmod -x directoriesSvante Signell2015-06-171-6/+4
| | | | | | | | As well as other potential mode changes which are indeed supposed to still work as root. * trans/fakeroot.c (netfs_attempt_chmod): Always set S_IRUSR and S_IWUSR in real_mode, and set S_IXUSR also when this is a directory.
* Fix ps -o %r infinite loopEsa Peuha2015-06-051-0/+15
| | | | | * libps/fmt.c (_fmt_create): When nothing at all was recognized, break out instead of looping.
* libdiskfs: do not print a message on ENOMEMJustus Winter2015-06-051-1/+0
| | | | | * libdiskfs/node-cache.c (diskfs_node_iterate): Do not print a message on ENOMEM.
* Check AWK usability when XKB is enabledDiego Nieto Cid2015-06-051-0/+8
| | | | * configure.ac: test whether AWK provides strtonum function.
* console-client: Fix lower range of binary searchDiego Nieto Cid2015-06-051-4/+4
| | | | | | | | | | | | | | To prevent infinite recursion range checking was introduced as an exit condition adding two extra comparisons on each recursive call. By fixing the range used by the recursive call over the lower half of the array one can avoid penalizing successful lookups while still preventing infinite recursion due to `first` parameter being greater than `last` parameter. * console-client/xkb/kstoucs.c (find_ucs): don't remove middle from the lower range. Remove extra comparisons.
* console-client: assert preconditionDiego Nieto Cid2015-06-051-0/+4
| | | | * console-client/xkb/kstoucs.c (find_ucs): assert precondition.
* utils/vmstat: fix integer overflowJustus Winter2015-05-231-1/+2
| | | | | | | Previously, the `vmstat' utility would stop displaying the memory object hit ratio after some time due to an integer overflow. * utils/vmstat.c (get_memobj_hit_ratio): Fix integer overflow.
* utils/rpctrace: fix build with -O0Justus Winter2015-05-231-1/+1
| | | | * utils/Makefile: Link against `libshouldbeinlibc'.
* console-client: fix binary searchJustus Winter2015-05-231-2/+4
| | | | | | | | Previously, the binary search through the keysym map was incorrectly implemented. This resulted in infinite loops (thanks to the compilers tail call optimization) or crashes (if the stack space was exhausted). * console-client/xkb/kstoucs.c (find_ucs): Fix binary search.
* console-client: avoid nested functionJustus Winter2015-05-231-17/+18
| | | | | | * console-client/xkb/kstoucs.c (find_ucs): Previously, this function was a nested function for no reason at all. Turn it into a normal function.