Re: c question: *printf'ing arrays

2009-07-04 Thread Giorgos Keramidas
On Wed, 01 Jul 2009 00:06:05 +0200 (CEST), Alexander Best alexbes...@math.uni-muenster.de wrote: thanks for all the help. i decided to take the pill and coded all the fprintfs by hand. here's the result. usually i'd stick to a higher level languag, but i need C's inline assembly support:

Re: c question: *printf'ing arrays

2009-07-04 Thread Igor Mozolevsky
2009/7/4 Giorgos Keramidas keram...@ceid.upatras.gr: [snip] s/0x%/%#.2hh/g -- Igor ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to

Re: c question: *printf'ing arrays

2009-07-02 Thread Dag-Erling Smørgrav
Alexander Best alexbes...@math.uni-muenster.de writes: for (i=0; i sizeof(hdr-nintendo_logo); i++) fprintf(stderr, %x, hdr-nintendo_logo[i]); What will this print if nintendo_logo is { 0x01, 0x02, 0x03, 0x04 }? DES -- Dag-Erling Smørgrav - d...@des.no

Re: c question: *printf'ing arrays

2009-07-02 Thread Carlos A. M. dos Santos
2009/7/2 Dag-Erling Smørgrav d...@des.no: Alexander Best alexbes...@math.uni-muenster.de writes:     for (i=0; i sizeof(hdr-nintendo_logo); i++)         fprintf(stderr, %x, hdr-nintendo_logo[i]); What will this print if nintendo_logo is { 0x01, 0x02, 0x03, 0x04 }? Good catch. It will print

Re: c question: *printf'ing arrays

2009-07-01 Thread Carlos A. M. dos Santos
On Tue, Jun 30, 2009 at 7:54 PM, Alfred Perlsteinalf...@freebsd.org wrote: Hey Alex, People frown on macros, but this could be a good one: #define SPRINT(f, fmt) \        do {\                for (_i = 0; _i sizeof(f)/sizeof(f[0]); i++) \                        printf(fmt, f[i]); \      

Re: c question: *printf'ing arrays

2009-07-01 Thread Carlos A. M. dos Santos
On Tue, Jun 30, 2009 at 7:06 PM, Alexander Bestalexbes...@math.uni-muenster.de wrote: thanks for all the help. i decided to take the pill and coded all the fprintfs by hand. here's the result. usually i'd stick to a higher level languag, but i need C's inline assembly support:    struct

Re: c question: *printf'ing arrays

2009-06-30 Thread Tom Evans
On Tue, 2009-06-30 at 18:12 +0200, Alexander Best wrote: hi there, i need to output the header of a file to stdout. the header looks like this: struct Header { u_int8_t rom_entry[4]; u_int8_t nintendo_logo[156]; u_char game_title[12]; u_char

Re: c question: *printf'ing arrays

2009-06-30 Thread Alexander Best
thanks. but that simply dumps the contents of the struct to stdout. but since most of the struct's contents aren't ascii the output isn't really of much use. cheers. Tom Evans schrieb am 2009-06-30: On Tue, 2009-06-30 at 18:12 +0200, Alexander Best wrote: hi there, i need to output the

Re: c question: *printf'ing arrays

2009-06-30 Thread Alexander Best
that works, but i really want to have a pretty output to stdout. i guess i have to stick with printf and use `for (i=0; i sizeof(XXX); i++)` for each array in the struct. just thought i could avoid it. btw. `./my-program | hexdump` works, but if i do `./my-program output` output is being

Re: c question: *printf'ing arrays

2009-06-30 Thread Igor Mozolevsky
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de: that works, but i really want to have a pretty output to stdout. i guess i have to stick with printf and use `for (i=0; i sizeof(XXX); i++)` for each array in the struct. just thought i could avoid it. btw. `./my-program | hexdump`

Re: c question: *printf'ing arrays

2009-06-30 Thread Alexander Best
should be stdout. struct Header *hdr = rom; int new_fd = open(/dev/stdout, O_RDWR); printf(SIZE: %d\n,sizeof(*hdr)); write(new_fd, hdr, sizeof(*hdr)); close(new_fd); Igor Mozolevsky schrieb am 2009-06-30: 2009/6/30 Alexander Best alexbes...@math.uni-muenster.de: that works, but i really

Re: c question: *printf'ing arrays

2009-06-30 Thread Rick C. Petty
On Tue, Jun 30, 2009 at 08:03:21PM +0200, Alexander Best wrote: should be stdout. struct Header *hdr = rom; int new_fd = open(/dev/stdout, O_RDWR); printf(SIZE: %d\n,sizeof(*hdr)); write(new_fd, hdr, sizeof(*hdr)); close(new_fd); Why are you reopening stdout? It should already be

Re: c question: *printf'ing arrays

2009-06-30 Thread Igor Mozolevsky
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de: thanks. but that simply dumps the contents of the struct to stdout. but since most of the struct's contents aren't ascii the output isn't really of much use. How about ./your-program | hexdump ? -- Igor

Re: c question: *printf'ing arrays

2009-06-30 Thread Igor Mozolevsky
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de: should be stdout. struct Header *hdr = rom; int new_fd = open(/dev/stdout, O_RDWR); printf(SIZE: %d\n,sizeof(*hdr)); write(new_fd, hdr, sizeof(*hdr)); close(new_fd); You should really be checking what open returns, opening

Re: c question: *printf'ing arrays

2009-06-30 Thread Alexander Best
thanks. now the output gets redirected using . i'm quite new to programming under unix. sorry for the inconvenience. so i guess there is no really easy way to output an inhomogeneous struct to stdout without using a loop to output each array contained in the struct. cheers. Rick C. Petty

Re: c question: *printf'ing arrays

2009-06-30 Thread Rick C. Petty
On Tue, Jun 30, 2009 at 08:21:03PM +0200, Alexander Best wrote: thanks. now the output gets redirected using . i'm quite new to programming under unix. sorry for the inconvenience. No problem; we all had to learn sometime. But what I suggested should work for every platform that adheres to

Re: c question: *printf'ing arrays

2009-06-30 Thread Alfred Perlstein
Hey Alex, People frown on macros, but this could be a good one: #define SPRINT(f, fmt) \ do {\ for (_i = 0; _i sizeof(f)/sizeof(f[0]); i++) \ printf(fmt, f[i]); \ }while(0) :D This should allow you to point to any _array_ and print each

Re: c question: *printf'ing arrays

2009-06-30 Thread Alexander Best
wow. thanks. that's looking really nice. i'll change my sources tomorrow after a good dose of sleep. ;) alex Alfred Perlstein schrieb am 2009-07-01: Hey Alex, People frown on macros, but this could be a good one: #define SPRINT(f, fmt) \ do {\ for (_i = 0; _i

Re: TUNABLE_INT question

2009-02-18 Thread Roman Divacky
On Tue, Feb 17, 2009 at 05:51:13PM -0500, John Baldwin wrote: On Tuesday 17 February 2009 5:21:42 pm Roman Divacky wrote: On Tue, Feb 17, 2009 at 09:31:12AM -0500, John Baldwin wrote: On Friday 13 February 2009 5:16:07 pm Roman Divacky wrote: On Fri, Feb 13, 2009 at 03:55:44PM -0500,

Re: TUNABLE_INT question

2009-02-17 Thread John Baldwin
On Friday 13 February 2009 5:16:07 pm Roman Divacky wrote: On Fri, Feb 13, 2009 at 03:55:44PM -0500, Ryan Stone wrote: __FILE__ is a string so you can't concat that with anything to produce an identifier. In any case, the variable is static so there can't be any collision problems with

Re: TUNABLE_INT question

2009-02-17 Thread John Baldwin
On Tuesday 17 February 2009 5:21:42 pm Roman Divacky wrote: On Tue, Feb 17, 2009 at 09:31:12AM -0500, John Baldwin wrote: On Friday 13 February 2009 5:16:07 pm Roman Divacky wrote: On Fri, Feb 13, 2009 at 03:55:44PM -0500, Ryan Stone wrote: __FILE__ is a string so you can't concat that

Re: TUNABLE_INT question

2009-02-13 Thread Ryan Stone
__FILE__ is a string so you can't concat that with anything to produce an identifier. In any case, the variable is static so there can't be any collision problems with other files. Ryan Stone ___ freebsd-hackers@freebsd.org mailing list

Re: TUNABLE_INT question

2009-02-13 Thread Roman Divacky
On Fri, Feb 13, 2009 at 03:55:44PM -0500, Ryan Stone wrote: __FILE__ is a string so you can't concat that with anything to produce an identifier. In any case, the variable is static so there can't be any collision problems with other files. I was talking about the SYSINIT parameter. thats a

Re: experimantal question about md's

2008-09-29 Thread Michael Schuh
Hi, thank you for your answer. Clearly the Writeprocess of writeing data to an mirror is totally ended, as all mirrordevices are written. But for the read the kernel uses the faster device..and there it could be an advantage.i m thinking. And yes i think it could be an advantage, if the

Re: experimantal question about md's

2008-09-29 Thread Oliver Fromme
Michael Schuh wrote: Clearly the Writeprocess of writeing data to an mirror is totally ended, as all mirrordevices are written. But for the read the kernel uses the faster device..and there it could be an advantage.i m thinking. And yes i think it could be an advantage, if the

Re: experimantal question about md's

2008-09-29 Thread RW
On Mon, 29 Sep 2008 10:36:46 +0200 Michael Schuh [EMAIL PROTECTED] wrote: so we have a webserver (par example) at this mirror it has very good speed for the file-access (ok i know in allmost cases is not the disk the bottleneck, and if we could doing caching...) at the above examle it is not

Re: experimantal question about md's

2008-09-29 Thread Michael Schuh
Hello @all, hello Oliver, thnak you for your reply. No i do not try to solve a real problem. It was hypothetically, an idea, not more not less. I have this written in my first posting. And for me, it is a logical dependency that the ram get paged to the swap if there is not enough RAM for all

Re: experimantal question about md's

2008-09-28 Thread RW
On Fri, 26 Sep 2008 20:15:43 +0200 Michael Schuh [EMAIL PROTECTED] wrote: Let us say i have a Machine with 8 CPUs and a lot of RAM. An i need a very high perfomance Storage for holding data. My idea was to setup a raid1(0) with virtual disk images. Created with mdconfig. My idea was to

Re: experimantal question about md's

2008-09-28 Thread Zaphod Beeblebrox
On Fri, Sep 26, 2008 at 2:15 PM, Michael Schuh [EMAIL PROTECTED]wrote: Hallo @list, Let us say i have a Machine with 8 CPUs and a lot of RAM. An i need a very high perfomance Storage for holding data. My idea was to setup a raid1(0) with virtual disk images. Created with mdconfig. My

Re: licensing question APSL

2008-02-15 Thread Dag-Erling Smørgrav
Brooks Davis [EMAIL PROTECTED] writes: APSL is not generally accepted in the base. It may be acceptable in certain circumstances, but strong technical justification is generally required for inclusion. Which brings us to my reaction to the PR, which is why do we even need this? Stick it in

Re: licensing question APSL

2008-02-15 Thread Dag-Erling Smørgrav
Robert Watson [EMAIL PROTECTED] writes: I think it's a significant testament to the quality of the Solaris parts we've been pulling in (ZFS, DTrace) that CDDL parts are now in the base tree. They are carefully marked and isolated to make it easy to build CDDL-free systems in the same way that

Re: licensing question APSL

2008-02-14 Thread Brooks Davis
On Thu, Feb 14, 2008 at 07:39:27AM +0100, Volker wrote: While working through the PR backlog, I found two PRs filed containing source code for two tools (decomment, relpath) under the Apple Public Source License (APSL). I think these tools aren't that bad but before pinging any committer

Re: licensing question APSL

2008-02-14 Thread Volker
On 02/14/08 16:02, Brooks Davis wrote: On Thu, Feb 14, 2008 at 07:39:27AM +0100, Volker wrote: PRs in question: bin/67307 bin/67308 The quotes on the followup are essentially correct except that explicit approval is required by core to add new Non-BSD-Licensed code and that there would need

Re: licensing question APSL

2008-02-14 Thread Brooks Davis
On Thu, Feb 14, 2008 at 08:01:55PM +0100, Volker wrote: On 02/14/08 16:02, Brooks Davis wrote: On Thu, Feb 14, 2008 at 07:39:27AM +0100, Volker wrote: PRs in question: bin/67307 bin/67308 The quotes on the followup are essentially correct except that explicit approval is required by

Re: licensing question APSL

2008-02-14 Thread Volker
On 02/14/08 20:17, Brooks Davis wrote: APSL is not generally accepted in the base. It may be acceptable in certain circumstances, but strong technical justification is generally required for inclusion. Brooks, so better put that into the ports tree? Thanks Volker

Re: licensing question APSL

2008-02-14 Thread Brooks Davis
On Thu, Feb 14, 2008 at 08:47:02PM +0100, Volker wrote: On 02/14/08 20:17, Brooks Davis wrote: APSL is not generally accepted in the base. It may be acceptable in certain circumstances, but strong technical justification is generally required for inclusion. Brooks, so better put that

Re: licensing question APSL

2008-02-14 Thread Robert Watson
On Thu, 14 Feb 2008, Volker wrote: On 02/14/08 16:02, Brooks Davis wrote: On Thu, Feb 14, 2008 at 07:39:27AM +0100, Volker wrote: PRs in question: bin/67307 bin/67308 The quotes on the followup are essentially correct except that explicit approval is required by core to add new

Re: licensing question APSL

2008-02-14 Thread Wilko Bulte
Quoting Volker, who wrote on Thu, Feb 14, 2008 at 08:01:55PM +0100 .. On 02/14/08 16:02, Brooks Davis wrote: On Thu, Feb 14, 2008 at 07:39:27AM +0100, Volker wrote: PRs in question: bin/67307 bin/67308 The quotes on the followup are essentially correct except that explicit approval is

Re: cvs question

2008-01-21 Thread Doug Barton
Aryeh M. Friedman wrote: I maintain a local repo of the via the cvs mode of cvsup. When I do a: What command did you use to check out the files, and what tree are you talking about? cvs -q -d /home/ncvs update It will update any modified files but will not add any new files When you

Re: cvs question

2008-01-21 Thread Aryeh M. Friedman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug Barton wrote: Aryeh M. Friedman wrote: I maintain a local repo of the via the cvs mode of cvsup. When I do a: What command did you use to check out the files, and what tree are you talking about? cvsup -h cvsup9.us.freebsd.org

RE: cvs question

2008-01-21 Thread Greg Larkin
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aryeh M. Friedman I maintain a local repo of the via the cvs mode of cvsup. When I do a: cvs -q -d /home/ncvs update It will update any modified files but will not add any new files (it

RE: cvs question

2008-01-21 Thread Robert Watson
On Mon, 21 Jan 2008, Greg Larkin wrote: cvs -q -d /home/ncvs update -d The -d option given to the update subcommand builds directories the way cvs checkout does. Without it, update will only operate on directories that are already in your sandbox. In principle you only need to specify

Re: netgraph question

2008-01-13 Thread Lawrence Stewart
Subhash Gopinath wrote: Thanks, looks interesting. But I was looking at processing the packets in userspace. Sorry I didn't mention it clearly. Ah ok. I didn't get that from your initial email. Have you looked at the firewall (ipfw and/or pf) code at all? I believe you can use mechanisms

Re: netgraph question

2008-01-12 Thread Subhash Gopinath
Thanks, looks interesting. But I was looking at processing the packets in userspace. Sorry I didn't mention it clearly. Thanks, -Subhash On Jan 11, 2008 10:32 PM, Lawrence Stewart [EMAIL PROTECTED] wrote: Hi Subhash, Subhash Gopinath wrote: Hello folks, I am looking at writing an

Re: netgraph question

2008-01-11 Thread Lawrence Stewart
Hi Subhash, Subhash Gopinath wrote: Hello folks, I am looking at writing an application program to tap certain ipv6 packets (say icmpv6) using netgraph. The application has to do some processing, before kernel can proceed with those packets. I have vaguely understood netgraph, and I see that

Re: kern.ngroups question

2007-07-19 Thread Ruben de Groot
On Thu, Jul 19, 2007 at 12:19:53PM +1000, Michael Vince typed: I just had to deal with this limitation and it was quite annoying to say the least, it appears Samba is somewhat deliberately designed to give you a hard time when you run into this limit, because as soon as you add a user to

Re: kern.ngroups question

2007-07-19 Thread Reuben A. Popp
On Wednesday 18 July 2007 21:19, Michael Vince wrote: Julian Elischer wrote: Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? NFS only supports this much by default (from memory). Samba (in the guise of

Re: kern.ngroups question

2007-07-19 Thread Hartmut Brandt
Reuben A. Popp wrote: On Wednesday 18 July 2007 21:19, Michael Vince wrote: Julian Elischer wrote: Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? NFS only supports this much by default (from memory). Samba (in the

Re: kern.ngroups question

2007-07-18 Thread Michael Vince
Julian Elischer wrote: Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? NFS only supports this much by default (from memory). Samba (in the guise of Jeremy Allison) has asked us to follow Linux's lead and support an

Re: libelf question

2007-06-25 Thread Dag-Erling Smørgrav
Angus Barrow [EMAIL PROTECTED] writes: 30 time_t timet=arh-ar_date; (gdb) n 31 strftime(timestring, sizeof(timestring), %b %e %H:%M %Y, gmtime(timet)); (gdb) n ... (gdb) print timet $1 = -1515870811 (gdb) p/x -1515870811 $1 = 0xa5a5a5a5 from malloc(3): J Each byte of new

Re: libelf question

2007-06-24 Thread Tim Kientzle
Angus Barrow wrote: I'm trying to develop a BSD licensed version of the ar utility using the new libelf library ... The time shown in arh-ar_date (this is the struct that the libelf library provides for each entry in the ar archive) seems to have a negative value (using the GNU ar the

Re: kern.ngroups question

2007-06-06 Thread Hartmut Brandt
Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? I came across this issue originally when working on our Samba implementation (samba-3 out of ports, running on 6-STABLE). We have some users that belong to a number of

Re: kern.ngroups question

2007-06-05 Thread Andre Albsmeier
On Tue, 05-Jun-2007 at 11:49:44 -0500, Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? I came across this issue originally when working on our Samba implementation (samba-3 out of ports, running on 6-STABLE). We

Re: kern.ngroups question

2007-06-05 Thread Julian Elischer
Reuben A. Popp wrote: Hello all, Can someone explain to me the rationale behind having ngroups_max set to 16 by default? NFS only supports this much by default (from memory). Samba (in the guise of Jeremy Allison) has asked us to follow Linux's lead and support an arbitrary number of

Re: a question regarding sys/shm.h

2007-02-16 Thread Robert Watson
On Thu, 15 Feb 2007, Pascal Hofstee wrote: On Thu, 2007-02-15 at 13:41 +, Robert Watson wrote: Unfortunately, things are a bit more tricky. The problem is not so much the API, where converting size_t/int is a relative non-event, rather, the ABI. By changing the size of a field in a data

Re: a question regarding sys/shm.h

2007-02-15 Thread Pascal Hofstee
On 1/31/07, Robert Watson [EMAIL PROTECTED] wrote: If we do decide to go ahead with the ABI change, there are a number of other things that should be done simultaneously, such as changing the uid and gid fields to uid_t and gid_t. I would very much like to see the ABI change happen, and the

Re: a question regarding sys/shm.h

2007-02-15 Thread Robert Watson
On Thu, 15 Feb 2007, Pascal Hofstee wrote: On 1/31/07, Robert Watson [EMAIL PROTECTED] wrote: If we do decide to go ahead with the ABI change, there are a number of other things that should be done simultaneously, such as changing the uid and gid fields to uid_t and gid_t. I would very much

Re: a question regarding sys/shm.h

2007-02-15 Thread Pascal Hofstee
On Thu, 2007-02-15 at 13:41 +, Robert Watson wrote: Unfortunately, things are a bit more tricky. The problem is not so much the API, where converting size_t/int is a relative non-event, rather, the ABI. By changing the size of a field in a data structure, you may change the layout

Re: a question regarding sys/shm.h

2007-02-01 Thread M. Warner Losh
In message: [EMAIL PROTECTED] Fabian Keil [EMAIL PROTECTED] writes: : Robert Watson [EMAIL PROTECTED] wrote: : : On Wed, 31 Jan 2007, Dag-Erling Smørgrav wrote: : : Pascal Hofstee [EMAIL PROTECTED] writes: : Any additional sugestions/objections are always greatly appreciated. :

Re: a question regarding sys/shm.h

2007-02-01 Thread Fabian Keil
M. Warner Losh [EMAIL PROTECTED] wrote: In message: [EMAIL PROTECTED] Fabian Keil [EMAIL PROTECTED] writes: : Robert Watson [EMAIL PROTECTED] wrote: : If we do decide to go ahead with the ABI change, there are a number of other : things that should be done simultaneously,

Re: a question regarding sys/shm.h

2007-01-31 Thread Peter Jeremy
On Wed, 2007-Jan-31 08:30:27 +0100, Pascal Hofstee wrote: In a recent attempt in trying to clean up some compiler warnings in a GNUstep related project i came upon a case where the FreeBSD datatypes seemed to disagree with the Linux ones. Though this in itself is not unusual i do wonder if in

Re: a question regarding sys/shm.h

2007-01-31 Thread Pascal Hofstee
Peter Jeremy wrote: Whilst I agree that the Linux defn is the more sensible one, System V IPC and common sense are not commonly found together. Tradionally the definition was int. It appears that the definition changed from int to size_t in issue 5 of the Open Group base definition but FreeBSD

Re: a question regarding sys/shm.h

2007-01-31 Thread Dag-Erling Smørgrav
Pascal Hofstee [EMAIL PROTECTED] writes: Any additional sugestions/objections are always greatly appreciated. On 32-bit platforms (i386, powerpc), int is a 32-bit signed integer while size_t is a 32-bit unsigned integer. On 64-bit platforms (amd64, sparc64 etc), int is a 32-bit signed integer

Re: a question regarding sys/shm.h

2007-01-31 Thread Robert Watson
On Wed, 31 Jan 2007, Dag-Erling Smørgrav wrote: Pascal Hofstee [EMAIL PROTECTED] writes: Any additional sugestions/objections are always greatly appreciated. On 32-bit platforms (i386, powerpc), int is a 32-bit signed integer while size_t is a 32-bit unsigned integer. On 64-bit platforms

Re: a question regarding sys/shm.h

2007-01-31 Thread Fabian Keil
Robert Watson [EMAIL PROTECTED] wrote: On Wed, 31 Jan 2007, Dag-Erling Smørgrav wrote: Pascal Hofstee [EMAIL PROTECTED] writes: Any additional sugestions/objections are always greatly appreciated. On 32-bit platforms (i386, powerpc), int is a 32-bit signed integer while size_t is a

Re: a question regarding sys/shm.h

2007-01-31 Thread Peter Jeremy
On Wed, 2007-Jan-31 10:52:02 +, Robert Watson wrote: If we do decide to go ahead with the ABI change, there are a number of other things that should be done simultaneously, such as changing the uid and gid fields to uid_t and gid_t. And mode to mode_t. The uid and gid fields in struct

Re: vn_fullpath question.

2006-11-28 Thread Robert Watson
On Mon, 27 Nov 2006, Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path at least for text. I have found vn_fullpath function usefull in this case. I am newbe in C, so it could be stupid question, but could someone explaine what

Re: vn_fullpath question.

2006-11-28 Thread Oliver Fromme
Robert Watson wrote: Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path at least for text. I have found vn_fullpath function usefull in this case. I am newbe in C, so it could be stupid question, but could someone

Re: vn_fullpath question.

2006-11-28 Thread Nikolay Pavlov
On Tuesday, 28 November 2006 at 16:46:20 +0100, Oliver Fromme wrote: Robert Watson wrote: Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path at least for text. I have found vn_fullpath function usefull in this

Re: vn_fullpath question.

2006-11-28 Thread Matthew Dillon
:Nikolay, you might want to have a look at the source code :of the lsof utility (ports/sysutils/lsof). It is able :to display path names for file descriptors. Maybe you can :borrow an idea from it. : :It might also be worth mentioning that our friends from the :DragonFly BSD project (derived

Re: vn_fullpath question.

2006-11-27 Thread Ruslan Ermilov
On Mon, Nov 27, 2006 at 02:07:40PM +0200, Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path at least for text. I have found vn_fullpath function usefull in this case. I am newbe in C, so it could be stupid question, but could

Re: vn_fullpath question.

2006-11-27 Thread Nikolay Pavlov
On Monday, 27 November 2006 at 18:20:03 +0300, Ruslan Ermilov wrote: On Mon, Nov 27, 2006 at 02:07:40PM +0200, Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path at least for text. I have found vn_fullpath function usefull in

Re: vn_fullpath question.

2006-11-27 Thread Ruslan Ermilov
On Mon, Nov 27, 2006 at 05:37:12PM +0200, Nikolay Pavlov wrote: On Monday, 27 November 2006 at 18:20:03 +0300, Ruslan Ermilov wrote: On Mon, Nov 27, 2006 at 02:07:40PM +0200, Nikolay Pavlov wrote: Hi. I am trying to extend fstat utility, so that it can use name cache to recreate full path

Re: vn_fullpath question.

2006-11-27 Thread Ivan Voras
Nikolay Pavlov wrote: Yes i know about this man, but still not sure how to get *td structure. In kernel? There's a global variable curthread AFAIK. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers

Re: vn_fullpath question.

2006-11-27 Thread Nikolay Pavlov
On Monday, 27 November 2006 at 17:12:44 +0100, Ivan Voras wrote: Nikolay Pavlov wrote: Yes i know about this man, but still not sure how to get *td structure. In kernel? There's a global variable curthread AFAIK. I am not sure. If i understand the fstat code right, it uses kvm interface

Re: VM question related to faults

2006-07-31 Thread Intron
Divacky Roman wrote: On Sun, Jul 30, 2006 at 12:57:32PM +0200, Divacky Roman wrote: hi, while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1 + mem2 etc. where the mem1/mem2 access can trigger fault. (memory not mapped or

Re: VM question related to faults

2006-07-31 Thread mykola . stryebkov
On 31.07.2006 14:12:20, Intron wrote: Mutex(9) is sometimes too heavy, and has many limitations, while sx(9) is somewhat enough. First paragraph from sx(9) manual says: Shared/exclusive locks are used to protect data that are read far more often than they are written. Mutexes

Re: VM question related to faults

2006-07-31 Thread Intron
[EMAIL PROTECTED] wrote: On 31.07.2006 14:12:20, Intron wrote: Mutex(9) is sometimes too heavy, and has many limitations, while sx(9) is somewhat enough. First paragraph from sx(9) manual says: Shared/exclusive locks are used to protect data that are read far more often

Re: VM question related to faults

2006-07-31 Thread Attilio Rao
2006/7/30, Divacky Roman [EMAIL PROTECTED]: On Sun, Jul 30, 2006 at 12:57:32PM +0200, Divacky Roman wrote: hi, while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1 + mem2 etc. where the mem1/mem2 access can trigger fault.

Re: VM question related to faults

2006-07-31 Thread John Baldwin
On Monday 31 July 2006 14:15, Attilio Rao wrote: 2006/7/30, Divacky Roman [EMAIL PROTECTED]: On Sun, Jul 30, 2006 at 12:57:32PM +0200, Divacky Roman wrote: hi, while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1

Re: VM question related to faults

2006-07-30 Thread Peter Jeremy
On Sun, 2006-Jul-30 12:57:32 +0200, Divacky Roman wrote: while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1 + mem2 etc. where the mem1/mem2 access can trigger fault. (memory not mapped or something) This is normally only an

Re: VM question related to faults

2006-07-30 Thread Intron
Divacky Roman wrote: hi, while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1 + mem2 etc. where the mem1/mem2 access can trigger fault. (memory not mapped or something) currently I solve this by using pcb_onfault. this must

Re: VM question related to faults

2006-07-30 Thread Divacky Roman
On Sun, Jul 30, 2006 at 12:57:32PM +0200, Divacky Roman wrote: hi, while working on SoC linuxolator project I am in a need of this: I need to do some operation on memory like mem1 = mem1 + mem2 etc. where the mem1/mem2 access can trigger fault. (memory not mapped or something) to make it

Re: VM question related to faults

2006-07-30 Thread Kip Macy
From kern_umtx.c: static int _do_lock(struct thread *td, struct umtx *umtx, long id, int timo) { struct umtx_q *uq; intptr_t owner; intptr_t old; int error = 0; uq = td-td_umtxq; /* * Care must be exercised when dealing with umtx structure. It

RE: puc question

2006-07-27 Thread Helge.Oldach
20060428: The puc(4) driver has been overhauled. The ebus(4) and sbus(4) attachments have been removed. Make sure to configure scc(4) on sparc64. Note also that by default puc(4) will use uart(4) and not sio(4) for serial ports because interrupt handling has been

Re: A question about ipcperm() call?

2006-07-27 Thread John Baldwin
On Sunday 23 July 2006 22:07, 李尚杰 wrote: The code for ipcperm() call : 93 if (mode IPC_M) { 94 error = suser(td); 95 if (error) 96 return (error); 97 } 116 if

Re: A question about ipcperm() call?

2006-07-24 Thread Robert Watson
On Mon, 24 Jul 2006, Xin LI wrote: On 7/24/06, 李尚杰 [EMAIL PROTECTED] wrote: The code for ipcperm() call : 78 ipcperm(td, perm, mode) 79 struct thread *td; 80 struct ipc_perm *perm; 81 int mode; 82 { 83 struct ucred *cred = td-td_ucred; 84 int

Re: A question about ipcperm() call?

2006-07-24 Thread Robert Watson
On Mon, 24 Jul 2006, Xin LI wrote: why not directly return the error in line 94? I think it makes sense to remove the assignment and the 'error' variable. Let's see Robert's opinion. I'm sorry, my previous answer was based on a mis-reading of the question -- you're not suggesting

Re: A question about ipcperm() call?

2006-07-24 Thread Alexander Leidinger
Quoting Robert Watson [EMAIL PROTECTED] (from Mon, 24 Jul 2006 13:04:45 +0100 (BST)): also. I would be interested in seeing reasonable restructurings of this code, perhaps as a set of blocks that looks at each requested operation or set of related operations and authorizes them sequentially.

Re: A question about ipcperm() call?

2006-07-23 Thread Xin LI
On 7/24/06, 李尚杰 [EMAIL PROTECTED] wrote: The code for ipcperm() call : 78 ipcperm(td, perm, mode) 79 struct thread *td; 80 struct ipc_perm *perm; 81 int mode; 82 { 83 struct ucred *cred = td-td_ucred; 84 int error; 85 86 if (cred-cr_uid !=

Re: [SoC]: question about execve()

2006-07-13 Thread Divacky Roman
On Thu, Jul 13, 2006 at 06:12:40PM +0200, Divacky Roman wrote: hi, durin my work on SoC I happened to be in a need of catching the transition of execve() from fbsd binary to linux binary and back. Kostik Belousov suggested using the process_exit handler event but it doesnt

Re: Coding question: finding the size of a block device

2006-06-24 Thread andrew chace
On 6/24/06, Frank Mitchell [EMAIL PROTECTED] wrote: Let's assume your Block Device is an ATA Hard Disk and you're using FreeBSD 6.0 like me. Take a look at sys/ata.h and you'll see a large fully-commented structure, struct ata_params, which is used to return the information from the ATA

Re: Coding question: finding the size of a block device

2006-06-24 Thread Frank Mitchell
Let's assume your Block Device is an ATA Hard Disk and you're using FreeBSD 6.0 like me. Take a look at sys/ata.h and you'll see a large fully-commented structure, struct ata_params, which is used to return the information from the ATA IDENTIFY DEVICE command using something like:

Re: Simple question about mmap() system call

2006-06-23 Thread Stanislav Sedov
On Fri, 23 Jun 2006 17:47:57 +0300 (EEST) Dmitry Pryanishnikov [EMAIL PROTECTED] wrote: Hello! I'm writing an utility that should examine some bytes of a large file and modify them - that't all. I've decided to mmap() the file: void *diskp; if ((fd=open(argv[1], O_RDWR)) ==

Re: Simple question about mmap() system call

2006-06-23 Thread Dan Nelson
In the last episode (Jun 23), Dmitry Pryanishnikov said: I'm writing an utility that should examine some bytes of a large file and modify them - that't all. I've decided to mmap() the file: void *diskp; if ((fd=open(argv[1], O_RDWR)) == -1) err(EX_NOINPUT, Can't open %s

Re: Simple question about mmap() system call

2006-06-23 Thread Dmitry Pryanishnikov
Hello! On Fri, 23 Jun 2006, Konstantin Belousov wrote: if ((diskp=mmap(NULL, 512, PROT_READ | PROT_WRITE, 0, fd, 0)) == MAP_FAILED) err(EX_IOERR, Can't mmap() file); shows actual first byte of my file. But modification doesn't get written back to the disk, file

Re: Coding question: finding the size of a block device

2006-06-22 Thread Mike Meyer
In [EMAIL PROTECTED], Andrew [EMAIL PROTECTED] typed: So I guess my question is: is there a POSIX compatible function that will allow me to check the size of a given block device? I'd be surprised - POSIX doesn't seem to deal with block devices at all. Checking the sources to df, it uses

Re: Coding question: finding the size of a block device

2006-06-22 Thread Dave Cornejo
There are no block devices in FreeBSD, only character devices http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics-block.html dave c In [EMAIL PROTECTED], Andrew [EMAIL PROTECTED] typed: So I guess my question is: is there a POSIX compatible function that will allow

Re: Coding question: finding the size of a block device

2006-06-22 Thread Dan Nelson
In the last episode (Jun 22), Mike Meyer said: In [EMAIL PROTECTED], Andrew [EMAIL PROTECTED] typed: So I guess my question is: is there a POSIX compatible function that will allow me to check the size of a given block device? I'd be surprised - POSIX doesn't seem to deal with block

Re: Coding question: finding the size of a block device

2006-06-22 Thread Eric Anderson
Dan Nelson wrote: In the last episode (Jun 22), Mike Meyer said: In [EMAIL PROTECTED], Andrew [EMAIL PROTECTED] typed: So I guess my question is: is there a POSIX compatible function that will allow me to check the size of a given block device? I'd be surprised - POSIX doesn't seem to deal

<    1   2   3   4   5   6   >