Hello, I'm interested in using the zsystem flock function in the zsh/system module to lock files, with a timeout if the lock is already taken, but currently the timeout value has a whole-second granularity and I'd like to specify sub-second timeouts. The attached patch (against zsh 5.7.1) modifies the bin_zsystem_flock() function, allowing the -t option to take floating-point parameters, and handles the timeout with microsecond granularity. It also adds option -p to control the retrying period, which was previously hardcoded to 1 second. I kept the same function's logic of periodically retrying to acquire the lock in non-blocking mode. However, there may be a better way to implement this timeout: set a timer such as setitimer(2) which sends a SIGALRM on timeout, trap SIGALRM without SA_RESTART, then acquire the lock in blocking mode; fcntl() will then block until SIGALRM is caught, after which errno will be EINTR. Unfortunately, lacking knowledge of zsh internals especially signal handling, I'm not confident that I can reimplement it this way by myself. The patch modifies Src/Modules/system.c and also Src/utils.c (to add a function akin to time(NULL) but that returns microseconds, using clock_gettime(CLOCK_MONOTONIC) if supported, or else gettimeofday()). I did not modify the documentation yet, not being sure of people being interested in this feature, nor of whether I should edit just the Doc/Zsh/mod_system.yo file, or also Doc/{zshmodules.1,zsh.texi} or others. Also, I'm afraid that I only did minimal testing. I checked that invoking zsystem flock with various values for -t and -p seems to do what I intended. Is there a more rigorous test framework for this kind of thing? Thanks, best regards, Cedric Ware.