Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 08:17:55AM +0100, k...@shike2.com wrote:
 
  perhaps a linked list would make sense, but atexits(2) doesn't say which 
  order
  the functions will be run in.  and it doesn't seem like a great idea to 
  depend on
  atexits running things in a particular order.
 
 POSIX says they must be called in reverse order.

plan9 isn't POSIX OS :-).



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Charles Forsyth
On 6 November 2014 21:05, Oleg lego12...@yandex.ru wrote:

 I looked at atexit() and atexitdont() and i don't understand why these
 functions are implemented with a static array instead of singly linked
 list?
 May be somebody with a greater plan9 experience can help me with my
 question.


It might have been to avoid malloc in a fairly low-level function (and of
something that will never be freed),
or just because it was easier and, frankly, atexit let alone atexitdont
aren't used that much. I'd be surprised if
any use of atexit alone relied on any particular order, which is why your
problem hasn't been noticed.
The reverse order makes sense and atexit already does that. It's atexitdont
that's wrong.
The functions are unlikely to be called from any hot-spot.
I'd just make atexitdont copy down the entries after the one deleted.


Re: [9fans] Setting up Mail in Acme on the Raspberry Pi.

2014-11-07 Thread Mats Olsson
Hi again!

The DNS problem only occurs when I try to send from the gmail account
I'm using now to the Swedish domain: spray.se. An empty message
comes through ending with a dot . and that's it. Thanks for all your
effort to help me out!

Kind Greetings,
Mats

2014-11-06 20:12 GMT+01:00, Steffen Nurpmeso sdao...@yandex.com:
 erik quanstrom quans...@quanstro.net wrote:
  |On Wed Nov  5 13:20:02 EST 2014, sdao...@yandex.com wrote:
  | Anthony Sorace a...@9srv.net wrote:
  || I've been looking through the documentation and
  || the 9fans archive but I can't get a clear answer on
  || what to replace localhost.localdomain with.
  ||
  ||If the recipient's mail server is being strict (but within
  ||the bounds of the RFCs), that name is expected to be
  ||the real, externally-resolvable DNS name of the
  ||system you're sending from. The RFCs used to be more
  ||lax on that point, and some servers still are, but you
  ||shouldn't assume you'll be able to send to arbitrary
  ||endpoints unless you satisfy that.
  |
  | gmail.com shouldn't care at all, so it must be his own SMTP server.
  | (All i know in respect to this is Yandex.(ru|com), which requires
  | that the hostname in the SMTP FROM: command _is_ a Yandex
  | address, i.e., _no mismatch_ with _who_ you claim to be, which is
  |
  |that's not what anthony claimed.  he said that if you say
  | HELO example.com
  |that the following must be true
  |(a) dns return an a record for the query example.com, and

 Yes -- i think (or say, i'm sure that) gmail.com doesn't take care
 for that at all.  Neither does Yandex.  (Never tried any other
 free mail provider, i think they all depend on user
 authentication.)

  |(b) the ip returned must have a ptr record pointing to example.com
  |(this is less enforced these days due to the difficulty of \
  |maintaining pointer
  |records.)

 ..So reverse lookups don't even come into play here.
 I'm no longer sure wether old-school really hates not to be able
 to perform sender verification via DNS, today a lot of pretty
 prominent people use those providers themselve.

  |i think this is compatible with what you're saying.  this doesn't make
  |sense to me.  i don't do this:
  |
  | why i had to invent a *smtp-hostname* variable for the mailer
  | i maintain in order to address the SMTP FROM: content directly:
  |
  |perhaps you're conflating the envelope with the message?

 Puh Erik, maybe -- you know, i'm a boche :)
 Flying over an official document is the maximum i can handle, just
 enough to hammer the most important facts into some long-time
 cells, so please excuse possible distortion of terms.
 Indeed, looking into RFC 5321 (i have it even in my arena):

o  The domain name given in the EHLO command MUST be either a primary
   host name (a domain name that resolves to an address RR) or, if
   the host has no name, an address literal, as described in
   Section 4.1.3 and discussed further in the EHLO discussion of
   Section 4.1.4.

o  The reserved mailbox name postmaster may be used in a RCPT
   command without domain qualification (see Section 4.1.1.3) and
   MUST be accepted if so used.

 So huch!  SMTP communication how it actually happens in between me
 and the public mail providers is invalid, evil and yuck.
 I think i just wanted to add some value to what Anthony said.

 Regarding *smtp-hostname*: i think one cannot expect from what
 i call a normal user to understand just about anything regarding
 any protocol etc. internals -- for no other reasons but missing
 context information and maybe add lack of interest.  In fact, like
 i said above, the same is true for me.  Given that this BSD Mail
 derivative already has a variable called *hostname*, and that BSD
 / Linux systems have a hostname(1) command (even though POSIX only
 specifies uname(1) and documents the name of this node within an
 implementation-defined communications network; but POSIX.. well)
 i decided to name the capability to overwrite the hostname that is
 used in the SMTP MAIL FROM: command *smtp-hostname* (but not
 that the manual is really user friendly sofar).

 So now i'm stuck with it.  But since Matt uses Google the address
 used in MAIL FROM: cannot be the problem anyway, since Google
 doesn't care wether the addresses in the messages' From: header
 and the SMTP MAIL FROM: command match or not (the last time
 i tried; i admit that the Google message i've posted doesn't
 really make sense in this context; oops..).

 --steffen





[9fans] reattach to a rio session

2014-11-07 Thread András Hrubák
I connect plan9 by drawterm. After closing drawterm, how do I
re-connect to its rio to see again windows which were started before?
How do I reattach a window running e.g. 'rc' from other login session
to the current?



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 08:19:05AM +, Charles Forsyth wrote:
 On 6 November 2014 21:05, Oleg lego12...@yandex.ru wrote:
 
  I looked at atexit() and atexitdont() and i don't understand why these
  functions are implemented with a static array instead of singly linked
  list?
  May be somebody with a greater plan9 experience can help me with my
  question.
 
 
 It might have been to avoid malloc in a fairly low-level function (and of
 something that will never be freed),

If malloc works like in linux (at first invocation allocate more bytes than
requested and then each malloc() use this already allocated by kernel area
of memory), i think this isn't a big performance impact.

 or just because it was easier and, frankly, atexit let alone atexitdont
 aren't used that much. I'd be surprised if
 any use of atexit alone relied on any particular order, which is why your
 problem hasn't been noticed.
 The reverse order makes sense and atexit already does that. It's atexitdont
 that's wrong.
 The functions are unlikely to be called from any hot-spot.
 I'd just make atexitdont copy down the entries after the one deleted.

This is according to manual. Because now if we use atexit() with atexitdont()
we see the wrong behaviour from manual point of view.



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Charles Forsyth
On 7 November 2014 09:44, Oleg lego12...@yandex.ru wrote:

 f malloc works like in linux (at first invocation allocate more bytes than
 requested and then each malloc() use this already allocated by kernel area
 of memory), i think this isn't a big performance impact.


I wasn't really thinking about performance; as I said it's unlikely to be
in a critical path.

This is according to manual. Because now if we use atexit() with
 atexitdont()
 we see the wrong behaviour from manual point of view.


Yes, that's why I suggested fixing atexitdont to move any remaining values
down the array.


Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Charles Forsyth
On 7 November 2014 10:57, Steffen Nurpmeso sdao...@yandex.com wrote:

 Safety against asynchronous un-/registration can't be it, anyway.


No, there's a lock. I meant avoiding too many possible interactions between
low-level run-time
functions and the rest of the library. (I'd consider atexit and exit to be
lower-level functions than malloc.)
Since atexit is already used by profile, and is called by _profmain, which
is called very early on,
putting a call to malloc in that chain means you have to think that much
harder about interactions that are already quite subtle.
Note that _profmain allocates its memory directly using sbrk, probably for
that reason.
Suppose I later want to add a malloc profiler, can I call atexit to write
the results, or not?


Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Steffen Nurpmeso
Oleg lego12...@yandex.ru wrote:
 |On Fri, Nov 07, 2014 at 08:19:05AM +, Charles Forsyth wrote:
 | On 6 November 2014 21:05, Oleg lego12...@yandex.ru wrote:
 | 
 | I looked at atexit() and atexitdont() and i don't understand why these
 | functions are implemented with a static array instead of singly linked
 | list?

 | It might have been to avoid malloc in a fairly low-level function (and of
 | something that will never be freed),
 |
 |If malloc works like in linux (at first invocation allocate more bytes than
 |requested and then each malloc() use this already allocated by kernel area
 |of memory), i think this isn't a big performance impact.

Safety against asynchronous un-/registration can't be it, anyway.

--steffen



[9fans] Error booting with a new user.

2014-11-07 Thread Mats Olsson
Hi again!

Actually it seems to be a cosmetic error but anyway I'd like to get it
solved. This is what I get at bootup after ipconfig ... :
-s: 'bin/-s' file does not exist
rc: /rc/lib/rcmain:30 token EOF: syntax error

init: starting /bin/rc
term%

So after the message I can boot my setup by just executing the exec
rio line in profile and it seems that everything is OK. Wouldn't mind
getting this error message go away though. I have just added a newuser
substituting glenda with my username in cmdline.txt. Would be very
grateful for any hint on how to solve this.

Kind Regards,
Mats



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 11:49:08AM +, Charles Forsyth wrote:
 On 7 November 2014 10:57, Steffen Nurpmeso sdao...@yandex.com wrote:
 
  Safety against asynchronous un-/registration can't be it, anyway.
 
 
 No, there's a lock. I meant avoiding too many possible interactions between
 low-level run-time
 functions and the rest of the library. (I'd consider atexit and exit to be
 lower-level functions than malloc.)
 Since atexit is already used by profile, and is called by _profmain, which
 is called very early on,
 putting a call to malloc in that chain means you have to think that much
 harder about interactions that are already quite subtle.

  This is an interesting. With this info the array reordering in atexitdont()
looks good comparing to malloc in atexit().




Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Charles Forsyth
Not for atexit, but for some other functions, I've had to follow various
trails in glibc,
and it's just an intricate convoluted nightmare, so that probably colours
my view.


Re: [9fans] reattach to a rio session

2014-11-07 Thread Anthony Sorace
 After closing drawterm, how do I re-connect to its rio to see again windows 
 which were started before? How do I reattach a window running e.g. 'rc' from 
 other login session to the current?

Short answer:
You can pre-arrange for this to work with command-line tools. Except in 
a very limited sense, you can't do this with graphical tools.

Long answer:
There are various ways to set up an rc session (or any command-line 
tool) so that you can reattach later, but you need to arrange for that ahead of 
time. The simplest, using all tools which come with the system, is probably 
running:
srv -e 'rc' whatever
and then using con /srv/whatever to connect to it later. I use this for a few 
system services, as it has the fewest moving parts, but it's imperfect 
(especially for a shell), because local echo won't always be what you expect, 
you can't get at the file descriptors in all the ways you might like, multiple 
readers/writers will get screwed up, c.

A good solution which is much more flexible and general, but somewhat 
more involved to set up and learn, is hubfs, available from contrib. See here:
http://plan9.bell-labs.com/wiki/plan9/Hubfs/index.html

As far as I'm aware, there isn't an existing way to do this with 
graphical programs. Hubfs will allow you to do it in some very limited ways, 
but it's almost certainly not what you're after.

In cases where this manner of persistence really matters, we have VNC, 
although that's obviously unsatisfactory on other fronts. The group at LSUB was 
doing some great work with a plan 9 way of accomplishing this goal in Octopus 
(http://lsub.org/ls/octopus.html); I don't believe they're still working on 
that, though.

Anthony




Re: [9fans] reattach to a rio session

2014-11-07 Thread Skip Tavakkolian
if disconnection is the only issue (e.g. not changing ip addresses between
disconnect/re-connect), aan(8) might be what you need.


On Fri, Nov 7, 2014 at 1:44 AM, András Hrubák bandie9...@gmail.com wrote:

 I connect plan9 by drawterm. After closing drawterm, how do I
 re-connect to its rio to see again windows which were started before?
 How do I reattach a window running e.g. 'rc' from other login session
 to the current?




[9fans] acme mouse wheel

2014-11-07 Thread Oleg
  Hi.

Does anybody known how to use mouse wheel to scroll acme window?



Re: [9fans] acme mouse wheel

2014-11-07 Thread Kostarev Ilya
On p9p works out of the box.

-- 
Kostarev Ilya

On 7 Nov 2014 at 20:00:46, Oleg (lego12...@yandex.ru) wrote:

Hi.  

Does anybody known how to use mouse wheel to scroll acme window?  



Re: [9fans] acme mouse wheel

2014-11-07 Thread andrey mirtchovski
http://plan9.bell-labs.com/wiki/plan9/mouse_scrolling/

On Fri, Nov 7, 2014 at 9:56 AM, Oleg lego12...@yandex.ru wrote:
   Hi.

 Does anybody known how to use mouse wheel to scroll acme window?




Re: [9fans] acme mouse wheel

2014-11-07 Thread trebol
Have you set the mouse to ps2intellimouse?




Re: [9fans] atexit() atexitdont()

2014-11-07 Thread sl
 How can i send a patch to 9front?

You can file an issue and link to your patch here:

http://code.google.com/p/plan9front/issues/list

Or you can sign up for the 9front mailing list and post there:

http://9front.org/lists.html

sl



Re: [9fans] acme mouse wheel

2014-11-07 Thread Mats Olsson
On my Raspberry Pi a cordless mouse with wheel worked out of the box
and so did the cordless keyboard.
Kind Regards,
Mats

2014-11-07 18:25 GMT+01:00, tre...@india.com tre...@india.com:
 Have you set the mouse to ps2intellimouse?






Re: [9fans] atexit() atexitdont()

2014-11-07 Thread erik quanstrom
On Fri Nov  7 07:26:55 EST 2014, charles.fors...@gmail.com wrote:

 Not for atexit, but for some other functions, I've had to follow various
 trails in glibc,
 and it's just an intricate convoluted nightmare, so that probably colours
 my view.

calling malloc from the atexit path will pull malloc() into every executable.
i think this is the real reason not to do this.

- erik



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Steffen Nurpmeso
Charles Forsyth charles.fors...@gmail.com wrote:
 |On 7 November 2014 10:57, Steffen Nurpmeso sdao...@yandex.com wrote:
 |
 | Safety against asynchronous un-/registration can't be it, anyway.
 |
 |No, there's a lock. I meant avoiding too many possible interactions between

I thought more about reentrancy because he referred to Linux.
But of course you're right.

 |low-level run-time
 |functions and the rest of the library. (I'd consider atexit and exit to be
 |lower-level functions than malloc.)

I do not really agree for the highly integrated and portable
solution that i worked with, it was just fine there and splitted
into normal and final handlers.  But..

 |Since atexit is already used by profile, and is called by _profmain, which
 |is called very early on,
 |putting a call to malloc in that chain means you have to think that much
 |harder about interactions that are already quite subtle.
 |Note that _profmain allocates its memory directly using sbrk, probably for
 |that reason.
 |Suppose I later want to add a malloc profiler, can I call atexit to write
 |the results, or not?

It seems you can add an atom and it works without spending any
further thought.
That is cool.

--steffen



Re: [9fans] acme mouse wheel

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 05:25:51PM +, tre...@india.com wrote:
 Have you set the mouse to ps2intellimouse?

  No. Thank you for the hint!



Re: [9fans] acme mouse wheel

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 10:28:18AM -0700, andrey mirtchovski wrote:
 http://plan9.bell-labs.com/wiki/plan9/mouse_scrolling/

  Thank you! That has helped me.



Re: [9fans] atexit() atexitdont()

2014-11-07 Thread Oleg
On Fri, Nov 07, 2014 at 02:53:11PM -0500, erik quanstrom wrote:
 On Fri Nov  7 07:26:55 EST 2014, charles.fors...@gmail.com wrote:
 
  Not for atexit, but for some other functions, I've had to follow various
  trails in glibc,
  and it's just an intricate convoluted nightmare, so that probably colours
  my view.
 
 calling malloc from the atexit path will pull malloc() into every executable.
 i think this is the real reason not to do this.

  That's interesting. Is malloc() so huge to worry about it?



Re: [9fans] Persistent font in Acme.

2014-11-07 Thread Mats Olsson
I like the idea of making a small script but I couldn't make it work.
What I want is to get this to execute without to much typing:
term%acme -f /lib/font/bit/lucidasans/latin1.10.font and that's it.
Any suggestion for a script and how to execute it would be most
appreciated.
Kind greetings,
Mats

2014-11-06 14:56 GMT, Iruatã Souza iru.mu...@gmail.com:
 yes, but what about two fonts? I only remember acme.

 On Thu, Nov 6, 2014 at 12:37 PM, Lee Fallat ircsurfe...@gmail.com wrote:
 On Thu, Nov 6, 2014 at 9:04 AM, Iruatã Souza iru.mu...@gmail.com wrote:
 what other program needs two fonts?

 On Thu, Nov 6, 2014 at 11:30 AM, erik quanstrom quans...@quanstro.net
 wrote:
 On Thu Nov  6 08:15:54 EST 2014, iru.mu...@gmail.com wrote:
 acme is not the system.

 On Thu, Nov 6, 2014 at 10:48 AM, Stuart Morrow
 morrow.stu...@gmail.com wrote:
  The way most congruent with the system might be to have $font a
  2-variable (like prompt), to have you favourite fixed- and
  variable-width fonts both settable in the obvious place: your
  profile.
  Completely unrelated programs could conceivably reuse this trick.

 https://code.google.com/p/plan9front/source/browse/sys/src/cmd/rio/rio.c#173

 rio uses what is in $font if not specified on the command-line.

 You can easily implement it in any gui in plan 9.






Re: [9fans] Error booting with a new user.

2014-11-07 Thread Quintile
the first time you login as a new user you need to run the newuser script, I 
think it is /sys/lib/newuser (no plan9 to hand)

check the plan9 wiki

-Steve





 On 7 Nov 2014, at 12:17, Mats Olsson plan9@gmail.com wrote:
 
 Hi again!
 
 Actually it seems to be a cosmetic error but anyway I'd like to get it
 solved. This is what I get at bootup after ipconfig ... :
 -s: 'bin/-s' file does not exist
 rc: /rc/lib/rcmain:30 token EOF: syntax error
 
 init: starting /bin/rc
 term%
 
 So after the message I can boot my setup by just executing the exec
 rio line in profile and it seems that everything is OK. Wouldn't mind
 getting this error message go away though. I have just added a newuser
 substituting glenda with my username in cmdline.txt. Would be very
 grateful for any hint on how to solve this.
 
 Kind Regards,
 Mats



Re: [9fans] Persistent font in Acme.

2014-11-07 Thread sl
 I like the idea of making a small script but I couldn't make it work.
 What I want is to get this to execute without to much typing:
 term%acme -f /lib/font/bit/lucidasans/latin1.10.font and that's it.
 Any suggestion for a script and how to execute it would be most
 appreciated.

Anything you type into the shell that produces the desired result is
a valid shell script.

So, you could make a script $home/bin/rc/a:

#!/bin/rc
acme -f /lib/font/bit/lucidasans/latin1.10.font

Do chmod +xr $home/bin/rc/a and then run it by just typing a.

sl



Re: [9fans] Persistent font in Acme.

2014-11-07 Thread sl
 Thanks for your input. I tried something similar and got an error
 message. I tried your suggestion and got the same error message. It
 says: rc: /bin/a:3: token EOF:syntax error. So something else must
 be added. Thanks!

Make sure the file ends with a newline.

My example works on my system.

sl



Re: [9fans] Error booting with a new user.

2014-11-07 Thread Mats Olsson
Hi Steve!

Thanks for your input! I checked the docs, manuals and the wiki before
trying to add another user. After adding the user I tried to reshape
the environment I had made as Glenda and I think something went wront
there.

Kind Greetings,
Mats

2014-11-07 19:23 GMT, Quintile st...@quintile.net:
 the first time you login as a new user you need to run the newuser script, I
 think it is /sys/lib/newuser (no plan9 to hand)

 check the plan9 wiki

 -Steve





 On 7 Nov 2014, at 12:17, Mats Olsson plan9@gmail.com wrote:

 Hi again!

 Actually it seems to be a cosmetic error but anyway I'd like to get it
 solved. This is what I get at bootup after ipconfig ... :
 -s: 'bin/-s' file does not exist
 rc: /rc/lib/rcmain:30 token EOF: syntax error

 init: starting /bin/rc
 term%

 So after the message I can boot my setup by just executing the exec
 rio line in profile and it seems that everything is OK. Wouldn't mind
 getting this error message go away though. I have just added a newuser
 substituting glenda with my username in cmdline.txt. Would be very
 grateful for any hint on how to solve this.

 Kind Regards,
 Mats





Re: [9fans] Persistent font in Acme.

2014-11-07 Thread Mats Olsson
A followed your advise and got permission denied so I executed
chmod 755 ... and then it worked. Thanks a lot! I really appreciate
your help.
Kind Greetings,
Mats

2014-11-07 21:22 GMT, s...@9front.org s...@9front.org:
 Thanks for your input. I tried something similar and got an error
 message. I tried your suggestion and got the same error message. It
 says: rc: /bin/a:3: token EOF:syntax error. So something else must
 be added. Thanks!

 Make sure the file ends with a newline.

 My example works on my system.

 sl