{"push_id":731076912,"size":4,"distinct_size":4,"ref":"refs/heads/net","head":"371fe4924f85e09e2c23c81c5d0f7d10ad314061","before":"ee5792cfbc6ea851869c2fab0025769ee3b797d1","commits":[{"sha":"7ec7e201e70815bc1f584b483bbbb0398253d712","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Support O_NONBLOCK when opening #I chans\n\nApplications can set O_NONBLOCK when cloning and can getfl() to see\nO_NONBLOCK, but they cannot toggle O_NONBLOCK via setfl().  Getting via\ngetfl() is of dubious value, since only the cloned chan will have the\nmark.  To dynamically change, they need to use the ctl message.  I\nwasn't interested in having device ops that translate a setfl() call or\nsomething.  That's the purpose of the ctls, after all.\n\nIt's up to individual devices if they want to handle O_NONBLOCK when a\nchan is opened.  They are free to throw an error() from dev->open.\n\nNote that dial() currently does not support open flags to pass through\nto the clone.  If you want to play around with this, you'll need send\nthe ctl message.\n\nAlso note that the non-blocking nature of the chan is part of the conv\n(the queues in this case), and not really part of the chan.  If a\nprocess writes a \"nonblock\" ctl message into the conv, all other chans\nwill now behave in a O_NONBLOCK-ing manner, since the underlying conv\nchanged.  This is different than the unix way of dealing with\nO_NONBLOCK, where each socket/chan can be treated differently.\n\nIt's tempting to just remove the O_NONBLOCK completely and only allow a\nctl message, and fake O_NONBLOCK in userspace (e.g. in open() or the 9ns\nnetworking shims in glibc), but that's at least one extra syscall for\nevery opened connection, both for clones and (in future commits) for\nlisten/accept4().\n\nI strongly considered allowing O_NONBLOCK to set \"nonblock on\" for *any*\n #I file, specifically ctl and data files.  That way, you could just do:\n\n\topen(\"/net/tcp/6/data\", O_RDWR | O_NONBLOCK);\n\nand then have non-blocking I/O.  It's what a user might expect from\nopen() with O_NONBLOCK.  The deciding point against this was that I\ndidn't want data to have any control side-effects, even on open().  This\nis only really important if you drop a file in #s, and then someone who\nis allowed to read/write to it could suddenly change the nonblocking\nstatus.\n\nFinally, note that these changes support non-blocking qio in #I,\nspecifically on conversation inbound and outbound queues.  Depending on\nyour medium, you could still block *below* the IP stack on a write().\nFor instance, ipoput4() calls the various bwrites, and eventually\netheroq().  It is possible to block there, unless the Ethernet device is\nset to nonblocking.  Check out etherwrite() for specifics.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/7ec7e201e70815bc1f584b483bbbb0398253d712"},{"sha":"d113ddfab34ac922d9ee13332665aaa6eb14e1ad","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Allow non-blocking listens\n\nPlan 9 listens (accept() in the sockets world) can now be set to\nnon-blocking.\n\nI didn't build in suport for accept4()-type SOCK_NONBLOCK, which sets\nthe *new* conversation/socket to non-blocking, saving a syscall.  Our\naccept()s and listen()s are already super slow, and we will need a\nfaster interface.  We already use seven syscalls for the accept() shim,\nand a normal Plan 9 listen takes three or four (depending on whether or\nnot you keep the ctlfd around).  That's way too much.  We can build\nsomething like accept4() natively (still going through #I, but not using\nopen(), or at least not the traditional open().","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/d113ddfab34ac922d9ee13332665aaa6eb14e1ad"},{"sha":"cdeee209f16dc93e27853fba754363e985a991aa","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"iplib: Add a trailing \\n to the error output\n\nOtherwise the output looks messy.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/cdeee209f16dc93e27853fba754363e985a991aa"},{"sha":"371fe4924f85e09e2c23c81c5d0f7d10ad314061","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"iplib: Support non-blocking listens\n\nWe want to pass the -1 through but not treat it like a full error and\nprint out something, since non-blocking is a legitimate usage.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/371fe4924f85e09e2c23c81c5d0f7d10ad314061"}]}