Re: [9fans] openat()

2024-04-06 Thread David Leimbach via 9fans
Depending on the implementation of the file system, openat vs open can be more efficient if there’s a lot of metadata locking for file creation.Sent from my iPhoneOn Apr 6, 2024, at 1:36 PM, ron minnich  wrote:openat gives you the effect of 'cd path; open file' without having to cd. I don't see a lot of benefit to it unless you're opening a lot of files at that path. My first reaction, assuming you have a lot of files in that directory, was something likebind /dir /n/x and then just open /n/x/file... for a lot of files. This would work for any system call that takes a path.The question I had was, can I get the benefit of *at without doing what linux is doing, namely, for all system calls with a path, make an '...at' version.I am guessing so, though I'm not sure it's as efficient.On Fri, Apr 5, 2024 at 8:19 PM  wrote:My two cents on this:

What you _would_ want for this would be the ability to walk from the existing fd, however the limits of 9p walk make this a bit impossible to implement in a great way in my opinion. From walk(5):

The fid must represent a directory unless zero path name elements(for just cloning the fid) are specified. The fid must be valid in the current session and must not have been opened for I/O by an open or create message.

Since not every fid is eligible for being walked from, in order to implement opanat() in any way that would be better than just batching the fd2path and open would be to keep a "last directory" associated, like what we do with the string used to open it. Also worth mentioning that fd2path is not without its own problems, it's possible that the namespace has changed since the file has been opened so the same path may not work the second time. So tagging the last directory Chan would be "more correct", but I am not sure how useful this is.

Answering some other comments made:As I understand it from the rationale section on the
 linux man page, the call exists to avoid a race condition between 
checking that a directory exists and doing something to a path 
containing it. An additional motivator is providing the effect of 
additional current working directories notably for Linux threads (which 
presumably don't have their own. I think 'threads'  (processes that 
share memory) on Plan 9 do???).Each process has it's own current working directory:

% pwd
/home/moody
% @{cd /}
% pwd
% /home/moody
This is all based on the assumption that holding a file/directory open keeps it alive and in existence... which on Plan 9, I think it doesn't, does it? As I understand it, remove can remove a file or directory that is open, which is not like UNIX/Linux...
Depends on the file server implementation, I find that for more synthetic files they are indeed kept alive as long there is someone with a reference to the fid.
This is identifiable if all the cleanup happens on clunks(destroyfid in lib9p), which only happen when a fid's refcount hits zero.

For non-synthetic or more "disk" file servers the behavior can differ. Cwfs does not keep the data around, readers that attempt to read a deleted file, even if they already have a reference open to it will result in a phase error. However 9front's ramfs keeps the data around.

My test for this was as follows:win1% echo 'something' >/tmp/testwin2% win1% rm /tmp/test
# observe the error(if any) on win2So you really can't assume either case.Thanks,
moodyP.S.I apologize for the formatting, it seems my emails are not making it to the list when I attempt to send them from my mail server so I had to copy this response in to the web form.  I would like to figure out why if possible.

9fans
  / 9fans / see
discussions
  +
participants
  +
delivery options
Permalink



Re: [9fans] Supported Notebooks

2024-01-24 Thread David Leimbach via 9fans
Or you could just run 9front?Sent from my iPhoneOn Jan 24, 2024, at 10:48 AM, alex...@posteo.de wrote:
Hello everyone,I would like to know which hardware (apart from the hardware listed here: https://plan9.io/wiki/plan9/Supported_PC_hardware/index.html) is supported by Plan 9. Is there any experience, especially with regard to other Thinkpad models?9front even runs on the MNT Reform, would the corresponding code be easily transferable to 9legacy?Many thanks in advance!Best regards, alex

9fans
  / 9fans / see
discussions
  +
participants
  +
delivery options
Permalink



Re: [9fans] acme and sam - mouse suggestions?

2022-02-01 Thread David Leimbach via 9fans
I use a big heavy trackball. Kensington pro trackball is pricey but you get 
four buttons and a scroll ring.

Got my first one well over 10 years ago and it’s still my daily driver. I have 
a second wireless one on a Mac. The wired one is better overall if you can get 
them. The wireless one can work with a USB dongle (tiny) or Bluetooth.

Again, they’re a bit expensive but I love the four quadrant buttons too much 
and this thing has survived moving across the country a few times with my less 
than wonderful packing skills.

Lots of great advice in this thread though! Good luck!

Sent from my iPhone

> On Jan 28, 2022, at 3:04 AM, adr  wrote:
> 
> On Fri, 28 Jan 2022, umbrati...@prosimetrum.com wrote:
> 
>> I use a Kensington Expert which I guess falls into the big
> 
> That's funny, it's the very same I was looking at.
> 
> aliexpress.com/item/1005001848991454.html
> 
>> The scrollwheel thing is pretty nice too.
> 
> Three button mice with lateral scrollwheel are even harder to
> find. That's why I ended up with this cheap one:
> 
> aliexpress.com/item/404785639.html
> 
> It's not so bad, the plastic feels a little cheaper than one from
> hp or ibm but cost less than half the price... and it is very
> accurate, really.  It enters sleep mode to save battery (you can't
> disable this) and the only way to wake it is clicking one of the
> buttons (not the wheel). Now the funny part: it sends the click to
> the host. A nightmare.
> 
> Thanks for the feedback,
> adr.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T49f3cceea70d2b61-M64be1c26058516ba001c9b4d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] licence question

2022-02-01 Thread David Leimbach via 9fans



> On Jan 29, 2022, at 8:03 AM, ibrahim via 9fans <9fans@9fans.net> wrote:
> 
> And I believe that the reason why NetBSD, OpenBSD, FreeBSD are not as wide 
> spread as Linux was the lack of a compiler suite conforming to the BSD license

For some people it’s because they didn’t have a math coprocessor and Linux 
didn’t need one. For others it was the AT lawsuit.

I haven’t ever heard the compiler tool chain was a big reason, but I’d be 
interested to hear your perspective here. GCC can produce code of any license.
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T3e07bfdf263a83c8-Mf47e78387528db7b42f231b3
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Breaking up long lines in sam into more manageable ones

2021-08-26 Thread David Leimbach via 9fans


Sent from my iPad

> On Aug 26, 2021, at 12:01 PM, fwrm via 9fans <9fans@9fans.net> wrote:
> 
> 
>> On Wednesday, 25 August 2021, at 9:31 PM, David Leimbach wrote:
>> Try in the tagline 
>> Edit ,|fold -s -w80
>> Highlight it and middle click it.
> 
> Yeah but that's acme not sam.

Oh yeah! Sorry….

> 
> You can do: ,|your_cmd
> 9fans / 9fans / see discussions + participants + delivery options Permalink

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T8df760861ae2c8cd-M7bea4a61bbec9c44457d0721
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Breaking up long lines in sam into more manageable ones

2021-08-25 Thread David Leimbach via 9fans
Try in the tagline 
Edit ,|fold -s -w80
Highlight it and middle click it.




Sent from my iPad

> On Aug 25, 2021, at 8:20 AM, revcomni...@gmail.com wrote:
> 
> 
> I would like to be able to break up long lines in sam in a way similar to the 
> way I break them up in ed. For ed, I rely on the external command !fold -s 
> -w80 %.
> 
> This did not work for me in sam. What would be the best way to achieve this 
> in sam? And is there a format line(s) command I could use? 
> 
> Many thanks. 
> 9fans / 9fans / see discussions + participants + delivery options Permalink

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T8df760861ae2c8cd-M61bada46ff3aab1a9434e6b5
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] fork of a fork of Inferno that runs on Mac OS amd64

2021-07-30 Thread David Leimbach via 9fans
No problem!

It seems acme does work ok, but it uses XQuartz.

It’s been so long since I’ve used inferno I’ve forgotten how to get started!

Dave


> On Jul 30, 2021, at 12:39 PM, Joseph Stewart  wrote:
> 
> Good job friend. Thanks for doing this.
> 
> On Fri, Jul 30, 2021 at 9:26 AM leimy2k via 9fans <9fans@9fans.net> wrote:
>> 
>> https://github.com/Leimy/9ferno-leimy has the crawling phase of a port of 
>> Inferno that will run on modern Mac OS.
>> 
>> So far - no GUI as I wanted to just get it working to start, and I'm sharing 
>> it in case folks want to help out.
>> 
>> And I really mean that... I've done some things that I don't think are 
>> great, like renaming the panic function to avoid a name collision with some 
>> system headers.
>> 
>> I based the work from the OpenBSD amd64 emu port here: 
>> git://git.9front.org/plan9front/9ferno, and my intention is to get the 
>> changes cleaned up, get the GUI working (maybe port over the drawterm stuff 
>> from the 9front drawterm) etc.
>> 
>> If you try to use it now, just know that backspace/delete will exit the emu, 
>> and you'll want ctrl-h to backspace instead.
>> 
>> I did very minimal testing but ndb/dnsquery was working.
>> 
>> - Dave
>> 9fans / 9fans / see discussions + participants + delivery options Permalink

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T1bfae664a68c567a-Mf88f42997a024cb037df2c88
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription