summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-03-21add colemak kbmap (thanks Silas McCroskey)Sigrid
2020-03-21add swiss german kbmap (thanks mike)Sigrid
2020-03-20bell labs is dead, manOri Bernstein
remove the last reference from 9fs.
2020-03-20kbdfs: fix kbmapread() not accounting for reads smaller than the size of the ↵BurnZeZ
line
2020-03-17Improve the posix preprocessor.Ori Bernstein
This fixes token pasting, making it expand when it should expand, and paste before expansion when it should paste before expanding. #define CAT(a, b) a ## b #define BAR 3 #define FOO CAT(BAR, 3) FOO now produces 33, while #define CAT(a, b) a ## b #define EOF (-1) #define NOP(x) x NOP(CAT(foo, EOF)) CAT(,EOF) CAT(,) produces fooEOF (-1) <empty> respectively.
2020-03-15fix ccom idempotencyOri Bernstein
ccom may be called multiple times on the same node, via 'goto loop' calls from the commute label, OADD, and a few other places. Casts to void could null out the LHS of the node, which would cause the compiler to crash if the cast was revisited due to one of these cases, because we tried frobbing n->left. Now, if n->left is nil, we just return.w
2020-03-10improve usage messages (thanks henesy)Ori Bernstein
Fix inconsistencies between programs and their usage messages, correct instances where information seems to be missing or lost. This includes missing arguments, making usage consistent with manuals, and so on.
2020-03-10fix -T option for doctypeOri Bernstein
We used to set $dev to -T, and leave the device type in the argument list. Now, we set it to -T$2, and shift it out of the list.
2020-03-09fix heredoc crashOri Bernstein
we emitted an error on heredoc tags, but we continued on, and added a heredoc entry to the list, with a tag that we couldn't handle. when processing this heredoc, rc would segfault. fix: don't add a heredoc to the list on error.
2020-03-09fix alignment in ape mallocOri Bernstein
We used to have a padding int in the structure after the next pointer, to align it to 16 bytes. On 64 bit architectures, the pointer was already 8 bits, so the padding misaligned things to 20 bytes. This fixes it so that we're explcit about the data alignment we want, instead of hoping that the various sizes line up.
2020-03-09sam: ^ does not need current fileSigrid
2020-03-09sam(1): document $% and $%dotSigrid
2020-03-09sam: add $%dot (thanks kvik)Sigrid
2020-03-08add usage messages to auth/(enable disable status).Ori Bernstein
print useful message when user invokes these commands incorrectly (thanks henesy)
2020-03-08lib9p: implement automatic remove-on-close cleanup in postsharesrv(), remove ↵cinap_lenrek
postfd() and sharefd() functions with the latest changes to shr(3), we can use ORCLOSE on the control file to get the mount in the share automatically removed when the server exits or something goes wrong during postsharesrv(). do not expose postfd() and sharefd() functions. they where undocumented and leak the control file descriptors.
2020-03-08mergecinap_lenrek
2020-03-08boorc, nusbrc: fix wrong redirections after &cinap_lenrek
the rc & operator changes stdin to /dev/null, so we have to do the <[0=1] inside the {} this never showed up as an issue because many fileservers just read 9p messages from standard output.
2020-03-08"": output previous action to stderrOri Bernstein
When redirecting output from "", it prints the command to stdout, which garbles things like: % foo <inspect output> % "" > /dev/snarf Now, we send it to stderr.
2020-03-08devshr: unmount service on #σc/share/mount removalcinap_lenrek
when the control mountpoint side gets removed, close mount channel immediately. this is usefull for implementing automatic cleanup with ORCLOSE create mode.
2020-03-08nusb/usbd: cleanup processes on unmountcinap_lenrek
this makes sure that when postsharesrv() fails (for example because the shr file already exists), the worker process gets killed and all file descriptors to devusb get closed.
2020-03-089p(2): document all the effective rfork flags for postmountsrv()cinap_lenrek
2020-03-089p(2): document the filedescriptor sharing behaviour of postmountsrv()cinap_lenrek
2020-03-08devproc: return process id when reading /proc/n/ctl filecinap_lenrek
allow reading the control file of a process and return its pid number. if the process has exited, return an error. this can be usefull as a way to test if a process is still alive. and also makes it behave similar to network protocol directories. another side effect is that processes who erroneously open the ctl file ORDWR would be allowed todo so as along as they have write permission and the process is not a kernel process.
2020-03-08games/playlistfs: open /proc/n/ctl OWRITE, not ORDWRcinap_lenrek
2020-03-08lib9p: restore previous behaviour of fd group sharingcinap_lenrek
it appears that too many fileservers rely on the fileserver process sharing the filedescriptors with children of the caller to postmntsrv() or threadpostmntsrv(). restoring previous behaviour for now.
2020-03-08sshnet: fix fork race conditionscinap_lenrek
sshreadproc() needs to be started after opening the sshfd file descriptor. fsnetproc() needs to run in the same filedescriptor group as the fileserver.
2020-03-08aux/realemu: fix exit codecinap_lenrek
2020-03-08aux/realemu: run cpuproc in same fd group as fileservercinap_lenrek
2020-03-08aux/timesync: open /proc/n/ctl with OWRITE, not ORDWRcinap_lenrek
2020-03-07devproc: don't allow /proc/$pid/ctl to be opens for readingcinap_lenrek
2020-03-07nusb/usbd: fix /env/usbbusy bugcinap_lenrek
run the usb hub poll "work()" proc in the same filedescriptor group as the fileserver by forking the process in Srv.start callback. this also prevents the usbbusy filedescriptor from being kept open by the fileserver process.
2020-03-07rio: fix goodrect() bug (thanks mike)cinap_lenrek
mike from eff0ff.net reported the following: > I was running a second instance of rio inside a rio window and > suddenly weird things started happening. The second instance started > imposing arbitrary limits on the size of its windows and refused to > resize some of its windows when its own window was resized. > Turns out this happens if rio's screen is 3 times as high as wide > because of a tiny mistake in its goodrect function. ... and kindly provided a patch. thanks!
2020-03-07dossrv, 9660srv, hjfs: stop *READING* standard *OUTPUT* with -s flagcinap_lenrek
with the -s flag, we should read 9P messages from standard *INPUT* (fd 0) and write responses to standard *OUTPUT* (fd 1). before these servers where reading from fd 1, assuming they where both the same files.
2020-03-07lib9p: get rid of Srv.nopipe and Srv.leavefdsopen hackscinap_lenrek
it is unclear how Srv.nopipe flag should work inside postmountserv(). if a server wants to serve on stdio descriptors, he can just call srv() after initializing Srv.infd and Srv.outfd. The Srv.leavefdsopen hack can be removed now that acme win has been fixed.
2020-03-07acme: split win into winfs and rc script, get rid of lib9p leavefdsopen hackcinap_lenrek
split the acme win command into a winfs fileserver which handles /dev/cons emulation and a rc script responsible for launching the command. with these changes, the fd fiddling is not neccesary anymore and we can get rid of the leavefdsopen hack.
2020-03-07lib9p: fix typocinap_lenrek
2020-03-07lib9p: zero out per connection state in Srv template for listensrv()cinap_lenrek
in case listensrv() is called with a previously active Srv, we have to make sure that per connection state is zeroed out (locks and reference conuts). also, dont assume anything about the Ref structure. there might be implementations that have a spinlock in them.
2020-03-07dossrv: output iotrack error message to stderrcinap_lenrek
2020-03-07ramfs: don't use Srv.nopipecinap_lenrek
2020-03-07aux/acpi, aux/apm: remove nopipe -i flagcinap_lenrek
2020-03-07hgignore: ignore section 9 manpage indices, ignore init, kernels and ↵cinap_lenrek
bootloader binaries
2020-03-05devproc: fix syscalltrace read for ratracecinap_lenrek
2020-03-01hgfs: fix loadrevinfo() for empty log bugcinap_lenrek
loadrevinfo() would fail on a empty log portion due to a bug in the previous commit. the loop is supposed to skip all bytes until we encounter a empty line. the loop starts at the beginning of a line so when we encounter a \n, we have to terminate, otherwise read bytes until we see \n (end of a line) and then read another and test the condition again.
2020-03-01libsec: move AES XTS function prototypes to AES definition section in the ↵cinap_lenrek
header file
2020-03-01libsec: remove hash pickle functions, document ripemd160, cleanup sechash(2) ↵cinap_lenrek
manpage
2020-02-29kernel: simplify exec()cinap_lenrek
progarg[0] can be assigned to elem directly as it is a copy in kernel memory, so the char proelem[64] buffer is not neccesary. do the close-on-exit outside of the segment lock. there is no reason to keep the segment table locked.
2020-02-28devproc: make sure writewatchpt() doesnt overflow the watchpoint arraycinap_lenrek
the user buffer could be changed while we parse it resulting in a different number of watchpoints than initially calculated. so add a check to the parse loop so we wont overflow the watchpoint array.
2020-02-28kernel: make sure we wont run into the tos when copying exec() argumentscinap_lenrek
in case the calling process changes its arguments under us, it could happen that the final argument string lengths become bigger than initially calculated. this is fine as we still make sure we wont overflow the stack segment, but we could overrun into the tos structure at the end of the stack. so change the limit to the base of the tos, not the end of the stack segment.
2020-02-28devproc: cleanup procwrite size checkscinap_lenrek
writes to /proc/n/notepg and /proc/n/note should be able to write at ERRMAX-1 bytes, not ERRMAX-2. simplify write to /proc/n/args by just copying to local buf first and then doing a kstrdup(). the value of Proc.nargs does not matter when Proc.setargs is 1.
2020-02-27fix special case for null pointer constants in cond expressionsOri Bernstein
Section 6.5.15 of the C99 spec requires that if one argument of a ?: expression is a null pointer constant, and the other has a pointer type T*, then the type of the expression is T*. We were attempting to follow this rule, however, we only handled literal expressions when checking for null pointers. This change looks through casts, so 'nil' and 'NULL', and their expansion '(void*)0' are all detected as null pointer constants.