Linux-Development-Apps Digest #283, Volume #7 Fri, 16 Mar 01 18:13:13 EST Contents: Re: Retrieving a web page ([EMAIL PROTECTED]) Re: ipv6 ([EMAIL PROTECTED]) Re: sizeof returns wrong structure size ([EMAIL PROTECTED]) Re: GPL ("Joseph A. Knapka") Re: undefined reference ("Joseph A. Knapka") Re: alarm, signal and read (Juergen Heinzl) Re: GPL (John Hasler) Re: Scope of controls in glade-- ("Andrew Innes") Re: how create a window in KDE? which tool use? ("Andrew Innes") Re: anything similar to powerpoint Re: A Linux disaster! ("Andrew Innes") Re: Processor ID (Matt Woodyard) Re: alarm, signal and read (Kaz Kylheku) ---------------------------------------------------------------------------- From: [EMAIL PROTECTED] Subject: Re: Retrieving a web page Date: Fri, 16 Mar 2001 21:18:57 -0000 On Fri, 16 Mar 2001 21:11:15 +0100 Emilien Arino <[EMAIL PROTECTED]> wrote: | I wrote a little program to retrieve a web page and store it into an array | (code at the bottom of this mail) .The code is still ugly. I'll clean it up | as soon as it works as expected. | | The program works with almost every web page.But I have a problem with this | one : | http://setiathome.ssl.berkeley.edu/cgi-bin/cgi?email=arino.canton%40wanadoo. | fr&cmd=user_stats_new | | | This is what I send to the server | | | GET /cgi-bin/cgi?email=arino.canton%40wanadoo.fr&cmd=user_stats_new HTTP/1.0 | Accept: text/html | User-Agent: HttpClientTest | Host: setiathome.ssl.berkeley.edu | Proxy-Connection: Keep-Alive | | This is what he returns: | | | HTTP/1.1 500 Internal Server Error | Date: Fri, 16 Mar 2001 18:47:06 GMT | Server: Apache/1.3.14 (Unix) mod_fastcgi/2.2.10 | Last-Modified: Thu, 02 Mar 2000 07:29:40 GMT | ETag: "173d8-192-38be1864" | Accept-Ranges: bytes | Content-Length: 402 | Connection: close | Content-Type: text/html | | <head> | <title>Error</title> | </head> | <body BGCOLOR="#000000" TEXT="#FFFFFF" LINK="#00FFA0" VLINK="#00F080"> | <img src="http://setiathome.ssl.berkeley.edu/images/better_banner.jpg"> <br> | <br> | <h2>Web Server Error</h2> | <p> | The page you selected is temporarily down or disabled. | Sorry for the inconvenience. | Please try again later. | <p> | <a href="http://setiathome.ssl.berkeley.edu">Back to the home page</a> They apparently had some kind of problem. It seems to be fixed now. It took YOUR code and tried it myself on the above page and I get a good response: phil@pollux:/home/phil 281> gcc -o fetchpage fetchpage.c phil@pollux:/home/phil 282> ./fetchpage setiathome.ssl.berkeley.edu '/cgi-bin/cgi?email=arino.canton%40wanadoo.fr&cmd=user_stats_new' connecte au serveur : setiathome.ssl.berkeley.edu requete HTTP : GET /cgi-bin/cgi?email=arino.canton%40wanadoo.fr&cmd=user_stats_new HTTP/1.0 Accept: text/html User-Agent: HttpClientTest Host: setiathome.ssl.berkeley.edu Proxy-Connection: Keep-Alive ... 2177 octets recus. reponse du serveur : HTTP/1.1 200 OK Date: Fri, 16 Mar 2001 21:11:15 GMT Server: Apache/1.3.14 (Unix) mod_fastcgi/2.2.10 Connection: close Content-Type: text/html <html> <head> <title>[EMAIL PROTECTED]</title> </head> <body BGCOLOR=000000 TEXT=FFFFFF LINK=cc99ff VLINK=cc99ff> <img src=http://setiathome.ssl.berkeley.edu/images/better_banner.jpg width=500 height=100 alt='SETI@home' align=left> <br clear=all><br> <h2></h2> <H2>Account Summary for [EMAIL PROTECTED]</H2> <br><br> <TABLE BORDER=0 BGCOLOR="#303030" CELLSPACING=1 CELLPADDING=2> <TR BGCOLOR="#303080"><TD COLSPAN=2><b>Your credit:</b></TD></TR> <TR><TD>Name (and URL)</TD><TD>BarbaMilou </TD></TD></TR> <TR><TD>Results Received</TD><TD>1913</TD></TR> <TR><TD>Total CPU Time</TD><TD> 2.17 years</TD></TR> <TR><TD>Average CPU Time per work unit</TD><TD>9 hr 57 min 05.6 sec</TD></TR> <TR><TD>Last result returned:</TD><TD>Fri Mar 16 20:45:51 2001 UTC</TD> <TR><TD>Registered on:</TD><TD>Wed Nov 24 12:15:31 1999 UTC</TD> <TR><TD>SETI@home user for:</TD><TD> 1.31 years</TD></TR> <TR><TD> </TD><TD><A HREF="./cgi?[EMAIL PROTECTED]&cmd=detailed_user_stats&nresults=10">View Last 10 Workunits</A></TD></TR> <TR BGCOLOR="#303080"><TD COLSPAN=2><b>Your group info:</b></TD></TR> <TR><TD>You belong to the group named:</TD><TD><a href=http://setiathome.ssl.berkeley.edu/stats/team/team_53185.html><b>Barbapapa et Cie</b></a></TD></TR> <TR><TD>You are the founder of:</TD> <TD><a href=http://setiathome.ssl.berkeley.edu/stats/team/team_53185.html><b>Barbapapa et Cie</b></a></TD></TR> <TR><TD> </TD><TD> </TD></TR> <TR BGCOLOR="#303080"><TD COLSPAN=2><b>Your rank:</b> (based on current workunits received) <br></TD></TR> <TR><TD>Your rank out of <b>2853800</b> total users is:</TD><TD><b>25282<sup>nd</sup></b> place.</TD></TR> <TR><TD>The total number of users who have this rank:</TD><TD><b>17</b></TD></TR> <TR><TD>You have completed more work units than:</TD><TD><b>99.114%</b> of our users.</TD></TR> </TABLE> <BR><BR><CENTER><A HREF="http://setiathome.ssl.berkeley.edu/">Return to Main SETI@home page</A><P> <FONT SIZE=-1>Copyright 2000 SETI@home</FONT></CENTER> </BODY> </HTML> phil@pollux:/home/phil 283> -- ================================================================= | Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ | | [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ | ================================================================= ------------------------------ From: [EMAIL PROTECTED] Subject: Re: ipv6 Date: Fri, 16 Mar 2001 21:33:52 -0000 On Wed, 14 Mar 2001 20:05:45 +0100 Sebastian Boldt <[EMAIL PROTECTED]> wrote: | I want to write a little network app which uses ipv6. I know a | few apps which already use ipv6 sockets, and I know that you can reserve a | TCP/ipv6 socket with socket(PF_INET6, SOCK_STREAM, 0), but I want to know | all syscalls, structures and the rest for ipv6. Can anyone help me?? As ugly as it often seems to be, the BSD socket API was designed with network portability in mind, and it quite easily works with IPv6. All the same syscalls work for IPv6 as for IPv4. Only the names have been changed. You'll be copying 16 bytes from an addess in one place to an address in another place, instead of 4. The new symbols, the "AAAA" record in your DNS zone file, the more bytes, is pretty much all you need to deal with. -- ================================================================= | Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ | | [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ | ================================================================= ------------------------------ From: [EMAIL PROTECTED] Subject: Re: sizeof returns wrong structure size Date: Fri, 16 Mar 2001 21:46:52 -0000 On Thu, 15 Mar 2001 02:35:36 GMT Michael Zowacki <[EMAIL PROTECTED]> wrote: | Hi all I'm writing a program that must maintain data integrety. I've | declared a structure of various sizes and I'm sending it accross tcp to a | device require a strict form. The size of the stucture must be 34 byes and | another 52 bytes. When I send it i run into problems becuse the compiler is | aligning the data to 36 and 56 bytes respectively...can i shut this option | off at compile time or declare it not to be 'optimized'. Anyone with any | ideas on how to fix this problem short of declaring every thing at the byte | level and parsing it please help me!!! Thanks alot! If you are doing the transfer between identical systems, with identical compilers (including version), this can work. But specific numbers of bytes is not something you can specify. If the struct is 36 bytes, then 36 bytes it is. If your specification is to send certain data in certain bytes for other reasons, such as a legacy protocol or format, then you also have to consider the issue of endianess. Does your protocol require sending the high order byte first (as you would get on machines like Sparc, M68K, or S/390) or sending the low order byte first (as you would get on machines like (Intel x86). What you need to do in the latter case is set up an array of bytes (char) of size 34 and 52 (you may be able to reuse the first 34 bytes of an array of 52) and simply fill in the array, byte by byte, with exactly what is supposed to be in each byte. If it is an integer with a specific byte order, do shifts on the data value to get the specific bytes you need and just store them in there. When all done, then you can write the array. C structs cannot define the vast diversity of external formats and protocols that exist. Only working code can do that. -- ================================================================= | Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ | | [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ | ================================================================= ------------------------------ From: "Joseph A. Knapka" <[EMAIL PROTECTED]> Subject: Re: GPL Date: Fri, 16 Mar 2001 21:40:15 GMT Micah Cowan wrote: > > "wiehllen" <[EMAIL PROTECTED]> writes: > > > Hi, > > > > I have a general question. Normally, I have to open the source code of an > > application, if I use GPL-libraries. What can I do to avoid this, for > > example I want to write a commercial application in a company which is > > interessted in Linux, but doesn´t want to lose their research and > > development investments. The application should run on an embedded system to > > handle i/o data. I heard that big companies use Linux as an embedded OS for > > example in a videorecorder. I can´t believe the apps handling these machines > > are open source. So what are my choices? > > > > Thanx a lot > > wiehllen > > > > > > "Lose their research and development investments". I don't see how > you can "lose" something if you still have it, but others now have it > as well. Because others now have it as well. Obviously if I have a product and others don't, I can make more money by selling it without worries of being undercut by competitors. It's very nice to be idealistic, but some people would like to make some money from their intellectual property before it becomes public. Self-righteousness isn't likely to make any converts. > This is the sort of selfishness that the GPL was intended to > eschew. If I produce a product and would like to be compensated for that, within reason, how am I being selfish? *Everyone* is selfish in that way - we all want *some* kind of compensation for work accomplished. Some people just prefer it to be more concrete than others. -- Joe Knapka "It was just a maddened crocodile hidden in a flower bed. It could have happened to anyone." -- Pratchett // Linux MM Documentation in progress: // http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html * Evolution is an "unproven theory" in the same sense that gravity is. * ------------------------------ From: "Joseph A. Knapka" <[EMAIL PROTECTED]> Subject: Re: undefined reference Date: Fri, 16 Mar 2001 21:45:30 GMT Micah Cowan wrote: > > "omer" <[EMAIL PROTECTED]> writes: > > > First time with Linux > > RedHat 6.1 (2.2.12-20) > > > > I try to compile this very simple program: > > ------------------------------------------- > > $ cat myprog.c > > #include <stdio.h> > > #include <linux/timer.h> > > struct timer_list timer; > > main () > > { > > init_timer (&timer); > > } > > ------------------------------------------- > > $ gcc -o myprog myprog.c > > /tmp/ccVmyTBJ.o: In function `main': > > /tmp/ccVmyTBJ.o(.text+0x9): undefined reference to `init_timer' > > collect2: ld returned 1 exit status > > ------------------------------------------- > > I don't know why I got this error message, I included the > > needed header file > > > > [snip /usr/include/linux/timer.h] > > extern inline void init_timer(struct timer_list * timer) > > { > > timer->next = NULL; > > timer->prev = NULL; > > } > > > > What I have to do with extern function in header file? > > > > I also taught it was about library. With "nm", I looked for > > "init_timer" in all object files under /usr/lib/lib*.a (and > > recursively too), but I can't find any. > > > > Where is the archive mailing list of this newsgroup? > > > > Please help me to enjoy my introduction to Linux > > > > > > Omer > > > > > > H'm... my version of the header has it declared as "static inline". > ^^^^^^ And aside from that, calling private internal kernel functions from user-space code is unlikely to ever work :-) There is no userspace library you could link to get the kernel timer functions, because... well, they're in the kernel. Possibly you want to look at the time-related functions in the C standard library. man time, man signal, man 7 signal (look for SIGALRM), and read the "settimer" thread in this newsgroup over the past couple of days. -- Joe Knapka "It was just a maddened crocodile hidden in a flower bed. It could have happened to anyone." -- Pratchett // Linux MM Documentation in progress: // http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html * Evolution is an "unproven theory" in the same sense that gravity is. * ------------------------------ From: [EMAIL PROTECTED] (Juergen Heinzl) Subject: Re: alarm, signal and read Date: Fri, 16 Mar 2001 22:05:02 GMT In article <98tljd$cb1$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >>this one blocks forever (unless you satisfy the read, of course). If you >>eliminate the call to signal, then it works as expected. I'm testing this in >>redhat 6.2. I found this porting some code from sco; the included code runs >>as expected in sco > >sorry for following up myself, I realized that SIG_DFL does not make read >return, but the process to die. Is there a way so that read returns -1 with >errno = EINTR? [-] Yes and the quick solution is ... gcc -D_XOPEN_SOURCE mykillerapplication.c ... but see info signal for a more in depth discussion regarding what is available etc. etc. Ta', Juergen -- \ Real name : Juergen Heinzl \ no flames / \ EMail Private : [EMAIL PROTECTED] \ send money instead / ------------------------------ From: John Hasler <[EMAIL PROTECTED]> Subject: Re: GPL Date: Fri, 16 Mar 2001 21:31:03 GMT Micah Cowan writes: > You are not allowed to link non-GPL code with GPL code, even > dynamically,... This is not true. -- John Hasler [EMAIL PROTECTED] Dancing Horse Hill Elmwood, Wisconsin ------------------------------ From: "Andrew Innes" <[EMAIL PROTECTED]> Subject: Re: Scope of controls in glade-- Date: Fri, 16 Mar 2001 22:28:37 +0000 In article <[EMAIL PROTECTED]>, "Donald Cross" <[EMAIL PROTECTED]> wrote: > I am taking my first steps in glade-- and am having trouble getting a > button to modify a label's text. This seems basic to me but I keep > getting errors saying that the label is private in this context. Can > anyone point me in the direction of the appropriate info on how to do > this. It is just a simple "hello world" with one button and one label > which should be updated when the button is pressed. > > Thanks. Hello, I'm in the middle of writing a glade project too. See: http://www.asji.clara.net for the source code. I hope it's of some help. I don't think the labels are supposed to change in a GUI though, are they? The Editable widget is for text which changes. You don't have to give it a white box or a border etc, you can give it exactly the same visual properties as a label widget. But it's a different class because it's editable, and labels aren't. Asji. ------------------------------ From: "Andrew Innes" <[EMAIL PROTECTED]> Subject: Re: how create a window in KDE? which tool use? Date: Fri, 16 Mar 2001 22:41:04 +0000 In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On Sun, 04 Feb 2001 13:18:59 GMT, p@p@.p wrote: >> >>I'd like to begin to write code for linux but I'd like also create >>software with windows: how to create it? > > You'll probably find it easier to start with a plain Qt application. > > Qt comes with a very good introductory tutorial as well as detailed > reference documentation, I suggest you start there. http://glade.pn.org Has a nice editor for creating software with windows (as in GUI's). ------------------------------ From: <[EMAIL PROTECTED]> Subject: Re: anything similar to powerpoint Date: Fri, 16 Mar 2001 22:45:49 +0000 (UTC) thanks a lot for all the suggestions. as david said, now the problem is of choosing one from all these options. -jobs ------------------------------ From: "Andrew Innes" <[EMAIL PROTECTED]> Subject: Re: A Linux disaster! Date: Fri, 16 Mar 2001 22:52:08 +0000 In article <95kvqg$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > In article <[EMAIL PROTECTED]>, > 95459906 <[EMAIL PROTECTED]> wrote: > -Hi, all! > - > -I've a disaster on linux! The super-block of one of my linux > partitions > -was found to be corrupted and don't know how to recover it! The > partiion > -here is /dev/hda6. I tried to install another linux partition on > -/dev/hda7 and wanted to use e2fsck to fix that partition (e2fsck > -/dev/hda6 or e2fsck -b (8193...16385...24577) /dev/hda6) but failed to > -do this. Anyone can offer a help to me? Below is the message displayed > -when I tried to fix the /dev/hda6 using fsck command on the linux > -partition /dev/hda7! The same thing happened to me. At the time I had a dual boot machine with win95 (for games) and linux (for programming). Win95 didn't shut down properly once and scandisk came up the next time I rebooted. It then proceeded to check *all* the partitions on my disk, with the above results. I lost my entire f*#$%$g system! If you dual boot too, I would strongly advise getting a second hard disk for linux. It'll be safer there. ------------------------------ Subject: Re: Processor ID From: Matt Woodyard <[EMAIL PROTECTED]> Date: Fri, 16 Mar 2001 22:52:32 GMT You gonna buy a piece of software to track your internet activity? On 3/16/01 2:35 AM, in article 98sfdf$de6$[EMAIL PROTECTED], "Rolf Magnus" <[EMAIL PROTECTED]> wrote: > Matt Woodyard wrote: > >> You can't track the MAC addr anywhere but the local lan segment . > > But it is unique, so it it can be used as your ID. The CPU-ID can not even > be tracked over any network, but it's also a unique ID. > >> Most hardware vendors donıt supply developers with API's that allow people >> to track transactions by hardware part numbers over the internet. Thatıs >> about the last thing we need, next you'll have processor specific >> liscenses and "dongling". > > And what is Microsoft currently doing with Windows XP? > > ------------------------------ From: [EMAIL PROTECTED] (Kaz Kylheku) Subject: Re: alarm, signal and read Reply-To: [EMAIL PROTECTED] Date: Fri, 16 Mar 2001 20:54:00 GMT On 16 Mar 2001 18:21:33 GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>this one blocks forever (unless you satisfy the read, of course). If you >>eliminate the call to signal, then it works as expected. I'm testing this in >>redhat 6.2. I found this porting some code from sco; the included code runs >>as expected in sco > >sorry for following up myself, I realized that SIG_DFL does not make read >return, but the process to die. No, the SIG_DFL action has a signal-specific effect. What happens depends on the default handling of the signal. There is also SIG_IGN for ignoring signals. man 7 signal >Is there a way so that read returns -1 with >errno = EINTR? It depends on the nature of the file descriptor, and whether or not system call restartability has been selected for the signal. If the driver corresponding to the descriptor uses interruptible sleeps for read blocking, and returns -ERESTARTSYS then you can use sigaction() to determine whether the read system call resumes or balks with -1/EINTR. If the driver returns -EINTR, then the system call will always just balk when interrupted. If the driver uses uniterruptible sleep, then a signal cannot interrupt the read. ------------------------------ ** 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 ******************************