Hi,
EDIT: Thanks for the answers so far, at least I can compile it now, but I still get a segmentation error.
For compilation I use the following line:
gcc -g -O0 -I../include -L../ test.c -static -lrt
Source Code is as follows:
#include <sys/time.h>
#include <time.h>
#include <stdio.h>
struct timespec *diff(struct timespec *start...
I have done the following:
Create a virtual timer that triggers repeatedly.
Install signal handler for SIGVTALRM
Call clone syscall
Set sched_affinity such that the cloned thread runs on a different CPU
Will the cloned thread also be listening for SIGVTALRM? So will both the threads call the signal handler when SIGVTALRM is triggered...
...and of course obtaining the output in some way I can use it. I'd use it for an ls | grep, but it's good to know for any future issues.
Thanks in advance.
...
Hi,
I am a newbie with shell scripting but just wanna quickly do something really
simple. I have a testprogram that writes some results into a file "result". I wanna
run the program three times and then store the results in an appropriate file with the
name result1, result2, etc.
I thought something along those lines will do the trick...
In python 2.6 under Linux, I can use the following to handle a TERM signal:
import signal
def handleSigTERM():
shutdown()
signal.signal(signal.SIGTERM, handleSigTERM)
Is there any way to setup a handler for all signals received by the process, other than just setting them up one-at-a-time?
...
So, I think I'm going to do some coding on Linux soon, but so far the biggest turn-off for me was that I'm very reluctant to move away from my current text/code editor. I'm looking for a Linux text/code editor (either GUI or text-based) which is (or can be configured to be) as close as possible to my current setup of FAR Manager's built-...
Hi all,
Thanks for all the answers so far!
I am having a Dual Core processers and I would like to have all the processes running
on core1 but one. I know now that I can use taskset to set all currently running to
be bound to processor 1 for example. Now I would like that my OWN application is scheduled
for execution on processor 2 inst...
Assume a legacy Linux application listening on a UNIX domain socket /tmp/foo.
In addition to communicating with this legacy application over the UNIX domain socket mechanism I want to be able to connect to it via a TCP-connection on port say 1234.
What is the easiest way to bind to TCP port 1234 and then redirect all incoming connectio...
As part of trying out django CMS (http://www.django-cms.org/), I'm struggling with getting Python-MySQLdb to work (http://pypi.python.org/pypi/MySQL-python/).
I have installed Django CMS and all of its dependencies (Python 2.5, Django, django-south, MySQL server)
I'm trying out the example code within Django CMS code with MySQL as chos...
I would like to know how to create console applications with better control of input and output using C. For example, how does the text-editor nano display the file contents in a certain portion of the screen and then keep a list of commands stationary on the bottom. I know you can use the win32 api to do this in Windows, but what is t...
I am trying to setup cruisecontrol in a Linux environment. I have some experience with cc.NET, but this is the first time I have ever tried to use the 'nix version. This is what I have for my build.xml:
When I run "ant project1", everything seems to work except that it tells me:
/opt/cruisecontrol-bin-2.8.3/projects/portal/build.xml:...
At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then java -jar start.jar
Any ideas how to get this to start automatically on boot?
Im on a shared linux server.
Cheers
...
Hello.
I'm using SuSE 11.2. It has GCC 4.4 installed by default. I've downloaded and built from sources GCC 4.3.4 while leaving 4.4 as well. I've also altered environment variables - CC, CPP, CXX and PATH - to point to GCC 4.3 binaries. And when I run Android 1.5 make, I get following error:
make: * No rule to make target ../../../../bi...
I need to have the ability to create user accounts on my Linux ( Fedora 10 ) and automatically assign a password via a bash script ( or otherwise, if need be ).
It's easy to create the user via Bash eg:
[whoever@server ]# /usr/sbin/useradd newuser
But is it possible to assign a password in Bash, something functionally similar to thi...
I am trying to use "strace -p" to attach to an already running JBoss process. JBoss is using the 1.5.0_15 Java JDK. Unfortunately, this doesn't work - I only get a single futex() result:
# strace -p 3388
Process 3388 attached - interrupt to quit
[ Process PID=3388 runs in 32 bit mode. ]
futex(0x8f18f7c, FUTEX_WAIT_PRIVATE, 1, NULL <unfi...
I need to double-fork vmware so it doesn't inherit the terminal ID (TTY/pts).
This is what I have so far, but I can't get access to the runtime.exec process to fork another process (which removes the terminal ID).
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("vmware");
Is there a way to "daemonize" in Java?
...
I'm giving a try to MIPS Assembly by reading the MIPS Assembly Language Programming book, but I don't know the tools that are suggested and that are optional. What I need is
Tools that are needed
What is the best emulator and how to configure it?
At the time I just have cross-compiled binutils targeted to mips-elf.
I'm using Linux U...
Hello,
This is a newbie question, but here we go...
I would like to know how I would go about programming a small embedded linux board (I was thinking a TI Divinci based board) for a video input (via HDMI or Component) and then output to a TV (via the same HDMI connection).
Along with the original video pass through, I would like t...
HI, i am recently in a project in linux written in C.
This app has several processes and they share a block of shared memory...When the app run for about several hrs, a process collapsed without any footprints so it's very diffficult to know what the problem was or where i can start to review the codes....
well, it could be memory overfl...
I have an input data with three columns (tab separated) like this:
a mrna_185598_SGL 463
b mrna_9210_DLT 463
c mrna_9210_IND 463
d mrna_9210_INS 463
e mrna_9210_SGL 463
How can I use sed/awk to modify it into
four columns data that looks like this:
a mrna_185598 SGL 463
b mrna_9210 DLT 463
c mrna_9210 ...