Linux-Development-Apps Digest #305, Volume #7 Thu, 29 Mar 01 11:13:11 EST Contents: i wanna add cramfs in the kernel 2.2 ("Leo Naboro") Re: Ojbect files generated by GCC and G++ can not be linked together (Petric Frank) Shared libs and memory usage (Giuliano Pochini) Re: Getting directory sizes - fast (Josef Moellers) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 (Harald Arnesen) Re: How to handle newline character(s) in a TCP server (Michel Bardiaux) Re: i wanna add cramfs in the kernel 2.2 ("Leo Naboro") What is the size of Linux 2.4.1 Kernel ("Alan Po") Re: How to handle newline character(s) in a TCP server (Kasper Dupont) Re: What is the size of Linux 2.4.1 Kernel (Alumne FIB - MARC COLL CARRILLO) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 (Carlos Moreno) Re: What is the size of Linux 2.4.1 Kernel (mlw) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 (Carlos Moreno) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 (Steve Bradley) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 ("ne...") Re: How to handle newline character(s) in a TCP server (Terran Melconian) gtk callback ([EMAIL PROTECTED]) Re: Getting directory sizes - fast Re: What is the size of Linux 2.4.1 Kernel (Dave Blake) Re: Getting directory sizes - fast (Michel Bardiaux) Re: RH7.* -- downgrading to gcc/g++ 2.95.3 (Rex Dieter) ---------------------------------------------------------------------------- From: "Leo Naboro" <[EMAIL PROTECTED]> Subject: i wanna add cramfs in the kernel 2.2 Date: Thu, 29 Mar 2001 15:18:02 +0800 hi,i wanna add the cramfs filesystem into my redhat 7.0 kernel(linux 2.2.26),how should i do that? Can someone give some suggestion? thanks! leo naboro ------------------------------ From: Petric Frank <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system Subject: Re: Ojbect files generated by GCC and G++ can not be linked together Date: Thu, 29 Mar 2001 08:31:11 +0100 Hello, you should place #ifdef __cplusplus extern "C" { #endif at the beginning (after the include statements in it) and #ifdef __cplusplus } #endif at the end of the include file (*.h) to be used by the c++ program. This enables the *.h file to be used from c and c++. You don't have to know anymore whether the the called function is of c or c++ style. regards Petric "Arthur H. Gold" wrote: > > [EMAIL PROTECTED] wrote: > > > > Hello, > > > > I'm trying to link some C++ code with a C library. The C library is > > compiled with Gcc on Linux (RedHat 7.0) while the C++ code is compiled > > with g++. Individual files all compile ok but linking with G++ fails. > > All the C functions come up as undefined reference. > > > > The manual page of gcc/g++ refers to C sytle linking and C++ style > > linking. What's the difference? How do you make them work? > > > > Your comments and suggestions are much appreciated. > > > In `C' style linking, what you see is what you get, i.e. if > you have a function called `foo', that's also its name as > far as the linker is concerned. C++ on the other hand, > because of the fact that you can overload functions with > different signatures, does `name-mangling' which encodes the > argument types in the name that's exposed to the linker. > > The simplest way of getting this to work would be to do the > following in C++ code that uses C-linked functions (we > assume that the prototypes for these functions are in a > header file called "myCheaders.h" > > ... > extern "C" { > #include 'myCheaders.h" > } > ..... > > This ensures that you can call C functions by their normal > names (and correspondingly you'll be able to link them). > > HTH, > --ag > -- > Artie Gold, Austin, TX (finger the cs.utexas.edu account > for more info) > mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED] > -- > Clone Bernie! ------------------------------ From: Giuliano Pochini <[EMAIL PROTECTED]> Subject: Shared libs and memory usage Date: Thu, 29 Mar 2001 10:36:33 +0200 Hi! I wrote a cgi that uses a library. I recompiled the library as shared in the attempt to reduce memory usage (I have up to 400 of this cgi's running at the same time), but it doesn't.... it even uses a few KB more. Shouldn't the library text be shared between tasks ? Why it doesn't ? I only gain a bit of disk space, but it isn't really an issue here. Bye. ------------------------------ From: Josef Moellers <[EMAIL PROTECTED]> Subject: Re: Getting directory sizes - fast Date: Thu, 29 Mar 2001 10:53:01 +0200 [EMAIL PROTECTED] wrote: > = > Josef Moellers <[EMAIL PROTECTED]> wrote: > : Use ftw() and do whatever you want in the callback function: > = > ftw() isn't very portable ... > doesn't work on BSD based systems, AFAIK. > = > FreeBSD I know has a similar command, I believe it is fsw(). I haven't used FreeBSD for ages, so you may be right, but afaIcr people used to suggest using ftw simply _because_ it was portable. Also, the request was posted on a linux newsgroup ... Using opendir/readdir/closedir would be an alternative, but you'd have to do the recursion, stat-ing etc yourself. BTW the ftw manual on Linux says: CONFORMING TO AES, SVID2, SVID3, XPG2, XPG3, XPG4, XPG4v2. which gives it an edge, I'd say. -- = Josef M=F6llers (Pinguinpfleger bei FSC) If failure had no penalty success would not be a prize -- T. Pratchett ------------------------------ Crossposted-To: comp.os.linux.setup Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 From: Harald Arnesen <[EMAIL PROTECTED]> Date: 29 Mar 2001 11:19:05 +0200 Carlos Moreno <[EMAIL PROTECTED]> writes: > I'm wondering what would be the correct procedure to downgrade > from gcc/g++ 2.96 to the latest *official* release, 2.95.3 > > If I download the source and have to compile it, then I feel > like I'm using the broken compiler (and of course it's broken, > otherwise I wouldn't be downgrading) to generate the executable > code of the new compiler... What is then my hope that this > new compiler will produce correct code? :-( You have, of course, no guarantee that _any_ compiler will produce correct code. Compiling GCC goes as follows: Stage 1: Compile the source with your current compiler. Stage 2: Compile the source with the compiler made in stage 1. Stage 3: Compile the source with the compiler made in stage 2. The last two compilers are compared, and if they differ, something is wrong. Harald. -- Foreningen for engelsk ord deling kjemper for at sammen satte ord som leke plass og kjøle skap skal skilles for aldri mer å se hver andre. Foreningen føler at den langt på vei har lykkes i sitt pioner arbeid. ------------------------------ From: Michel Bardiaux <[EMAIL PROTECTED]> Crossposted-To: comp.unix.programmer,comp.os.linux.development.system Subject: Re: How to handle newline character(s) in a TCP server Date: Thu, 29 Mar 2001 09:26:20 GMT InterFan wrote: > > I want to design a TCP server. It just receives a line from client and > handles it. Then, it sends the response back to the client. The > problem is that a line of message may end with ASCII characeter 13, 10 > or 13+10. I use blocking I/O function. How can I handle these > conditions smoothly. > > Thank a lot. > > Best Regards, > Chuan He If '\r' ends a line, then the sequence '\r''\n' is ambiguous, is it one or 2 lines, the 2nd one being empty? -- Michel Bardiaux Peaktime Belgium S.A. Rue Margot, 37 B-1457 Nil St Vincent Tel : +32 10 65.44.15 Fax : +32 10 65.44.10 ------------------------------ From: "Leo Naboro" <[EMAIL PROTECTED]> Subject: Re: i wanna add cramfs in the kernel 2.2 Date: Thu, 29 Mar 2001 17:59:59 +0800 I do these step: 1. copy the cramfs directory to the usr/src/linux/fs/ 2. then i vi the fs/Makefile and Config.in 3 and i vi the Rules.make 4 and i vi the include/linux/autoconf.h during the make bzImage,there is no error. after reboot,the kernel still not support the cramfs filesystem... what other files that i should modify?Thank anyone's suggestion! Leo Naboro ===== Original Message ===== From: "Leo Naboro" <[EMAIL PROTECTED]> Newsgroups: comp.os.linux.development.apps Sent: Thursday, March 29, 2001 3:18 PM Subject: i wanna add cramfs in the kernel 2.2 > hi,i wanna add the cramfs filesystem into my redhat 7.0 kernel(linux > 2.2.26),how should i do that? Can someone give some suggestion? thanks! > leo naboro > > "Leo Naboro" <[EMAIL PROTECTED]> wrote in message news:99unbn$fbe$[EMAIL PROTECTED]... > hi,i wanna add the cramfs filesystem into my redhat 7.0 kernel(linux > 2.2.26),how should i do that? Can someone give some suggestion? thanks! > leo naboro > > ------------------------------ From: "Alan Po" <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.system,comp.os.linux.help,comp.os.linux.misc Subject: What is the size of Linux 2.4.1 Kernel Date: Thu, 29 Mar 2001 20:46:56 +0800 Dear all Would you tell me the size of Linux 2.4.1 kernel? Is it very large? Thanks a lot Alan PO ------------------------------ From: Kasper Dupont <[EMAIL PROTECTED]> Crossposted-To: comp.unix.programmer,comp.os.linux.development.system Subject: Re: How to handle newline character(s) in a TCP server Date: Thu, 29 Mar 2001 12:52:40 +0000 Michel Bardiaux wrote: > > InterFan wrote: > > > > I want to design a TCP server. It just receives a line from client and > > handles it. Then, it sends the response back to the client. The > > problem is that a line of message may end with ASCII characeter 13, 10 > > or 13+10. I use blocking I/O function. How can I handle these > > conditions smoothly. > > > > Thank a lot. > > > > Best Regards, > > Chuan He > > If '\r' ends a line, then the sequence '\r''\n' is ambiguous, is it one > or 2 lines, the 2nd one being empty? > I have not seen any programs using ascii 13 as a line break. But even that could be handled, I think you can assume that a single client always uses the same sequence. I think this approach would work for almost anything: int mygetchar() { static int state=0; while (1) { int c=getchar(); switch(c) { case 10: if (state==13) state=0; else { state=10; return 10; } break; case 13: if (state==10) state=0; else { state=13; return 10; } break; default: state=0; return c; } } } The next problem is how to respond to the client, you can either respond with the same linebreak as the client, or you can choose a fixed style. -- Kasper Dupont ------------------------------ From: Alumne FIB - MARC COLL CARRILLO <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.system,comp.os.linux.help,comp.os.linux.misc Subject: Re: What is the size of Linux 2.4.1 Kernel Date: Thu, 29 Mar 2001 15:20:14 +0200 The compressed file is about 20 Mb. Once uncompressed, it can grow up to 100 Mb. Alan Po wrote: > Dear all > > Would you tell me the size of Linux 2.4.1 kernel? Is it very large? > > Thanks a lot > > Alan PO ------------------------------ From: Carlos Moreno <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.setup Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 Date: Thu, 29 Mar 2001 08:27:05 -0500 Jacob Williams wrote: > > couldn't you just use rpm -ivh --force gcc.whatever_version.rpm and not > worry about uninstalling the old one... it should overwrite all the relevant > files.... ( i believe ) Ok! I didn't know about this option (I was familiar with the --upgrade option, but I assume that it wouldn't work for downgrading...). Ok, I'll experiment with that method... Although according to a message that I received directly by e-mail, it is suggested that if the make bootstrap succeeds, then I should sleep in peace, since apparently the bootstrap procedure does perform a strict checking on the generated executables... So maybe I should just compile it with gcc 2.96 and have some piece of mind? Thanks a bunch! Carlos -- ------------------------------ From: mlw <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.system,comp.os.linux.help,comp.os.linux.misc Subject: Re: What is the size of Linux 2.4.1 Kernel Date: Thu, 29 Mar 2001 08:35:51 -0500 Alan Po wrote: > > Dear all > > Would you tell me the size of Linux 2.4.1 kernel? Is it very large? > > Thanks a lot > > Alan PO Do you mean built, source, or for download? It is between 20 and 30 meg to download. It extracts to a very large source tree, over 100 meg. When building, the object files take a lot of space. A bootable kernel file can be less than a 1meg. A full blown working kernel with all the modules compiled, can be about 15-20 meg in the /lib/modules/2.4.xxx. -- I'm not offering myself as an example; every life evolves by its own laws. ======================== http://www.mohawksoft.com ------------------------------ From: Carlos Moreno <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.setup Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 Date: Thu, 29 Mar 2001 08:31:18 -0500 Harald Arnesen wrote: > > You have, of course, no guarantee that _any_ compiler will produce > correct code. :-) (of course... I'm aware of that -- it's just a matter of assumptions: a compiler tag as experimental may or may not be stable, so we might as well assume that it is not. And one tagged as official release may or may not, but we are better off assuming that it is stable, otherwise we would have to just hang our keyboards and retire :-) Or even worse, we would have to switch to Windows and MS products, but then, there we DO KNOW that things tagged as *official release* DO NOT work :-)) > Compiling GCC goes as follows: > > Stage 1: Compile the source with your current compiler. > Stage 2: Compile the source with the compiler made in stage 1. > Stage 3: Compile the source with the compiler made in stage 2. > > The last two compilers are compared, and if they differ, something is > wrong. Woaw! This is impressive -- well, pretty obvious, once you're told that this is what they do :-) Ok, so I'll stop worrying about my paradox-like arguments and compile normally and sleep in peace :-) Thanks! Carlos -- ------------------------------ From: Steve Bradley <[EMAIL PROTECTED]> Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 Crossposted-To: comp.os.linux.setup Date: Thu, 29 Mar 2001 13:38:03 GMT FWIW, I've compiled almost everything that I've put on my system beyond the base RH7 install, and my own creations, with 2.96 and haven't had any problems. The code executes fine, the system is stable. Steve Carlos Moreno wrote: > > The chicken or the egg?? (or chasing my own tail??) > > I'm wondering what would be the correct procedure to downgrade > from gcc/g++ 2.96 to the latest *official* release, 2.95.3 -- Steve Bradley [EMAIL PROTECTED] ------------------------------ Crossposted-To: comp.os.linux.setup From: "ne..." <[EMAIL PROTECTED]> Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 Date: Thu, 29 Mar 2001 13:59:39 GMT On Mar 29, 2001 at 08:31, Carlos Moreno eloquently wrote: >Harald Arnesen wrote: [...] >> Compiling GCC goes as follows: >> >> Stage 1: Compile the source with your current compiler. >> Stage 2: Compile the source with the compiler made in stage 1. >> Stage 3: Compile the source with the compiler made in stage 2. >> >> The last two compilers are compared, and if they differ, something is >> wrong. > >Woaw! This is impressive -- well, pretty obvious, once you're >told that this is what they do :-) You do know that this is in the documentation which we expect you read? -- Registered Linux User # 125653 (http://counter.li.org) Flame on! -- Johnny Storm 8:55am up 12 days, 9:54, 9 users, load average: 0.00, 0.00, 0.00 ------------------------------ From: [EMAIL PROTECTED] (Terran Melconian) Crossposted-To: comp.unix.programmer,comp.os.linux.development.system Subject: Re: How to handle newline character(s) in a TCP server Date: 29 Mar 2001 09:35:41 -0500 In article <[EMAIL PROTECTED]>, Kasper Dupont <[EMAIL PROTECTED]> wrote: >I have not seen any programs using ascii 13 as a line break. I believe MacIntosh programs do that, though it's been a long time and I could be remembering wrong. 10 (\n): UNIX 13,10 (\r\n): Microsoft 13 (\r): Macintosh ------------------------------ From: [EMAIL PROTECTED] Subject: gtk callback Date: Thu, 29 Mar 2001 16:16:01 +0200 Hi all, I'm writing a gtk app to acquire from a videocamera and display the acquired frames. When I start the acquisition pressing a button, the callback, connected to the button, doesn't return the control to the applcation and I can't stop the acquire! How can I make a not blocking callback? Thanks pablo ------------------------------ From: <[EMAIL PROTECTED]> Subject: Re: Getting directory sizes - fast Date: Thu, 29 Mar 2001 15:07:52 GMT Josef Moellers <[EMAIL PROTECTED]> wrote: > I haven't used FreeBSD for ages, so you may be right, but afaIcr people > used to suggest using ftw simply _because_ it was portable. Also, the > request was posted on a linux newsgroup ... [...] > BTW the ftw manual on Linux says: > CONFORMING TO > AES, SVID2, SVID3, XPG2, XPG3, XPG4, XPG4v2. Unfortunatly, the various BSDs all use fts_open(), which is a different interface to the same functionality as ftw() and nftw(). ftw() alone isn't sufficient for everything, since it can't to depth-first searches, among other things. You can, with not alot of effort, conditionally compile on or the other, and use the same callback function. Or, if all you're worried about is portability across BSd and glibc, you can use fts_open, which is undocumented, but included in glibc. (But not Solaris, Irix, and old glibcs) -- Matt Gauthier <[EMAIL PROTECTED]> ------------------------------ From: [EMAIL PROTECTED] (Dave Blake) Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.system,comp.os.linux.help,comp.os.linux.misc Subject: Re: What is the size of Linux 2.4.1 Kernel Date: 29 Mar 2001 14:50:55 GMT Reply-To: [EMAIL PROTECTED] Alan Po <[EMAIL PROTECTED]> wrote: > Dear all > > Would you tell me the size of Linux 2.4.1 kernel? Is it very large? Kernel source, about 100 MBytes. Compressed, about 20 MBytes. Kernel binary on my machines runs about 600kbytes. -- Dave Blake [EMAIL PROTECTED] ------------------------------ From: Michel Bardiaux <[EMAIL PROTECTED]> Subject: Re: Getting directory sizes - fast Date: Thu, 29 Mar 2001 15:22:09 GMT [EMAIL PROTECTED] wrote: > > malicorne <[EMAIL PROTECTED]> wrote: > : is there a way to programmatically get the size of directories that is > : faster than calling and parsing the output of du (i.e. "du > : /usr/local/src/") ? > > Recurse through the directory tree and call lstat() on each file, > keeping track of the total sizes. Won't be perfect, but .... > > -- > Jeff Gentry [EMAIL PROTECTED] [EMAIL PROTECTED] > SEX DRUGS UNIX That is basically what du does. You avoid the overhead of parsing the output, but that will only be marginally faster. This is simply one of the deficiencies of UNIX systems, like zombies, unkillable processes, etc... -- Michel Bardiaux Peaktime Belgium S.A. Rue Margot, 37 B-1457 Nil St Vincent Tel : +32 10 65.44.15 Fax : +32 10 65.44.10 ------------------------------ From: Rex Dieter <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.setup Subject: Re: RH7.* -- downgrading to gcc/g++ 2.95.3 Date: Thu, 29 Mar 2001 10:05:03 -0600 Carlos Moreno wrote: > >> Red Hat has a new version of the compiler available on its errata site. >> Just download it, install with rpm -Uvh, and you're set. > > But it is still 2.96, so it is still not tagged as reliable :-( See http://www.bero.org/gcc296.html for an informative commentary on gcc 2.96. -- Rex Dieter Computer System Administrator Department of Mathematics and Statistics University of Nebraska Lincoln ------------------------------ ** FOR YOUR REFERENCE ** The service address, to which questions about the list itself and requests to be added to or deleted from it should be directed, is: Internet: [EMAIL PROTECTED] You can send mail to the entire list by posting to the comp.os.linux.development.apps newsgroup. Linux may be obtained via one of these FTP sites: ftp.funet.fi pub/Linux tsx-11.mit.edu pub/linux sunsite.unc.edu pub/Linux End of Linux-Development-Apps Digest ******************************