linux

Using message queue between unrelated processes

Hello, I am trying to use a message queue for communication between two unrelated processes in Linux. I am aware that using a common key value will allow us to open the same message queue in both the unrelated processes. But the problem is that at times a key value corresponding to a message queue might already be used by some system ut...

Overview of Linux boot late_time_init() in start_kernel()?

There's a part of the Linux boot sequence I don't understand and an overview would be immensely helpful. Specifically the WARN_ON_ONCE(!irqs_disabled()) in sched_clock.c::sched_clock_tick() is triggering and I'd like to trace back to where the interrupts are disabled. Knowing the call tree is one thing (as seen below), but since there a...

Performance of IcedTea 6 vs Sun's HotSpot 6

How does IcedTea 6's performance stand up against Sun's own HotSpot on linux systems? I tried searching Google but Phoronix's test is the best I got, which is almost a year old now. Hopefully things have improved since then. Also, once Sun completely open sources the JVM, would it be possible to implement it for Linux platforms such tha...

pthreads: inconsistency between gcc and icc on Linux

Hello, The following code produces wrong and inconsistent output with gcc (4.1.2 20080704) but correct and expected output with icc (Version 11.1) . But when I moved the thread_data_array[] definition from main() to global (immediately after the struct thread_data definition) it works fine with both compilers. I do not see why this chang...

Question about file seeking position..

My previous Question is about raw data reading and writing, but a new problem arised, it seems there is no ending.... The question is: the parameters of the functions like lseek() or fseek() are all 4 bytes. If i want to move a span over 4G, that is imposible. I know in Win32, there is a function SetPointer(...,Hign, Low,....), this po...

Free Tool for Validating 2 Databases

I want a free tool for verification all table data between 2 mysql databases ? is there any free tool available on Linux ...

where can I find video4linux2 device /dev/video in ubuntu 9.04.

where can I find video4linux2 device /dev/video in ubuntu 9.04. ADDED. I want to work with Hardware Overlays. I want to make a video player which play video on one overlay and draw controls on other overlay. For that I want to use video4linux. ...

Is it possible to create binaries for other platform on Linux?

Is it possible to create binaries of other platform on Linux? Say I have a program that can be compiled using gcc to .o file but can we use it to output exe that can be run on windows ? ...

Can a pthread perform clean-up on its own?

Let's say I: malloc a pthread_tfor holding a thread context pthread_create with as user parameter the pointer to the pthread_t structure In other words, the thread function has access to its pthread_t context structure. Now here is the tricky bit: How can the pthread exit on its own and get the pthread_t context freed somehow? i.e. ...

Querying MX record in C linux

Possible Duplicate: Get MX record via C program. Is there any function in C on linux by which we can query MX record (like gethostbyname).? ...

compiling my own kernel (not from linux-kernel source)

I'm following the kernel tutorial from here im having problems compiling my files. i get the following errors when i try to compile: main.c:8: error: expected declaration specifiers or ‘...’ before ‘size_t’ main.c:8: error: conflicting types for ‘memcpy’ ./include/system.h:5: note: previous declaration of ‘me...

Compiling program with ns_initparse() function C linux

I have installed BIND. I am using -lresolv as paramete while compiling in gcc. But it is giving error: /usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' /tmp/cck9LhAK.o: In function `resolvmx': res.c:(.text+0x6b): undefined reference to `__ns_initparse' res.c:(.text+0...

python or bash - adding " at beginning of line and ", at end of line

I have text file with something like first line line nr 2 line three etc And i want to generate "first line", "line nr 2", "line three", I wonder how to do this in python or maybe in bash if it's easier/quicker. I know there is different code for opening file and different for reading only one line in python(?) but i'm not sure wh...

XLookupString returning a UTF-8 code (Latin-1 to UTF-8)

Hello. I'm trying to use the function XLookupString. According to the documentation, it is supposed to return a Latin-1 code. How could I convert it or what should I use instead this function so I get a UTF-8 code? Thanks. ...

Determining execution time of a thread and IO accesses by different threads

Hello I want to determine execution time of a thread in a multi-threaded program, and I also want to know about IO accesses made by each thread. Is there any command/tool which can do this for C programs? ...

Debugging shared libraries remotely with gdb/gdbserver

My question is about remote debugging an application on an embedded arm processor using gdb/gdbserver. I can debug the application itself, but the application dynamically links to a shared library which implements an in house communications protocol. I want to be able to set breakpoints within the shared library functions so try to fig...

Does exiting from a pthread release malloced memory ?

Let's say I pthread_create and then pthread_detach it. Now, from within the thread function, I malloc some block. When the thread exits, will the malloc'ed memory be freed automatically? (been googling for an answer to no avail...) ...

Hello world without using libraries

Hi, This was an onsite interview question and I was baffled. I was asked to write a Hello world program for linux.. That too without using any libraries in the system. I think I have to use system calls or something.. The code should run using -nostdlib and -nostartfiles option.. It would be great if someone could help.. ...

Zip File with PPMD Compression, Programmatically Unzip

I have a Linux Python script that needs to unzip some zip files. I was using the zipfile module. On a few of these files I'm getting: BadZipfile: Unsupported compression method 98 for file Searching around it seems these files are using Method 98 PPMD compression. I figured if python couldn't do it, I'd make a hack system call to u...

How to install source rpm(src.rpm) in fedora?

Hi, How to install source rpm(src.rpm) in fedora? When i try to rebuild spec file after install package(for example openssh) with sample command : rpmbuild -ba openssh.spec I get folow message and not complet build Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.QkUOot + umask 022 + cd /root/rpmbuild/BUILD + LANG=C + export LANG + un...