linux

Linux USB driver probe not called if device already plugged

If I use a modified usb skeleton driver on Linux and I insmod the module with the USB device already plugged in, the probe function doesn't get called. I need to unplug and replug the device in order for the driver to be activated. This is not the case for e.g. the serial drivers, I made some tests. Is there a reason for this? How do I g...

How to call a function from a shared library?

What is the easiest and safest way to call a function from a shared library / dll? I am mostly interested in doing this on linux, but it would be better if there were a platform-independent way. Could someone provide example code to show how to make the following work, where the user has compiled his own version of foo into a shared lib...

What do I need to write a small game on Linux?

I want to make a simple game: 2d, single-player, without tons of animations and special effects. I am not interested in ready to use game engines, I want to learn to write some code in a quite universal language. I am using Linux (AMD64) and looking for something easy with nice library for games. I do not want to mix few languages, most ...

A classic StackOverflow : Java Swing

Greetings everyone! I programmed GUI Application using Java Swing under Windows. Under windows everything works well. Now I am trying it under Linux (using distribution Linux Mint 7). I am getting and nasty StackOverflowException, when I call frame's dispose method! The problematic frame is JDialog component. Here is some output : ed...

Possible to use a .dll on Linux

Question: Is it possible to compile a program on linux using a .dll file? Where this is going: This .dll will be used to write a php extension to some proprietary software from a third party. Background and Research: I have been given a library called proprietary.lib. I was curious, as I have never seen the .lib extension before, so ...

sendfile() usage on two mmaped files (linux)

Hello Can sendfile() linux syscall be used to send part of file from one mmaped file to other mmaped file? ...

[GCC, linking] How to link app with static library + why this is not working

I have a problem. I wrote example code and I want to build it without the error: main.cpp(.text+0x5): undefined reference to `test()' Library test1.c #include <stdlib.h> void test() { puts("Działa"); } test1.h #ifndef TEST1_H #define TEST1_H extern void test(); #endif makefile all: gcc -c ./src/test1.c -o ./lib/test1.o ...

On which platforms does libc store stack cookie values somewhere other than __stack_chk_guard?

e.g glibc on Linux/i386 stores the cookie at %gs:0x14. Are there any other platforms on which I need to look somewhere other than at the __stack_chk_guard symbol to find the cookie? (This is where the value that gcc -fstack-protector-generated code stores onto the stack in function prologues and checks before return to defend against st...

detect sender of signal (linux, ptrace)

Hello Can I distinguish signal, between delivered directly to a process and delivered via debugger. Case 1: $ ./process1 process1 (not ptraced) //set up handler alarm(5); .... //signal is handled and I can parse handler parameters Case 2: $ debugger1 ./process1 process1 (is ptraced by debugger1) //set up handler alarm(5);...

How to change/show permissions in C

Hi! I am new to C programming and I'd like to implement chmod command on files of a dir and subdir. How can I change/show permissions with a C code? Could someone help with a example? I would appreciate if anyone can provide me a code. ...

local code files synch with server

I search for way to synch my local code with server on debain linux. For example i modify some files, then i can run synch command, and only changed files send to server (using ssh for ex). Can you help me with good light solution for this? ...

Triggering Signal Handler For I/O.

Using C on Linux, how would I go about triggering a signal handler every time I write data to a buffer using the write() function. The handler will be reading all data written to the buffer at the time of execution. ...

Get pixel's color in C++, Linux

Hello, I'm looking for a possibility to get the color of a pixel with given screen coordinates (x,y) in c++ / Linux? Maybe something similarly like getPixel() in Windows. I spent the whole day to find sth but without any success. Thanks, Stefan ...

Compiling linux sources in Windows enviroment

I got a source for console program written in c++ for linux Is there a (automated) way to compile this source to run in windows? and what about linux functions and libraries called in this file? Thanks ...

linux new/delete, malloc/free large memory blocks

Hi folks, We have a linux system (kubuntu 7.10) that runs a number of CORBA Server processes. The server software uses glibc libraries for memory allocation. The linux PC has 4G physical memory. Swap is disabled for speed reasons. Upon receiving a request to process data, one of the server processes allocates a large data buffer (usin...

Linux Bluetooth programming

I am making a desktop application to connect with an embedded device. I was going to use Windows but due to lack of proper examples and documentation I decided to go with Linux bluez development. Can someone suggest a good resource to go about programming for bluez. I found a MIT documentation but that was about it. ...

What happens after a packet is captured?

Hi all, I've been reading about what happens after packets are captured by NICs, and the more I read, the more I'm confused. Firstly, I've read that traditionally, after a packet is captured by the NIC, it gets copied to a block of memory in the kernel space, then to the user space for whatever application that then works on the packet...

Retrieve available Wifi networks on Ubuntu

I'm starting to learn Ubuntu 9.10. How can I retrieve all available Wifi networks programmatically? Can someone give an example? ...

C++ wrapper for posix and linux specific functions

Hi Do you know about any good library wrapping posix and linux functions and structures ( eg. sockets or file descriptors ) into C++ classes? For example I'm thinking about a base FileDescriptor class and some inheriting classes ( unix sockets etc ) with methods like write, read or even some syscalls ( sendfile, splice ) - all throwing ...

Email pipe to php script working only sometimes

I have a php pipe script that receives an email, takes an attached *.csv from it and parses it. However, when the email is sent from where it is supposed to be coming from, it silently errors. But when I take that same email and resend it from my address it goes through just fine. is there any simple reason it could be doing this? ...