Tag Info

New answers tagged

1

The free-electrons header is internal to the kernel source, and you will find it if you look in [src]/include/linux; if you are compiling kernel code, that should be in play. The header you've pasted is the system header, from /usr/include/linux. That's for user land code that needs access to the constants and macros defined therein. These don't ...


2

You can do this using udev. Create a file in /etc/udev/rules.d with the suffix .rules, e.g. local.rules, and add a line like this to it: ACTION=="add", KERNEL=="i2c-[0-1]*", MODE="0666" MODE=0666 is rw for owner, group, world. Something you can do instead of, or together with that, is to specify a GID for the node, e.g: GROUP="pi" If you use this ...


0

Some way to a workaround/solution for this problem is to use systemd-networkd. Set up a config file at /etc/systemd/network/net0dhcp.network (or similar) to: [Match] Name=net0 [Network] DHCP=true Rename net0 in the above to the appropriate network interface name. Now: systemctl disable dhcpcd systemctl enable systemd-networkd And reboot. (You can ...


0

Out of date book, as noted. So to make the examples work with more modern linux, where it says something like cat music.wav > /dev/dsp change it to: cat music.wav | aplay And you've just done your first porting of code! Win! Feel free to send the book author patches. :-)


4

POSIX general defines three special files: /dev/tty /dev/console /dev/null In addition, / and /tmp are also defined by POSIX. /dev/zero, /dev/urandom or /dev/random are defined in some UNIX-like operating systems. Some operating systems may not define them, or implement with different names. Note POSIX direcory structure and files /dev/zero ...


0

I approve of the answer by goldilocks. But instead of using the system call read to check for filesystem changes, one can use inotify. Its man page is here and here. There is an excellent explanation and example by the creators (developers) of inotify here.


0

This may not help, but here's a similar problem I've had in the past. When I cat the device file for my mouse directly (i.e., using cat /dev/input/by-id/usb-<mymouse>) I get output similar to what you get with your keyboard (i.e., gibberish). However, some mouse motions, like left click, don't generate any printable characters, so the terminal shows ...


3

I can try to trap the Interrupt at a lower level and inform the gtkmm application. No, that is a kernel space activity. Fortunately, the kernel does report the outcome of certain events via interfaces accessible from userland. It's a little ambiguous in your question whether you want to detect when a block device is attached, or when a filesystem is ...


0

I was having the same problem and the solution at http://www.theoutpost.org/index.php?/archives/222-open-devvideo0-Device-or-resource-busy.html helped me. $ fuser /dev/video0 /dev/video0: 1871m $ ps axl | grep 1871 $ kill -9 1871


0

There's a great set of answers to this on StackOverflow and Serverfault already but some techniques were missing. To make life easier here's an short list of Linux disk I/O fault injection mechanisms: Use Device Mapper's error/flakey/delay devices to return errors/corruption from, or delay/split IO to a synthesised block device (kernel, requires kernel to ...



Top 50 recent answers are included