unseek
unselect
unpipe
unsync
etc.
unseek
unselect
unpipe
unsync
etc.
It really looks like some overly clever college student's weird trick that somehow managed to survive for decades in an established product.
Also, that machine was being time shared with a dozen or more users.
Launching emacs or TeX on this machine might take tens of seconds without access to unexec(), but only 3 seconds for the freeze dried version.
unexec() was easier at the time. There were no shared libraries, no address space layout randomization. One memory region grew up from the bottom, one down from the top. There was no mmap() jamming mysterious stuff in the middle. Just copy the bottom, copy the top, do magic to adjust the stack for your unexec() call, and write the thing out as an executable.
(Yeah, I excised unexec() from BibTeX back in the ‘80s to port it to a 68k Mac for a coworker, then later implemented unexec() for a Motorola 88k based multilevel secure SysV system in the early ‘90s because launching emacs was driving me insane. I prefer our shiny new future of stupidly fast computers.)
Description: put thread to sleep as long as there is activity on any fd, wake up only when all fds are inactive.
Useful for: Scheduling work to be performed only when server is idle.
unsync(2)
Description: Select a random file, load it into the buffer cache, and remove it from file system.
Useful for: Freeing up some disk space in a pinch.
unwait(2)
Description: Resurrects the previous child process.
Useful for: Implementing the !! operator in bash.
unsignalfd(2)
Description: Invoke signal handler whenever a given fd activates.
Useful for: User space interrupts.
unopen(2)
Description: Create a file which refers to an open fd.
Useful for: Implementing /proc/self/fd functionalit.
Yeah that's nice.
> unsignalfd(2) > Useful for: User space interrupts.
There is libfam. At least on my system, it doesn't have a manual page.
> unopen(2) > Description: Create a file which refers to an open fd.
That does sounds useful, and I don't know any library that does it.
In my silly world, unopen() would just take any fd (socket, file, pipe, etc.) and create a file system binding which anyone could open. Kind of like how /proc works on Linux today.
(Whereas moving to recycle-bin is a manual process you need to remember to do).
alias rm trashYou need linkat() with the AT_SYMLINK_FOLLOW flag enabled.