Re: from number to power of two

1999-08-22 Thread John-Mark Gurney
Mark Murray scribbled this message on Aug 22: Does anyone know an inexpensive algorithm (O(1)) to go from an number to the next (lower or higher) power of two. 1 - 1 2,3 - 2 4,5,6,7 - 4 8,9,10,11,12,13,14,15 - 8 etc.

watching defects on scsi disks...

1999-08-22 Thread John-Mark Gurney
I was wondering if someone would like to clean up a bit of shell scripting I wrote to attach a report of the defect list to the daily output... it works great so far and thought I might as well share this w/ the rest of people... once it gets cleaned up, I have no problems w/ committing it to

Re: from number to power of two

1999-08-22 Thread Daniel C. Sobral
John-Mark Gurney wrote: Shift a bit until it becomes greater than (or less than) the number in question. ummm, didn't you read his post?? he wanted a O(1) routine, NOT a O(n) routine... That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32, a

font edit tools

1999-08-22 Thread Alexey M. Zelkin
hi, Which tools can be used to edit syscons fonts ? Any references are welcome! -- Sincerely Yours, | [EMAIL PROTECTED] (primary) Alexey Zelkin | [EMAIL PROTECTED] (home) | ICQ: #6196584, FIDO: 2:460/12.26 To Unsubscribe: send mail to [EMAIL PROTECTED] with

Re: font edit tools

1999-08-22 Thread Sergey Babkin
Alexey M. Zelkin wrote: hi, Which tools can be used to edit syscons fonts ? Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. -SB To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe

Re: Async NFS exports?

1999-08-22 Thread Doug Rabson
On Fri, 20 Aug 1999, Matthew Dillon wrote: : Just to be clear... I am wondering if mounting (on the NFS _server_) a : partition (that is exportable) as async will have any performance : benefits to the NFS clients? : :As a first guess, probably not unless you have a large number of active

Re: select/poll implementation

1999-08-22 Thread Nate Williams
I had always wondered how select/poll worked (actually see the end of the mail to see the broader question), so I pulled up select() and family and started reading and chasing stuff around. I think that I fully understand (much praise to whoever wrote most of that, it was incredibly easy to

Mandatory locking?

1999-08-22 Thread Greg Lehey
I've just found a need for mandatory locking in Vinum, and I'm wondering how to implement it. If I understand things correctly, our fcntl locking doesn't perform mandatory locking, though System V does if you set the file permissions appropriately. Questions: 1. Do we have some form of

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 17:31:44 -0700, Matthew Dillon wrote: Questions: 1. Do we have some form of mandatory locking? If so, what is it? No we don't, unless you count the ad-hoc lockout in the master/slave pty interface :-). 2. Would it make sense to implement System

What does unp stand for?

1999-08-22 Thread Zhihui Zhang
In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? Thanks. -- Zhihui Zhang. Please visit http://www.freebsd.org

Re: mmap mapped segment length

1999-08-22 Thread Wes Peters
Matthew Dillon wrote: :Now I've got to go figure out what *I've* screwed up. I fstat the file before :mapping it and pass S.st_size as the map length. Is there any reason why :mmap would return non-NULL but map less than the requested size? : :Scratching my head, Note that mmap()

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:07:04 -0400, Garrett Wollman wrote: On Mon, 23 Aug 1999 10:06:54 +0930, Greg Lehey [EMAIL PROTECTED] said: Correct. I suppose it's worth discussing what the default should be. Should they get EAGAIN or block? Obviously you'd want a way of specifying which,

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Somehow you need to get a lock. : : You mean have one program make a fcntl call that causes other : programs to return an error or block if they try to open that : file while the first program holds an open descriptor? : :Correct. I suppose it's worth discussing what the default

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:04:38 -0700, Matthew Dillon wrote: Somehow you need to get a lock. You mean have one program make a fcntl call that causes other programs to return an error or block if they try to open that file while the first program holds an open descriptor?

Re: from number to power of two

1999-08-22 Thread Ollivier Robert
According to Brian F. Feldman: -O lets you do explicit inlining, and -O2 enables -finline-functions. You meant -O3 of course. -O3Optimize yet more. This turns on everything -O2 does, along with also turning on -finline-func- tions. -- Ollivier

Re: Mandatory locking?

1999-08-22 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Greg Lehey writes: Why should it be made unavailable ? So that certain multiple accesses can be done atomically. You don't need that. You initialize a index to 0, and whenever the sector with that index is written, you increment it. At any one time you know

Re: anybody love qsort.c?

1999-08-22 Thread Akira Wada
Following my previous post: I wrote .. I believe a reversed dataset would be partitioned into two subpartitions sorted in order at the 1'st pass of the partitionings. Is this incorrect ? Sorry, I'd confirmed BSD qsort's partitioning logic does not guarantee that a reversed dataset would be

Re: from number to power of two

1999-08-22 Thread Mark Murray
Does anyone know an inexpensive algorithm (O(1)) to go from an number to the next (lower or higher) power of two. 1 - 1 2,3 - 2 4,5,6,7 - 4 8,9,10,11,12,13,14,15 - 8 etc. So %1101 should become either %1 or %1000. Shift a

Re: from number to power of two

1999-08-22 Thread John-Mark Gurney
Mark Murray scribbled this message on Aug 22: Does anyone know an inexpensive algorithm (O(1)) to go from an number to the next (lower or higher) power of two. 1 - 1 2,3 - 2 4,5,6,7 - 4 8,9,10,11,12,13,14,15 - 8 etc.

watching defects on scsi disks...

1999-08-22 Thread John-Mark Gurney
I was wondering if someone would like to clean up a bit of shell scripting I wrote to attach a report of the defect list to the daily output... it works great so far and thought I might as well share this w/ the rest of people... once it gets cleaned up, I have no problems w/ committing it to the

Re: from number to power of two

1999-08-22 Thread Nick Hibma
It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually 1-32), a block of if statements is almost as fast as a table look up in 33 elements. Cheers, Nick On Sun, 22 Aug 1999, Mark Murray wrote: Does anyone know an inexpensive algorithm

select/poll implementation

1999-08-22 Thread Jay Nordwick
I had always wondered how select/poll worked (actually see the end of the mail to see the broader question), so I pulled up select() and family and started reading and chasing stuff around. I think that I fully understand (much praise to whoever wrote most of that, it was incredibly easy to read)

Re: from number to power of two

1999-08-22 Thread Daniel C. Sobral
John-Mark Gurney wrote: Shift a bit until it becomes greater than (or less than) the number in question. ummm, didn't you read his post?? he wanted a O(1) routine, NOT a O(n) routine... That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32, a

Re: IDE quirk in 3.2-STABLE kernel ?

1999-08-22 Thread Daniel C. Sobral
Chris wrote: I am glad to hear from Soren that this 'misconfiguration' will be supported in 4.0 As always when a misconfiguration (read 'not to spec') is used enough then it quickly becomes somewhat of a de facto standard. Old message, but still in need for reply. Yeah, like isa shared

Re: from number to power of two

1999-08-22 Thread Peter Dufault
It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually 1-32), a block of if statements is almost as fast as a table look up in 33 elements. I doubt it - use the table for a small fixed size set then use Warner's (n) ? (1 (ffs(n) - 1)) : 0.

Re: from number to power of two

1999-08-22 Thread Kazufumi-MIT-Mitani
Daniel C. Sobral d...@newsguy.com wrote That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32, a table will wield the best results, and might actually be smaller than some of the suggestions given so far. Counting n as bit, it is O(n) :p Unrolling

Re: from number to power of two

1999-08-22 Thread Nick Hibma
Unfortunately the kernel is compiled with -O which does not include inlining (dunno about explicit inlining, but don't think so). Nick On Sun, 22 Aug 1999, Peter Dufault wrote: It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually

Re: from number to power of two

1999-08-22 Thread Tommy Hallgren
--- Kazufumi-MIT-Mitani m...@mit-s.otaru-uc.ac.jp skrev: Daniel C. Sobral d...@newsguy.com wrote That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32, a table will wield the best results, and might actually be smaller than some of the

font edit tools

1999-08-22 Thread Alexey M. Zelkin
hi, Which tools can be used to edit syscons fonts ? Any references are welcome! -- Sincerely Yours, | phan...@crimea.edu (primary) Alexey Zelkin | phan...@scorpion.crimea.ua (home) | ICQ: #6196584, FIDO: 2:460/12.26 To Unsubscribe: send mail to

Re: font edit tools

1999-08-22 Thread Sergey Babkin
Alexey M. Zelkin wrote: hi, Which tools can be used to edit syscons fonts ? Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. -SB To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe

Re: Async NFS exports?

1999-08-22 Thread Doug Rabson
On Fri, 20 Aug 1999, Matthew Dillon wrote: : Just to be clear... I am wondering if mounting (on the NFS _server_) a : partition (that is exportable) as async will have any performance : benefits to the NFS clients? : :As a first guess, probably not unless you have a large number of active

Re: Async NFS exports?

1999-08-22 Thread Matthew Dillon
: buffer cache is able to keep abrest of the write-rate. : : Hmm, interesting. I see another optimization I can do to fix the : buffer cache saturation case in CURRENT on the client. The COMMIT rpc's : aren't being issued async. : :You need to track the return value of the

Parallel Video Interfaces

1999-08-22 Thread The Evil Anti-Rick
Is anyone doing any work to support parallel video interfaces like the Snappy or Gotcha cards? I have Snappy card, and I would like to put it to use as part of an internal video security system. --R. Pelletier, Sys Admin, House Galiagante To Unsubscribe: send mail to majord...@freebsd.org with

Re: I2C/SMBus/LPBB

1999-08-22 Thread Nicolas Souchu
On Sat, Aug 21, 1999 at 02:46:51AM -0400, Mike Nowlin wrote: I had sent this message to -stable about a month ago, never heard anything -- so am trying it here. Hmm lpbb seem to fail completly then... I have to give it a try. Ask me again if I fail to remember. I'm a bit busy. Thanks for

Re: font edit tools

1999-08-22 Thread Ollivier Robert
According to Sergey Babkin: Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. I know do the opposite. I modify the font with XmBDFED in BDF format then generate the syscons font with a small Perl script. A

Re: from number to power of two

1999-08-22 Thread Peter Wemm
Peter Dufault wrote: It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually 1-32), a block of if statements is almost as fast as a table look up in 33 elements. I doubt it - use the table for a small fixed size set then use Warner's

Re: font edit tools

1999-08-22 Thread Dan Nelson
In the last episode (Aug 22), Sergey Babkin said: Alexey M. Zelkin wrote: hi, Which tools can be used to edit syscons fonts ? Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. I like one called

Re: select/poll implementation

1999-08-22 Thread Nate Williams
I had always wondered how select/poll worked (actually see the end of the mail to see the broader question), so I pulled up select() and family and started reading and chasing stuff around. I think that I fully understand (much praise to whoever wrote most of that, it was incredibly easy to

Mandatory locking?

1999-08-22 Thread Greg Lehey
I've just found a need for mandatory locking in Vinum, and I'm wondering how to implement it. If I understand things correctly, our fcntl locking doesn't perform mandatory locking, though System V does if you set the file permissions appropriately. Questions: 1. Do we have some form of

Re: from number to power of two

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Nick Hibma wrote: Unfortunately the kernel is compiled with -O which does not include inlining (dunno about explicit inlining, but don't think so). Nick -O lets you do explicit inlining, and -O2 enables -finline-functions. Anyway, I think the simple solution to the

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Questions: : :1. Do we have some form of mandatory locking? If so, what is it? No we don't, unless you count the ad-hoc lockout in the master/slave pty interface :-). :2. Would it make sense to implement System V's fcntl semantics? :They're rather tacky: you set the setgid bit

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 17:31:44 -0700, Matthew Dillon wrote: Questions: 1. Do we have some form of mandatory locking? If so, what is it? No we don't, unless you count the ad-hoc lockout in the master/slave pty interface :-). 2. Would it make sense to implement System V's

What does unp stand for?

1999-08-22 Thread Zhihui Zhang
In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? Thanks. -- Zhihui Zhang. Please visit http://www.freebsd.org

Re: What does unp stand for?

1999-08-22 Thread Bill Fumerola
On Sun, 22 Aug 1999, Zhihui Zhang wrote: In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? guess W. Richard Stevens wrote a book Unix Network Programming often refered to by UNP, which includes his

Re: mmap mapped segment length

1999-08-22 Thread Wes Peters
Matthew Dillon wrote: :Now I've got to go figure out what *I've* screwed up. I fstat the file before :mapping it and pass S.st_size as the map length. Is there any reason why :mmap would return non-NULL but map less than the requested size? : :Scratching my head, Note that mmap()

Re: What does unp stand for?

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Bill Fumerola wrote: On Sun, 22 Aug 1999, Zhihui Zhang wrote: In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? guess W. Richard Stevens wrote a book Unix Network Programming

Re: from number to power of two

1999-08-22 Thread Bakul Shah
The best I can come up with is this: /* kk+1 k * given n, return 2 such that 2 n = 2 */ inline unsigned long n2power2(unsigned long n) { /* `smear' the highest set bit to the right */ n |= n1; n |= n2; n |= n4; n |= n8; n |= n16;

Re: Mandatory locking?

1999-08-22 Thread Garrett Wollman
On Mon, 23 Aug 1999 10:06:54 +0930, Greg Lehey g...@lemis.com said: Correct. I suppose it's worth discussing what the default should be. Should they get EAGAIN or block? Obviously you'd want a way of specifying which, but there would have to be a default for non-lock-aware programs. I

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:07:04 -0400, Garrett Wollman wrote: On Mon, 23 Aug 1999 10:06:54 +0930, Greg Lehey g...@lemis.com said: Correct. I suppose it's worth discussing what the default should be. Should they get EAGAIN or block? Obviously you'd want a way of specifying which, but

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Somehow you need to get a lock. : : You mean have one program make a fcntl call that causes other : programs to return an error or block if they try to open that : file while the first program holds an open descriptor? : :Correct. I suppose it's worth discussing what the default

Interesting ssh + X + tcp_wrappers problem

1999-08-22 Thread Doug
I've been doing some housecleaning lately and I finally decided to set up a one-way ssh authentication from my workstation to my gateway machine. I set up the ssh keys and that was all good. Then I went to start an X app on the gateway expecting it to just pop up on the workstation's X