Re: Using shell commands versus C equivalents

2007-06-13 Thread Tim Kientzle
I spent a lot of time recently in libarchive/bsdtar optimizing the disk handling; I can share lots of ideas for improving performance of disk-bound operations like this. One thing you might find useful: libarchive has an API for "creating things on disk," which handles a lot of trivia (creatin

Re: Disk block or sector to file mapping?

2007-06-13 Thread Anton Yuzhaninov
Hello Matthew, You wrote on Thursday, June 14, 2007, 7:14:03 AM: MH> I have a drive that failed and fsck and dump both report the failed MH> sector or block (the term seems to be used interchangeably at times), MH> but how can I find out what file(s) were using that block? fsdb findblk disk_b

Re: HP SmartArray ( CISS ) and CAMCONTROL

2007-06-13 Thread Ulf Zimmermann
On Mon, Jun 11, 2007 at 06:55:58PM -0400, Mark Saad wrote: > Wilko > Thats great to hear hpacucli and hpasm would rock. > > Wilko Bulte wrote: > >On Mon, Jun 11, 2007 at 06:35:28PM -0400, Mark Saad wrote.. > >>Matt > >> What will raidutill offer ? Also does anyone know if HP provides >

Re: Disk block or sector to file mapping?

2007-06-13 Thread Jeremy Chadwick
On Wed, Jun 13, 2007 at 11:14:03PM -0400, Matthew Hagerty wrote: > Greetings, > > I have a drive that failed and fsck and dump both report the failed sector > or block (the term seems to be used interchangeably at times), but how can I > find out what file(s) were using that block? I have a

Disk block or sector to file mapping?

2007-06-13 Thread Matthew Hagerty
Greetings, I have a drive that failed and fsck and dump both report the failed sector or block (the term seems to be used interchangeably at times), but how can I find out what file(s) were using that block? I have a file-based backup and I could possibly replace the bad files if I know whic

Re: Using shell commands versus C equivalents

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Stephen Montgomery-Smith wrote: On Wed, 13 Jun 2007, [EMAIL PROTECTED] wrote: PS I'm looking at pkg_install and pkg_version mostly, but I'll be looking into the other package utilities closely in the next couple weeks, evaluating what approaches I should take in solving

Re: Using shell commands versus C equivalents

2007-06-13 Thread Stephen Montgomery-Smith
On Wed, 13 Jun 2007, [EMAIL PROTECTED] wrote: PS I'm looking at pkg_install and pkg_version mostly, but I'll be looking into the other package utilities closely in the next couple weeks, evaluating what approaches I should take in solving some bottlenecks with installing packages and ports.

Re: kern/83807: [sis] [patch] if_sis: Wake On Lan support for FreeBSD

2007-06-13 Thread Stefan Sperling
On Sun, Jun 10, 2007 at 04:45:04PM +0200, Stefan Sperling wrote: > > I usually use either if_em or if_xl chipsets, so I hoped landing this code > > in at least -CURRENT (should go there first, I guess) would result in more > > chipsets supported ;) > > There is code for enabling wake on lan i

Re: building images for running from flash

2007-06-13 Thread Z.C.B.
On Wed, 13 Jun 2007 09:58:50 -0400 Mike Meyer <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Z.C.B. <[EMAIL PROTECTED]> > typed: > > Another annoying issue is the muckery involved > > with /etc/make.conf... The issue I am running into that is the > > CPUTYPE? option is different for the buil

Re: Using shell commands versus C equivalents

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Tim Kientzle wrote: Next step, eliminating the linked list structure in favor or red-black trees, maybe. Due to the way pkg_install works, this most likely is just adding complexity for no gain, it might actually slow it down. Hmmm... the only thing is that it does the l

Re: Using shell commands versus C equivalents

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Rick C. Petty wrote: On Wed, Jun 13, 2007 at 10:23:36AM -0700, [EMAIL PROTECTED] wrote: On Wed, 13 Jun 2007, Joerg Sonnenberger wrote: Should I briefly lock (flock) the file when running open/fstat/fchmod then to avoid issues? This may become a problem as pkg_*/make become

Re: Using shell commands versus C equivalents

2007-06-13 Thread Tim Kientzle
Next step, eliminating the linked list structure in favor or red-black trees, maybe. Due to the way pkg_install works, this most likely is just adding complexity for no gain, it might actually slow it down. Hmmm... the only thing is that it does the linked list traversal a number of times per

Re: Using shell commands versus C equivalents

2007-06-13 Thread Rick C. Petty
On Wed, Jun 13, 2007 at 10:23:36AM -0700, [EMAIL PROTECTED] wrote: > On Wed, 13 Jun 2007, Joerg Sonnenberger wrote: > > Should I briefly lock (flock) the file when running open/fstat/fchmod then > to avoid issues? This may become a problem as pkg_*/make becomes more > parallelized (another stude

Re: building images for running from flash

2007-06-13 Thread Zavam, Vinícius
2007/6/13, Z.C.B. <[EMAIL PROTECTED]>: Just been looking at rebuilding my router. I understand building the image and etc, but the issue I am running into is what to do about ports. To solve this, I am looking at building the image and using mdconfig, unionfs, and jail to solve building ports. Al

Re: Using shell commands versus C equivalents

2007-06-13 Thread Joerg Sonnenberger
On Wed, Jun 13, 2007 at 10:23:36AM -0700, [EMAIL PROTECTED] wrote: > Should I briefly lock (flock) the file when running open/fstat/fchmod then > to avoid issues? This may become a problem as pkg_*/make becomes more > parallelized (another student's goals for his SoC project). Looking does not c

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Ed Schouten wrote: * Garrett Cooper <[EMAIL PROTECTED]> wrote: Garrett Cooper wrote: Title says it all -- is there a particular reason why malloc/bzero should be used instead of calloc? -Garrett As someone just brought to my attention, I should do some Googling. In

Re: Using shell commands versus C equivalents

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Joerg Sonnenberger wrote: On Wed, Jun 13, 2007 at 11:15:52AM -0500, Rick C. Petty wrote: Another improvement made by using stat(2)/chmod(2) over chmod(1) using system(3) variants is the protection against malicious filenames. The original code should have used fork/execv i

Re: Using shell commands versus C equivalents

2007-06-13 Thread youshi10
On Wed, 13 Jun 2007, Joerg Sonnenberger wrote: On Wed, Jun 13, 2007 at 08:26:38AM -0700, Garrett Cooper wrote: Sorry -- actually I meant that (along similar lines), there was a program with the following lines: vsystem("/bin/chmod +x %s", filename); and I replaced it with: chmod(filename,

Re: Using shell commands versus C equivalents

2007-06-13 Thread Joerg Sonnenberger
On Wed, Jun 13, 2007 at 11:15:52AM -0500, Rick C. Petty wrote: > Another improvement made by using stat(2)/chmod(2) over chmod(1) using > system(3) variants is the protection against malicious filenames. The > original code should have used fork/execv instead anyway. To be precise, this case shou

Re: Using shell commands versus C equivalents

2007-06-13 Thread Rick C. Petty
On Wed, Jun 13, 2007 at 08:26:38AM -0700, Garrett Cooper wrote: > > vsystem("/bin/chmod +x %s", filename); > > and I replaced it with: > > chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXOTH )); Another improvement made by using stat(2)/chmod(2) over chmod(1) using system(3) variants is the

Re: Using shell commands versus C equivalents

2007-06-13 Thread Gregory Shapiro
> Sorry -- actually I meant that (along similar lines), there was a program > with the following lines: > > vsystem("/bin/chmod +x %s", filename); > > and I replaced it with: > > chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXOTH )); Those two lines have different effects. The first

Re: Using shell commands versus C equivalents

2007-06-13 Thread Joerg Sonnenberger
On Wed, Jun 13, 2007 at 08:26:38AM -0700, Garrett Cooper wrote: > Sorry -- actually I meant that (along similar lines), there was a > program with the following lines: > > vsystem("/bin/chmod +x %s", filename); > > and I replaced it with: > > chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXO

Re: Using shell commands versus C equivalents

2007-06-13 Thread Garrett Cooper
Danny Braniss wrote: --Rgf3q3z9SdmXC6oT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 12, 2007 at 10:55:18PM -0700, Garrett Cooper wrote: Another simple question (I hope): Is there any reason why shell comm

Re: building images for running from flash

2007-06-13 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Z.C.B. <[EMAIL PROTECTED]> typed: > Another annoying issue is the muckery involved with /etc/make.conf... > The issue I am running into that is the CPUTYPE? option is different > for the build machine and router that the flash will be used on. Any > nice way to deal with thi

Re: Using shell commands versus C equivalents

2007-06-13 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Garrett Cooper <[EMAIL PROTECTED]> typed: > Alexander Leidinger wrote: > > Quoting Garrett Cooper <[EMAIL PROTECTED]> (from Tue, 12 Jun > > 2007 22:55:18 -0700): > > > >> Another simple question (I hope): > >>Is there any reason why shell commands should be used in plac

Re: building images for running from flash

2007-06-13 Thread Z.C.B.
On Wed, 13 Jun 2007 21:42:12 +0800 Eugene Grosbein <[EMAIL PROTECTED]> wrote: > On Wed, Jun 13, 2007 at 09:07:45AM -0400, Z.C.B. wrote: > > > > nanobsd(8) > > > > I am aware of it, but it does not cover what I need for either > > questions, except for possibly the make part. > > It does. Hmmm.

Re: Using shell commands versus C equivalents

2007-06-13 Thread Danny Braniss
> > --Rgf3q3z9SdmXC6oT > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Tue, Jun 12, 2007 at 10:55:18PM -0700, Garrett Cooper wrote: > > Another simple question (I hope): > >Is there any reason why shell commands s

Re: building images for running from flash

2007-06-13 Thread Eugene Grosbein
On Wed, Jun 13, 2007 at 09:07:45AM -0400, Z.C.B. wrote: > > nanobsd(8) > > I am aware of it, but it does not cover what I need for either > questions, except for possibly the make part. It does. Eugene ___ freebsd-hackers@freebsd.org mailing list http

Re: building images for running from flash

2007-06-13 Thread Z.C.B.
On Wed, 13 Jun 2007 15:11:15 +0800 Eugene Grosbein <[EMAIL PROTECTED]> wrote: > On Wed, Jun 13, 2007 at 02:06:42AM -0400, Z.C.B. wrote: > > > Just been looking at rebuilding my router. I understand building > > the image and etc, but the issue I am running into is what to do > > about ports. To s

Re: Using shell commands versus C equivalents

2007-06-13 Thread David Wolfskill
On Tue, Jun 12, 2007 at 10:55:18PM -0700, Garrett Cooper wrote: > Another simple question (I hope): >Is there any reason why shell commands should be used in place of a > C command (in this case chmod via vsystem instead of the chmod(2) > function)? It seems like the fork / exec would be more

Re: building images for running from flash

2007-06-13 Thread Eugene Grosbein
On Wed, Jun 13, 2007 at 02:06:42AM -0400, Z.C.B. wrote: > Just been looking at rebuilding my router. I understand building the > image and etc, but the issue I am running into is what to do about > ports. To solve this, I am looking at building the image and using > mdconfig, unionfs, and jail to

Re: Using shell commands versus C equivalents

2007-06-13 Thread Alexander Leidinger
Quoting Garrett Cooper <[EMAIL PROTECTED]> (from Tue, 12 Jun 2007 22:55:18 -0700): Another simple question (I hope): Is there any reason why shell commands should be used in place of a C command (in this case chmod via vsystem instead of the chmod(2) function)? It seems like the fork / exec

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread Ed Schouten
* Garrett Cooper <[EMAIL PROTECTED]> wrote: > Garrett Cooper wrote: > >Title says it all -- is there a particular reason why malloc/bzero > > should be used instead of calloc? > > -Garrett > As someone just brought to my attention, I should do some Googling. > > Initial results brought up

Re: Reason for doing malloc / bzero over calloc (performance)?

2007-06-13 Thread Garrett Cooper
Garrett Cooper wrote: Title says it all -- is there a particular reason why malloc/bzero should be used instead of calloc? -Garrett As someone just brought to my attention, I should do some Googling. Initial results brought up this: