Programming :: Fgets() Function In Fedora10 Not Taking Any I/p In Aloop?
Oct 22, 2010
fgets() function does not work inside any loop or any function outside the main function in a c programe.i have debugged the programe using gdb and found that the the string conatins ' all times after execution for the first time. is ther not any functions that takes string as input including blanc space.
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash addelementtoarray() { local arrayname=$1
I need to compare two lists, and if a line exists in file 1, delete it from file 2. Here is what I am using, and it works on samples of a few hundred lines, but I have to get it to work faster on 50k lines. Has taken 7 hours so far and still no results.
result2 is master list, result1 is new list where i want every line to be completely unique--not in result2.
grep -vf result2.txt result1.txt | sed 's/ .*//' > diffs.txt
I am working in HP UNIX. I have one process which is running continuously.There is log file generated for the process. I want to take back up of file without loosing any logs after particular interval of time or say file size increases more that 1GB.
fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code: I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
Iam using socket programming in one of my problem. The scenario is like this.
=>one module is working as a socket server(process p1) is able to handle client sockets on that port. =>one module is working as socket client (process p2) is connected to server socket and Tx/Rx data on this socket. This module has some more threads, based on received data from server socket it will connect to http on other thread and get information... =>one more module is working as socket client (process p3) is also connected to server socket and doing some other transactions.
Here my problem is when in presence of p2, p3 http connection taking more time than the expected. If we wont start p3(means only one server-client socket) then http connection is fast enough.
The issue I am currently facing is more of an annoyance / curiosity, and it may not even be a problem, but it sure feels like one. Background: I am becoming a computational chemist (grad school begins in the fall) and the code I run is all in fortran. I am currently compiling with gfortran. When I compile the code (on a box running ubuntu server), everything appears to compile fine, but the linking stage is taking five to ten minutes. I ran the time command while making it and got the following results.
Quote:
time make gfortran -c -O3 -fomit-frame-pointer -finline-functions -ffast-math suijtab.f Linking testCompile ... done
[code]...
I just don't understand why it is taking 5 minutes of real time if it only takes 10 - 15 sec of system time?
in bash scripting...say I want to take the input from a user via a question...I would do this:
Quote:
#!/bin/bash
echo "How large do you want this partition to be in GB (enter only the number)?" read PART_SIZE echo "You want your partition to be $PART_SIZE GB" But I don't want to echo it back to the screen, I want to add it to the content of /etc/fstab. I have been mucking around with sed to find the tmpfs partition in /etc/fstab and add the partition size attribute (this is to use the onboard RAM as a volatile partition)...but am not having any luck...
The portion of /etc/fstab that uses /dev/shm for the tmpfs partition is:
tmpfs /dev/shm tmpfs defaults 0 0
So, if a user says "24" GB to the answer (from above), how do I get it to automatically add that value to the tmpfs partition line in /etc/fstab? So it would look like:
tmpfs /dev/shm tmpfs size=24g,defaults 0 0
I understand that I would also have to come up with a way to put "size=XXg", which I could do with a copied over generic file before this action...then the script would have to find "XX" and replace it with the user's figure...
I had two OS win xp nd fedora10.i formated my xp nd was installing windows 7 in its place when i did the same my fedora got invisible i m unable to find whole partition where my fedora was installed.......and i cant use fedora now...
We can mount one NFS server just fine, but if we try mounting a share from another NFS server on the same domain we are unable to. We are using Fedora 10. Has anyone run into a problem trying to mount an exported share folder from an NFS server. Some of us get access denied and we've chmod 777 on the exported folder. The export file contains: /labdocs 192.168.1.0/24(rw, sync, no_root_squash)
And that's it. We run exportfs -a -v and it shows up fine. On one of the client systems we try to mount the folder on a directory created by root mkdir /docs mount 192.168.1.13:/labdocs /docs it either hangs or displays a message access denied.
I have a question about calling an asm function from C....It doesn't work unless I create an asm variable to hold the value of the function in....Why?Here's the code that doesn't work...
asmfile.s - version one Code: .section .data mydata: .ascii "this is the message! .equ mylen, . - mydata
I want to use backtrace() function to debug a crash issue. I tried this sample code to see how backtrace works. backtrace() function always returns 0 with the below code. Is there any kernel configuration that needs to be set for proper working of backtrace?
#include <execinfo.h> #include <stdio.h> #include <stdlib.h> /* Obtain a backtrace and print it to stdout. */ void print_trace (void)
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:
Code: error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.
How can invoke the C function from C++ object oriented code?
Code: #!/bin/sh #System commands and other configurable. IPT=/sbin/iptables IP6T=/sbin/ip6tables IPST=/usr/sbin/ipset MODP=/sbin/modprobe GET=/usr/bin/wget INT_NET=192.168.1.0/24 .....
I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function? SEE>> Code: for c in $ISO Also, am I using the 'test' command correctly( -/+ week as valid test)?
I am doing a web site program and what I need is to call a C program in the PHP cloud.Do u think it would be possible? The web site would get the user input from PHP UI and pass to the C program , the C program would process the function with the user input and output the a PHP page.
Code: return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG); What is the above function returning.I am not clear with definition of what is being returned in the above code.
i want to compile function c in java and compile library is success.. when i call the library in java and error is :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libfunc.so in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1689) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028)
I have installed fedora10 on my system. I have given root pasword before the installation,and also normal user password after installation. I am not able to login a root user,but can login as normaluser.
I would like to install window xp which have been corrupted for some reasons.Fedora10 is working fine on my PC.I try to install window xp from cd,it shows only first two steps.Can you tell How can I install window xp on my system.