Re: [9fans] pipe: bug or feature?
maybe it's a problem with eof detection. I tried to reproduce it using a threaded version (see attached), but it works correctly. On Fri, Mar 31, 2017 at 5:29 PM arisawa wrote: > Hello, > > I was playing with an experimental code on pipe and met with a problem > which I don’t understand. > > the program reads a file and writes it to one end of pipe and then reads > it from another end of pipe. > the buffer for writing pipe is named buf0, and for reading pipe is named > buf. > and I found the program does not finish unless sizeof(buf) > sizeof(buf0). > is this a bug or feature of pipe? > > Kenji Arisawa > > === BEGIN a.c === > #include > #include > > char *argv0; > > void > usage(void) > { > fprint(2,"usage: %s file\n",argv0); > exits("usage"); > } > > void > main(int argc, char *argv[]) > { > int fd,pfd[2]; > char buf[256]; > char buf0[256]; > /* need to be sizeof(buf) > sizeof(buf0) > * but this condition is very curious to me */ > int n; > char *file; > argv0 = argv[0]; > argc--;argv++; > USED(argc); > if(argv[0] == nil) > usage(); > file = argv[0]; > fd = open(file,OREAD); > if(fd < 0) > sysfatal("no such file"); > > if(pipe(pfd) < 0) > sysfatal("pipe error"); > print("pfd: %d %d\n",pfd[0],pfd[1]); > > while((n = read(fd,buf0,sizeof(buf0))) > 0){ > print("read: %d %s\n",n,file); > n = write(pfd[1],buf0,n); > print("write: %d\n",n); > } > close(pfd[1]); > while((n = read(pfd[0],buf,sizeof(buf))) > 0){ > buf[n] = 0; > print("%d %s\n",n,buf); > } > print("%d\n",n); > > exits(nil); > } > === END a.c === > #include #include #include void copyfunc(void *v) { int *fd, n; char buf[256]; int tot = 0; fd = v; while((n = read(fd[0], buf, sizeof buf)) > 0){ if(write(fd[1], buf, n) != n) sysfatal("write: %r"); tot += n; fprint(2, "copied %d byte chunk\n", n); } fprint(2, "total copied: %d\n", tot); close(fd[0]); close(fd[1]); threadexits(nil); } /* copy stdin to stdout through a pipe. run like ./pipetest /dev/null */ void threadmain(int argc, char *argv[]) { int fd[4]; int pfd[2]; if(pipe(pfd) < 0) sysfatal("pipe error"); fd[0] = 0; fd[1] = pfd[0]; fd[2] = pfd[1]; fd[3] = 1; proccreate(copyfunc, fd, 8192); copyfunc(fd+2); }
Re: [9fans] unix 8th/10th edition sources
On Sun, Apr 02, 2017 at 12:21:58AM +, Skip Tavakkolian wrote: > Thanks for the correction. I saw that in David's email, but I was confused > by the "author:" header when looking at blit.c with the hg web interface: > > http://code.9front.org/hg/plan9front/file/dc783947692e/sys/src/games/blit/blit.c > > it probably refers to a change submitted by cinap. It does. All that header stuff is about the changeset you're looking at; for an actual file history you could use http://code.9front.org/hg/plan9front/log/dc783947692e/sys/src/games/blit/blit.c (note the 'log' in place of the 'file' in the url). Of course 'file' shows the latest changeset log, and 'log' shows the change history of a specific file! khm
Re: [9fans] unix 8th/10th edition sources
Thanks for the correction. I saw that in David's email, but I was confused by the "author:" header when looking at blit.c with the hg web interface: http://code.9front.org/hg/plan9front/file/dc783947692e/sys/src/games/blit/blit.c it probably refers to a change submitted by cinap. On Sat, Apr 1, 2017 at 2:52 AM hiro <23h...@gmail.com> wrote: > it's aiju's, not cinap_lenrek's blit emulator. > > On 4/1/17, Skip Tavakkolian wrote: > > in case you've not seen the announcement on twitter, Rob announced that > the > > sources for v8 and v10 have been released: > > https://twitter.com/rob_pike/status/846780261350096896 > > > > you can find everything here: > > http://www.tuhs.org/Archive/Distributions/Research/ > > > > 0intro has instructions on how to run them on SIMH. lastly 0intro sent > out > > instructions on how to use ɔıuɐd‾ʃǝuɹǝʞ's Blit terminal emulator on Plan > 9 > > to access those unix distros: > > http://minnie.tuhs.org/pipermail/tuhs/2017-March/009440.html > > > > -Skip > > > >
Re: [9fans] 9front sources (9p importable)?
just to add that these multiple mounts are a function of 9fronts 9fs command. see https://code.9front.org/hg/plan9front/raw-file/39e9c78542d8/rc/bin/9fs -Steve > On 1 Apr 2017, at 10:00, Kurt H Maier wrote: > >> On Sat, Apr 01, 2017 at 08:53:46AM +, Skip Tavakkolian wrote: >> is there a "sources" repo for 9front? > > yep. '9fs 9front' should mount it, although we're currently considering > breaking this out into various smaller bites -- it currently mounts > contrib, sources, the buglist, and the mailing list archives, among > other things. Look at 9front's /rc/bin/9fs for details. > > khm
Re: [9fans] DNS
possibly. however it didn't take the plan9 community long to figure out what needed to be changed. Thus, by definition, it was not too obscure. -Steve > On 1 Apr 2017, at 10:46, Alexandru Gheorghe wrote: > > That's a weird name for CNAME traversing. Should've been (maybe more > appropriately): "MaxCnameDepth". > > >> On 04/01/2017 04:40 AM, Skip Tavakkolian wrote: >> Maxretries to > 5 > > -- > ; Alexandru Gheorghe > ; > ; >
Re: [9fans] IPV6
nice.- erik
Re: [9fans] IPV6
ipv6 is fece:5
Re: [9fans] IPV6
A shitshow is an apt description. I searched hard for an answer to my question. Regards, brucee On 1 April 2017 at 21:06, Kurt H Maier wrote: > On Sat, Apr 01, 2017 at 02:46:53AM -0700, Ori Bernstein wrote: > > On Sat, Apr 01, 2017 at 08:36:55PM +1100, Bruce Ellis wrote: > > > Does anyone know what IPV6 addresses like fec0:0:0:%1 mean and how > to > > > make a real (plan9) IPV6 address from them. > > > > > > Regards. > > > > > > brucee > > > > The portion before the '%' is a plain old (link local) ipv6 address. The > > part after the '%' is a zone id. It's safe to ignore. > > > > Because link local addresses share prefixes, they may need to be told > > what interface to come out of. They can be ignored safely enough, or if > > you want you use an arbitrary string like 'fe80::%/net.alt' as the zone. > > > > > > Careful. fec0: is site-local, not link-local, which is fe80:. I've > never seen a zone ID attached to a site-local address; I thought the > zone shit was introduced at the same time they deprected the site-local > addresses... > > ipv6 is a shitshow. Cursory inspection of relevant RFCs does not lead > to clarity. Godspeed. > > khm > >
Re: [9fans] IPV6
On Sat, Apr 01, 2017 at 02:46:53AM -0700, Ori Bernstein wrote: > On Sat, Apr 01, 2017 at 08:36:55PM +1100, Bruce Ellis wrote: > > Does anyone know what IPV6 addresses like fec0:0:0:%1 mean and how to > > make a real (plan9) IPV6 address from them. > > > > Regards. > > > > brucee > > The portion before the '%' is a plain old (link local) ipv6 address. The > part after the '%' is a zone id. It's safe to ignore. > > Because link local addresses share prefixes, they may need to be told > what interface to come out of. They can be ignored safely enough, or if > you want you use an arbitrary string like 'fe80::%/net.alt' as the zone. > > Careful. fec0: is site-local, not link-local, which is fe80:. I've never seen a zone ID attached to a site-local address; I thought the zone shit was introduced at the same time they deprected the site-local addresses... ipv6 is a shitshow. Cursory inspection of relevant RFCs does not lead to clarity. Godspeed. khm
Re: [9fans] unix 8th/10th edition sources
it's aiju's, not cinap_lenrek's blit emulator. On 4/1/17, Skip Tavakkolian wrote: > in case you've not seen the announcement on twitter, Rob announced that the > sources for v8 and v10 have been released: > https://twitter.com/rob_pike/status/846780261350096896 > > you can find everything here: > http://www.tuhs.org/Archive/Distributions/Research/ > > 0intro has instructions on how to run them on SIMH. lastly 0intro sent out > instructions on how to use ɔıuɐd‾ʃǝuɹǝʞ's Blit terminal emulator on Plan 9 > to access those unix distros: > http://minnie.tuhs.org/pipermail/tuhs/2017-March/009440.html > > -Skip >
Re: [9fans] IPV6
It doesn't work if I ignore it. ip(2) doesn't mention '%' Regards, brucee On 1 April 2017 at 20:46, Ori Bernstein wrote: > On Sat, Apr 01, 2017 at 08:36:55PM +1100, Bruce Ellis wrote: > > Does anyone know what IPV6 addresses like fec0:0:0:%1 mean and how to > > make a real (plan9) IPV6 address from them. > > > > Regards. > > > > brucee > > The portion before the '%' is a plain old (link local) ipv6 address. The > part after the '%' is a zone id. It's safe to ignore. > > Because link local addresses share prefixes, they may need to be told > what interface to come out of. They can be ignored safely enough, or if > you want you use an arbitrary string like 'fe80::%/net.alt' as the zone. > > >
Re: [9fans] IPV6
On Sat, Apr 01, 2017 at 08:36:55PM +1100, Bruce Ellis wrote: > Does anyone know what IPV6 addresses like fec0:0:0:%1 mean and how to > make a real (plan9) IPV6 address from them. > > Regards. > > brucee The portion before the '%' is a plain old (link local) ipv6 address. The part after the '%' is a zone id. It's safe to ignore. Because link local addresses share prefixes, they may need to be told what interface to come out of. They can be ignored safely enough, or if you want you use an arbitrary string like 'fe80::%/net.alt' as the zone.
Re: [9fans] DNS
That's a weird name for CNAME traversing. Should've been (maybe more appropriately): "MaxCnameDepth". On 04/01/2017 04:40 AM, Skip Tavakkolian wrote: > Maxretries to > 5 -- ; Alexandru Gheorghe ; ;
Re: [9fans] pi zero w
> On Wed, Mar 15, 2017 at 1:23 AM Skip Tavakkolian > wrote: > > ... > FYI to others trying this out: I built the pi2wifi kernel configuration, > but it wasn't able to join the network. I realized later that the labs > version of factotum wont work; aux/wpa requires 9front factotum changes to > handle wpapsk/wpa2 credentials. If you apply patch wpa-psk, it will add the required module to factotum as well as installing the aux/wpa command needed for wifi; both of these are imported from 9front. Note that the aux/wpa in the patch is an older, simpler version. If you find it doesn't work for wpa2, it's worth trying the current 9front version instead. I've tested pi2wifi with two APs. One works fine with the older aux/wpa. The other will only authenticate when I use the newer 9front version. (And that AP also makes my ancient Snow Leopard macbook crash hard when it tries to connect.)
[9fans] IPV6
Does anyone know what IPV6 addresses like fec0:0:0:%1 mean and how to make a real (plan9) IPV6 address from them. Regards. brucee
[9fans] unix 8th/10th edition sources
in case you've not seen the announcement on twitter, Rob announced that the sources for v8 and v10 have been released: https://twitter.com/rob_pike/status/846780261350096896 you can find everything here: http://www.tuhs.org/Archive/Distributions/Research/ 0intro has instructions on how to run them on SIMH. lastly 0intro sent out instructions on how to use ɔıuɐd‾ʃǝuɹǝʞ's Blit terminal emulator on Plan 9 to access those unix distros: http://minnie.tuhs.org/pipermail/tuhs/2017-March/009440.html -Skip
Re: [9fans] 9front sources (9p importable)?
On Sat, Apr 01, 2017 at 08:53:46AM +, Skip Tavakkolian wrote: > is there a "sources" repo for 9front? yep. '9fs 9front' should mount it, although we're currently considering breaking this out into various smaller bites -- it currently mounts contrib, sources, the buglist, and the mailing list archives, among other things. Look at 9front's /rc/bin/9fs for details. khm
[9fans] 9front sources (9p importable)?
is there a "sources" repo for 9front? thanks, -Skip
Re: [9fans] pi zero w
trying again. this one bounced a while back. On Wed, Mar 15, 2017 at 1:23 AM Skip Tavakkolian wrote: > Thank you! > > FYI to others trying this out: I built the pi2wifi kernel configuration, > but it wasn't able to join the network. I realized later that the labs > version of factotum wont work; aux/wpa requires 9front factotum changes to > handle wpapsk/wpa2 credentials. > > > On Mon, Mar 13, 2017 at 12:19 PM Richard Miller <9f...@hamnavoe.com> > wrote: > > In /contrib/miller there is a new 9pi.img.gz which extends > native wifi support to the new Raspberry Pi Zero W, as well > as the original Pi 3. For convenience there are also new > 9pi and 9pi2 kernels, and updated 9/bcm source. > > The wifi driver is now configured into all the pi kernels, > but it will only be enabled at boot time if cmdline.txt > explicitly includes the definition ether1=type=4330 > > >