Linux-Development-Apps Digest #294, Volume #7 Thu, 22 Mar 01 15:13:12 EST Contents: Signals (Jan Pietrusky) Re: Signals (Josef Moellers) Re: Signals (Jan Pietrusky) Driver help required for all Win Printers ..Please Help me! ("LittleFish") Re: sizeof returns wrong structure size (Grant Edwards) Re: seg fault when creating new objects under linux (Graeme Roy) IPv6 ("Eva M. Castro") Re: Linux + PostgreSQL + Apache + JDBC + Tomcat JSP / Servlets: Ready for prime time? (Bob Hauck) Re: sizeof returns wrong structure size (Lou Grinzo) Re: Driver help required for all Win Printers ..Please Help me! ("Thomas Jones") alternatives to 'xfig'? Re: Linux + PostgreSQL + Apache + JDBC + Tomcat JSP / Servlets: Ready for prime time? (The Ghost In The Machine) ---------------------------------------------------------------------------- From: Jan Pietrusky <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system Subject: Signals Date: Thu, 22 Mar 2001 13:25:30 +0100 Hello, does anyone know, how I use more than one signal in a programm? Specialy, my prog contains 2 signals, one is SIGINT to catch the ctrl-c and one timer SIGALRM. If I use the signals several, I take the correct function. If I use both signals, I get problems and the timer will not working. Part of the code main() { struct sigaction sa, rt; memset( &sa, 0, sizeof(&sa)); memset( &rt, 0, sizeof(&rt)); -> timerinitialisation sa.sa_handler=CloseApp; rt.sa_handler=realTimer; if(sigaction(SIGINT, &sa, NULL)) perror(); if(sigaction(SIGALRM, &rt, NULL)) perror(); } Jan -- --------------------------------------------------------------------- | Dipl.-Ing.(FH) Jan Pietrusky | Tel: +49 (0) 3677 678331 | | Institut fuer Mikroelektronik- und | FAX: +49 (0) 3677 678338 | | Mechatronik-Systeme | | | Langewiesener Strasse 22, 98693 Ilmenau | | |---------------------------------------------------------------------| | MAIL/WWW: [EMAIL PROTECTED], http://www.imms.de/ | --------------------------------------------------------------------- ------------------------------ From: Josef Moellers <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system Subject: Re: Signals Date: Thu, 22 Mar 2001 14:26:04 +0100 Jan Pietrusky wrote: > = > Hello, > does anyone know, how I use more than one signal in a programm? > Specialy, my prog contains 2 signals, one is SIGINT to catch the ctrl-c= > and one timer SIGALRM. If I use the signals several, I take the correct= > function. If I use both signals, I get problems and the timer will not > working. > = > Part of the code > main() > { > struct sigaction sa, rt; > memset( &sa, 0, sizeof(&sa)); *********************************^ Leave out this address operator. > memset( &rt, 0, sizeof(&rt)); *********************************^ and this one, too! > -> timerinitialisation > sa.sa_handler=3DCloseApp; > rt.sa_handler=3DrealTimer; > if(sigaction(SIGINT, &sa, NULL)) perror(); > if(sigaction(SIGALRM, &rt, NULL)) perror(); > } -- = Josef M=F6llers (Pinguinpfleger bei FSC) If failure had no penalty success would not be a prize -- T. Pratchett ------------------------------ From: Jan Pietrusky <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system Subject: Re: Signals Date: Thu, 22 Mar 2001 14:44:31 +0100 Hi Josef, I can't believe, that this was my failure. Thanks a lot. But, why is it so and one signal can received and if I use two signals, it failed? Jan -- --------------------------------------------------------------------- | Dipl.-Ing.(FH) Jan Pietrusky | Tel: +49 (0) 3677 678331 | | Institut fuer Mikroelektronik- und | FAX: +49 (0) 3677 678338 | | Mechatronik-Systeme | | | Langewiesener Strasse 22, 98693 Ilmenau | | |---------------------------------------------------------------------| | MAIL/WWW: [EMAIL PROTECTED], http://www.imms.de/ | --------------------------------------------------------------------- ------------------------------ From: "LittleFish" <littlefish_au[SPAM ME AT YOUR OWN RISK]@yahoo.com> Crossposted-To: comp.os.linux.development.system,comp.os.linux.security,comp.security.firewalls Subject: Driver help required for all Win Printers ..Please Help me! Date: Fri, 23 Mar 2001 00:33:37 +1000 Hi everyone! I am looking for some practical help with lpr and printer formats. What the problem is is that I have Lexmark 1000 that I can't get to work with Linux. I have tried every program designed to run this printer. I used drivers desinged for lpr I have used Cups with the cupsomatic/foomatic script and driver and it doesn't work. What I want to do is get my output from PCB which is Postscript and forward it to a script that calls Wine and a multifunctional program that I am writing in Windows. This program reads the file type and data and loads it in a large buffer then prints it using the standard windows printer driver! This will make it possible to run any WIN Printer!! This will entice more users to Linux and their hardware will work! Down to the meaty stuff I have Red Hat 6.2 Intel based sytem Dual BootWindows 98 168Meg Ram 300Mhz Celeron. What I need to know is if the output of a linux program that goes to lpr then to the driver is the same configuration as what Windows sends to it printer driver! I don't expect it would be however I do need to ask. If it isn't is there conversion software that converts the format from Linux to the format required by Windows. I will take a Postscript only converter only for the moment if I have too, as my main object is to print a Postscript file to a lexmak1000 using wine! Any pointers to resources would be great! Thanks heaps LittleFish -- Remove [SPAM ME AT YOUR OWN RISK] to mail me. ------------------------------ From: [EMAIL PROTECTED] (Grant Edwards) Subject: Re: sizeof returns wrong structure size Date: Thu, 22 Mar 2001 15:18:07 GMT In article <99cc3c$h5f$[EMAIL PROTECTED]>, Rolf Magnus wrote: >> anding and oring them into words/bytes isn't considered "a lot >> of overhead" but making sizeof return a value that is equal to >> >> (address of the last field) - (address of first field) + (sizeof last >> field) >> >> is beyond the pale. > >sizeof is evaluated at compile time. So there is no overhead. If you have a >structure that is 25 bytes long, all occurences of sizeof(thestruct) are >replaced by 25 before the code is created. "Overhead" was a bad choice of words -- I meant "overhead" as the extra stuff in the language/compiler required to support bitfields on hardware that doesn't have bitfield instructions. -- Grant Edwards grante Yow! .. Do you like at "TENDER VITTLES?"? visi.com ------------------------------ From: Graeme Roy <[EMAIL PROTECTED]> Subject: Re: seg fault when creating new objects under linux Date: Thu, 22 Mar 2001 15:50:57 +0000 On 22 Mar 2001, grant wrote: > hmm.. val is defintely NULL terminated. > also, the declaration of member pointer m_pString is: > > char *m_pstring; > > which is certainly correct... > > keep in mind, these seg faults when calling the new operator > are happening all over the place - not just at that one line of > code, which makes me think as to whether or not tehre's a bigger (more > insidious) form of general memory corruption going on.... does this look > linux specific somehow? perhaps there's a malloc patch that we're missing??? There's unlikely to be any problem with the glibc malloc implementation as it's being used in almost every single application that runs on Linux. Your best bet would be to try a malloc debugging library such as mpatrol which will detect multiple frees, mixing new/free, writes to free memory, etc. It's most likely that something has overwritten one of the internal pointers used by malloc to keep track of free memory blocks and that is causing it to crash. Graeme. ------------------------------ Date: Thu, 22 Mar 2001 17:54:47 +0100 From: "Eva M. Castro" <[EMAIL PROTECTED]> Subject: IPv6 hi all, sorry if this question is off topic i had installed a redhat 6.2 with kernel 2.2.15-0 and i compiled it to provide IPv6 support. now i have installed 2.4.0 kernel and i think something is wrong in the headers installation because i find in /usr/include/linux/in6.h (from new kernel installation): struct sockaddr_in6 { unsigned short int sin6_family; /* AF_INET6 */ __u16 sin6_port; /* Transport layer port# */ __u32 sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ __u32 sin6_scope_id; /* scope id (new in RFC2553) */ }; and in /usr/include/netinet/in.h (from old installation): struct sockaddr_in6 { __SOCKADDR_COMMON (sin6_); uint16_t sin6_port; /* Transport layer port # */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ }; the problem is if only the in6.h is included in my programs, it can not find ntohs/htons functions. And if in6.h and in.h both are included there is a redefinition of sockaddr_in6 struct. and if the /usr/include/arpa/inet.h is included for using inet_pton/inet_ntop it conflicts with /usr/include/linux/in6.h... any idea? thank you in advance, eva ------------------------------ From: [EMAIL PROTECTED] (Bob Hauck) Crossposted-To: comp.lang.java.advocacy,comp.lang.java.tech,comp.os.linux.advocacy Subject: Re: Linux + PostgreSQL + Apache + JDBC + Tomcat JSP / Servlets: Ready for prime time? Reply-To: hauck[at]codem{dot}com Date: Thu, 22 Mar 2001 17:02:13 GMT On Thu, 22 Mar 2001 04:08:59 -0500, Flacco <[EMAIL PROTECTED]> wrote: > In the past, I've used NT/VB/IIS/ASP/MTS/SQLServer for web apps. I'm a > recent Linux convert, and would like to look into using > Linux/Apache/Tomcat/JDBC/PostrgreSQL for some future projects. > From what I see so far, I like it conceptually, but I wonder how this > combination performs in the real world, in terms of speed and > reliability, on modest hardware (say, dual P700's with 256MB). <http://www.avalanche.org/> Runs on dual P-500 with 256 MB. All authentication for the member areas plus a number of large databases (some updated daily) are handled by PostgreSQL. No Java, but a bit of PHP (e.g. every page has a footer added by PHP). It also handles some mailing lists, a number of virtual sites for sponsors, and some web forums. System has been up for four years. It started on a P-120 and the last hardware upgrade was in '99. It crashed once last year when the power supply died. We do regular security updates and such, but don't do any sort of "cleanup" maintenance beyond what our cron jobs do. At the end of each season I spend a day or two merging the "current weather" db into the "historical" and things like that. I'm 2K miles away from the server, BTW, which is co-located at an ISP. I'm the "systems" guy, other people maintain the website itself. > Would you recommend replacement implementations for any of the > components I've listed to make the environment more reliable? I have no experience with Tomcat, but the rest of the bits are quite reliable. ------------------------------ From: [EMAIL PROTECTED] (Lou Grinzo) Subject: Re: sizeof returns wrong structure size Date: Thu, 22 Mar 2001 18:05:55 GMT I've been watching this conversation, and I wanted to jump in with some comments. First, I think Grant has an excellent point in saying that this is like bitfield support. That's precisely the level of abstraction that's needed for this type of structure alignment--you tell the compiler what you want and it worries about the implementation details. Second, it strikes me how similar this conversation is to the never ending debate about Linux's usability. Ask for Linux to be more user friendly, and you'll inevitably hear from people who think your desired change is inappropriate or unnecessary. In the both the Linux and structure cases I believe the critical detail is that using the new feature of the GUI or a language would be entirely optional. Don't like it? Don't use it, and there's zero impact to you and your program. If you feel you need or want it (and, like Grant, I'm one person who would definitely use this feature in C if it were available and potable), then use it. Given how often programmers have to deal with persistent data in fixed structures, it seems odd that this wasn't added to C a long time ago. Yes, you can work around it by various means, but there's no guarantee of portability between compilers, or even between the current version of your compiler and a future release. I just went through this hassle with a program, and had to bite the bullet and write code to manually serialize and deserialize some structures. What a waste of time and effort. I could have been doing something far more productive, like sleeping, or watching the South Park movie for the 12th time. <g> In article <bA5u6.1211$[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > In article <ck5u6.82730$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > > >> It's not only possible, it's not even that hard. There's no > >> _technical_ reason why it isn't done, it's a philosophical > >> difference. I think structs should be usable for that, and the > >> compiler/language guys thing you should use a big array of > >> chars and memcpy(). > > > >There _was_ a technical reason; the reason was that the makers of the > >ANSI C standard had a whole lot of participants coming from different > >directions, including having some fairly bizarre architectural > >choices. > > > >There were implementations where 'words' would need to be aligned to 8 > >bit, 16 bit, 32 bit, 64 bit boundaries, and possibly even more > >peculiar options. [36 bit environments being the mainstream "oddball" > >thing.] > > I see. Then bitfields are right out? No CPU I've ever seen > could do bitfields. How can we have them in C? Hardware > doesn't that supported structure assignemnts -- yet C has them > because the compiler generates the required code to copy the > data from the source to the destination. > > I'm not asking _hardware_ support for arbitrary alignemnt. I'm > asking for _compiler_ support for arbitrary alignment. It's no > different than bitfields. Hardware doesn't support bitfields > so the compiler generates code to access bitfields using the > access methods the hardware _does_ support. > > If hardware doesn't support certain alignments of certain data > types, then the compiler can generate code that does. The > other choice is to force the _application_ to contain code to > align the data. I think that's a wasteful way to do things. > You could argue that the user's application could back data > into bitfields, and you'd be right -- but the compiler provides > that service because it's useful. Specifying the alignment of > data is required any time you're communicating with the outside > world (networking, filesystems, hardware interfaces, etc.). > > >C could not specify the precise alignment, because that would > >leave you with one of three options: > > > >a) Needing to have a part of the language to specify alignment of > > structures, which adds a chunk of complexity to the language; > > The distaste for increased complexity of the language is a > valid argument. In my opinion, since C is a low level lanuage, > it makes sense to let the user do low level things in an > efficient way. ------------------------------ From: "Thomas Jones" <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system,comp.os.linux.security,comp.security.firewalls Subject: Re: Driver help required for all Win Printers ..Please Help me! Date: Thu, 22 Mar 2001 18:12:35 GMT wrong newsgroup.........egghead! You have just made my "PLONK" file for cross-posting again! -- Thomas Jones Cyber-Revolution.org "LittleFish" <littlefish_au[SPAM ME AT YOUR OWN RISK]@yahoo.com> wrote in message news:0Lnu6.1387$[EMAIL PROTECTED]... > Hi everyone! I am looking for some practical help with lpr and printer > formats. What the problem is is that I have Lexmark 1000 that I can't get to > work with Linux. I have tried every program designed to run this printer. I > used drivers desinged for lpr I have used Cups with the cupsomatic/foomatic > script and driver and it doesn't work. What I want to do is get my output > from PCB which is Postscript and forward it to a script that calls Wine and > a multifunctional program that I am writing in Windows. This program reads > the file type and data and loads it in a large buffer then prints it using > the standard windows printer driver! This will make it possible to run any > WIN Printer!! This will entice more users to Linux and their hardware will > work! > > Down to the meaty stuff I have Red Hat 6.2 Intel based sytem Dual > BootWindows 98 168Meg Ram 300Mhz Celeron. What I need to know is if the > output of a linux program that goes to lpr then to the driver is the same > configuration as what Windows sends to it printer driver! I don't expect it > would be however I do need to ask. If it isn't is there conversion software > that converts the format from Linux to the format required by Windows. I > will take a Postscript only converter only for the moment if I have too, as > my main object is to print a Postscript file to a lexmak1000 using wine! Any > pointers to resources would be great! Thanks heaps > LittleFish > > > > -- > Remove [SPAM ME AT YOUR OWN RISK] to mail me. > > ------------------------------ From: <[EMAIL PROTECTED]> Subject: alternatives to 'xfig'? Date: Thu, 22 Mar 2001 18:57:59 +0000 (UTC) hi i was wondering if there are any alternatives to 'xfig' under linux that will let me draw stuff? thanks. ------------------------------ From: [EMAIL PROTECTED] (The Ghost In The Machine) Crossposted-To: comp.lang.java.advocacy,comp.lang.java.tech,comp.os.linux.advocacy Subject: Re: Linux + PostgreSQL + Apache + JDBC + Tomcat JSP / Servlets: Ready for prime time? Date: Thu, 22 Mar 2001 20:04:07 GMT In comp.os.linux.advocacy, Flacco <[EMAIL PROTECTED]> wrote on Thu, 22 Mar 2001 04:08:59 -0500 <[EMAIL PROTECTED]>: > >In the past, I've used NT/VB/IIS/ASP/MTS/SQLServer for web apps. I'm a >recent Linux convert, and would like to look into using >Linux/Apache/Tomcat/JDBC/PostrgreSQL for some future projects. For clarity's sake (the equivalences are rough, and in terms of functionality): NT = Linux VB = Java IIS = Apache ASP = JSP MTS = ? SQLServer = various (PostgreSQL, mySQL, mSQL, Oracle, DB2) ODBC = JDBC ? = Jakarta/Tomcat It's not clear to me whether MTS can be folded into the SQLserver or not (PostgreSQL supports transactions and rollback, as do Oracle and DB2). I'm also not sure what's on the MS side regarding Tomcat's concept of "web application". > > From what I see so far, I like it conceptually, but I wonder how this >combination performs in the real world, in terms of speed and >reliability, on modest hardware (say, dual P700's with 256MB). Bear in mind that a more important factor might well be the disk drive I/O buss as opposed to the CPUs, although it depends on the application. I'm using SCSI, for example, which gives good performance. Cheaper machines use IDE, although it's possible UDMA100 or UDMA66 might be decent; I don't know. > >I don't want to invest a lot of time in this kind of environment if >there are performance problems under load, if services stop running >unexpectedly, if ports mysteriously shut down, etc. etc. > >Has anyone worked extensively with this combination? What were your >experiences? > >Would you recommend replacement implementations for any of the >components I've listed to make the environment more reliable? > >Any pointers to websites that discuss these issues? A good set of questions, admittedly; I don't know the answers, but suspect someone might. Bear in mind that you're crossposting to comp.os.linux.advocacy and comp.lang.java.advocacy, which are usually more flamefestful than helpful, although some interesting info is occasionally gleanable here. :-) In any event, good luck on your hunt for info; watch out for the usual pitfalls (one of them being e.g. the now-infamous Mindcraft benchmark). > >Thanks > -- [EMAIL PROTECTED] -- insert random misquote here EAC code #191 45d:09h:23m actually running Linux. The Usenet channel. All messages, all the time. ------------------------------ ** 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 ******************************