What is the best way to implement the busy loop ? correct me if i am wrong ? Answer To do an infinite wait, for a signal (what else) there is the pause() system call. You’ll have to put it in a loop, as it returns (always with -1 and errno set to EINTR) every time a signal is delivered:
Tag: linux
Installing Passenger when Nginx is already installed; Possible?
Rather a simple question I believe, is it possible to install passenger when nginx is already installed on your webserver? If the answer is Yes, I already performed these actions: At this very moment I already have nginx installed (for my PHP applications) and next I did a checkout of the passenger’s gi…
Check whether a path is absolute or relative
How do you check whether a path is absolute or relative, using C on Linux? Answer On Unix like systems (incl. Linux, macOS) If it starts with a slash it’s absolute, otherwise it’s relative. That is because everything is part of a single tree starting at the root (/) and file systems are mounted so…
How to print out registers in Linux kernel?
I want to print out values of a couple of registers from the linux kernel code running on ARM. Particularly I have the following assembly in linux – How do I print out the values of r2, r3 and r5 in kmsg? I do not want to use the variable names and want to get the values from registers. Answer
basics steps in converting xml file to html file
I would like convert a xml file to a html file. Where i can find a step by step tutorial (for linux) to do this in shell script, or which are the steps to follow. Sorry for the very basic question, but i am an absolute begginer on this. thanx Answer The basic tools to do this is XSLT. XSLT
Unknown symbol in while loading a kernel module
I need help understanding why I get an error when I insert a module. I have tried this with no success. Many thanks. Answer I have solved this problem as suggested on this forum: Compiled scst. Appended the generated Module.symvers to existent /lib/modules/<version>/build/Module.symvers (Hack. Do not kn…
Error installing NPM for node.js
I’m trying to install npm on ubuntu 11.04 using the “git all the way” method found in this gist I keep getting this error after running sudo make install on npm I know this is something wrong with bash, but I’m not very good with bash. EDIT running the node command in the terminal brin…
Linux udev rule does not appear to work
I am writing an application that MUST run on Fedora Core 4. The application needs to access a USB device WITHOUT root privileges. Using libusb-1.0.8 I have successfully written the application except for one problem. If I do not have root privileges, libusb_open fails with -3 “Permission Denied”. …
mkswap fails to create a file
I was attempting to create a swap file: I get “/var/swap No such file or directory” Am I supposed to create the file first? The documentation I found does not say that, so I am concerned. Answer Yes, you’ll need to create the file first. dd is the standard choice: this’d create a 128me…
Is it possible to compile a C/C++ source code that executes in all Linux distributions without recompilation?
Is it possible to compile a C/C++ source code that executes in all Linux distributions without recompilation? If the answer is yes, can I use any external (non-standard C/C++) libraries? I want distribute my binary application instead of distribute of source code. Answer No, you can’t compile an executa…