Re: your mail
go out to www.mamma.com and search for "ddd" It should be on ftp.lame.org, also. ddd uses gdb, and requires X windows. It provides superior source level debugging. you may also use xxgdb, or simply gdb to debug programs at the source level. you must compile and link with the -g option to do this. bug On Wed, 31 Mar 1999, Darius Blaszijk wrote: Hi all, Having my latest problems using DOS/WINDOWS, I decided to start programming under LINUX. I installed LINUX redhat 5.2 and bought myself the book L.A.D. I must say that I'm getting on quite well (I had to learn also how to program in C). But here is where my problems start. To do some programming I use for instance EMACS. When I'm done I exit EMACS and run GCC and then run the program to see if it does the thing I want it to do. This procedure is time consuming and not eficient. Is there any compiler/editor/debugger-package anvailable from the internet? Or am I missing something here? I've noticed that MC has an edit feature which shows source code using different colours. I find this very helpfull. Thanks a lot, Darius Blaszijk Get Your Private, Free Email at http://www.hotmail.com
Re: strtok()
strtok() uses a global to store its intermediate results. meaning that you can get unexpected results if several parts of your program use it. On Mon, 29 Mar 1999, Joseph Keen wrote: maybe it's just me, but i find this funny... (from the strtok() manpage) BUGS Never use this function. it's a fairly big bug! :) i expect there are similar things stuck to nuclear warheads (Warning! This device is hazardous to most forms of life, do not use). where is this? It's not in my manpage.
Re: ps
If you get the source code to ps and hack it so that the "ax" command line switches are not usable, it will do what you want. bug On Sun, 7 Mar 1999, [ISO-8859-1] Torbjørn Kristoffersen wrote: I guess this is C programming related, so that's because I ask here :-P. Is there a way to restrict output of the program 'ps', so that it'll only show the users own processes, not other users? I believe this has something to do with the kernal. Does anyone know of how to do this? Which files to be cluttered with and so on? -- Torbjørn Skodvin Kristoffersen [EMAIL PROTECTED]
Re: More Questions
II) a re-entrant recursive function is a function that is written so that it can call itself over and over to finish a problem, or can be called by multiple other functions. Re-entrant recursive functions are tricky in that you have to make sure you get to a recognizable point to say you are through. One possible re-entrant recursive function can be one that adds the numbers from one to the passed number: int add_all_num(int num) { int x; int y; int z; y = 0; z = 0; x = num ; if (x-1) y = add_all_num(x-1); return(x+y); } you have to avoid stack crashes. re-entrant functions and recursive functions can be stack hogs. Rules of thumb for re-entrant functions: 1. don't use global variables Rules of thumb for recursive functions: 1. see above 2. make sure the recursion will end. On Thu, 4 Mar 1999, Chetan Sakhardande wrote: ) What is an AVL tree? II) WHat is a reentrant function? III) snip
Re: daemon trivia
On Mon, 18 Jan 1999, Brent Williams wrote: My apologies if this is a waste of anyone's time. I am getting tired of responding "I don't know" when a user asks me where the term "daemon" came from. Does anyone know the answer to this? thanks in advance I've read this somewhere... In the old Arabian Nights type of tales, demons were spirits summoned to do things and then dismissed. In the same vein that the "read.me" file came from Alice Through the Looking Glass (eat me, drink me), these tales were expressed in Unix. Daemons (with the Greek ae) were the names given to programs that sit in the background and pop forward to do what you need, then vanish. sounds good, anyway :) bug
send_sig and library question
I need to use send_sig from an application. It is not in the man pages. It is not in the info pages. It is in the kernel source. How do I find the library that send_sig is currently in so that I can link to it? On a more general level, how do I find the library any function I am interested in is in? bug
Re: send_sig and library question
Thanks! I knew it was in the kernel. since it allows a (0) parameter, I was hoping that it was in a library somewhere. Really hoping. I had earlier found all kinds of documentation in /usr/doc that said, in effect "This is a library!". Can you give me a hint where a compendium of the functions I expect to find in the various libraries on the system will be? Or a pointer to an executable that will print out the functions a library exports? Many times I have compiled programs only to find they need a function, and no library I can find on the net appears to have that function. When I post questions about the functions not found, the answer I get back is "it is in library xxyyzz". Usually, library xxyyzz does not exist. It is part of another larger library zzyyxx which is not documented, or is "so well known" that everyone knows it (except me). Or it has been renamed. thanks, bug On Fri, 15 Jan 1999, Glynn Clements wrote: Bug Hunter wrote: I need to use send_sig from an application. It is not in the man pages. It is not in the info pages. send_sig() is a kernel function (kernel/exit.c). It is in the kernel source. How do I find the library that send_sig is currently in send_sig() isn't in any library; it's a kernel function. so that I can link to it? You can't link to it; it's a kernel function. On a more general level, how do I find the library any function I am interested in is in? You find the library first. Then you read the library's documentation, which should tell you which functions it provides. A function's manual page may tell you which library it is part of. -- Glynn Clements [EMAIL PROTECTED]
Re: FD_ISSET -- select -- bug?? need help.
hmmm. I'm not sure that is it. We have abandoned looking at select for errors for the pipe. It could be a sigalarm, as the timeout may have tripped. However we are also using sigalarm, and that code was not executed. And, select did not return a -1, and there were no errors indicated on the non-pipe handles. bug [EMAIL PROTECTED] wrote: On Fri, 18 Sep 1998, Bug Hunter wrote: We are using a stock redhat 5.1 in an embedded system. It is not on the internet, and has _very_ few services. (for you hacker types). If this is on the wrong list, please point me to a better list. thanks! we opened a pipe without error. we then did this: FD_ZERO(InputFD); // initialize read descriptors FD_SET(s,InputFD); // Add socket to descriptors to FD_SET(FromDH,InputFD);// wait on Modem data as well FD_ZERO(wErrorFD); FD_SET(s,wErrorFD); FD_SET(FromDH, wErrorFD); signal(SIGALRM,SignalHandler); while(1){ wInputFD = InputFD; // don't wait more than 500msec before reporting timeout.tv_sec = 0; timeout.tv_usec = 50; short result = select(FD_SETSIZE,wInputFD,NULL,wErrorFD,timeout); ... We get a 2 from select, then the pipe (FromDH) indicates an error. errno is zero. There is no error that we can see. any clues? I am not sure, but I think the SIGALARM and select use the same timer. If my suposition is true, should be normaly for select to have strange behavior when got a interrupt. Any oppinion ? -- Best wishes, Marcel - Titus MARGINEAN [EMAIL PROTECTED], [EMAIL PROTECTED]
Re: user space i/o to parallel port questions
Yes. That was a made up excerpt, and I blew the address. I'm actually using LPT1 at addres 0x278 for the base, controlling a luminescent display. It turned out that 3 is the right value to give to the iopl function, not 2. bug Marin D wrote: On Mon, 10 Aug 1998, Bug Hunter wrote: - -main() -{ - -iopl(2); - - outb(0,0x3bd); It should be 0x3bc, port 0x3bd is the status port (read-only). You may wich to take a look at the IO-Port-programming mini howto Regards, Marin "Knowledge is not a crime. Some of its applications are..." - Unknown hacker
user space i/o to parallel port questions
I'm running as root, trying to do i/o to one of the parallel port areas using this program fragment: main() { iopl(2); outb(0,0x3bd); } IOPL is successful. However, I get a segmentation fault at the outb() call. Can someone help me?? bug
Re: user space i/o to parallel port questions
Thanks! That was it. I had read the man pages, and "Linux device drivers" (OReilley) and could find no documentation regarding the value to feed to iopl() other than the iopl(2) that was mentioned in the man page for iob. Is there a good treatise for this somewhere? Also about the entire glibc stuff? btw, I do need to access ports above 0x3ff for an embedded project. Due to an oops by Motorola on their MBX board propogating into embedded RTOS systems, I'm getting the chance to prove Linux can handle what we want to do. thanks again, bug Glynn Clements wrote: Bug Hunter wrote: I'm running as root, trying to do i/o to one of the parallel port areas using this program fragment: main() { iopl(2); outb(0,0x3bd); } IOPL is successful. However, I get a segmentation fault at the outb() call. IIRC, you need to use iopl(3) to obtain access to I/O ports. In general, it's preferable to use ioperm() to obtain access only to the specific I/O ports which you need. You only need to use iopl() if you need to access ports above 0x3ff. -- Glynn Clements [EMAIL PROTECTED]