0
votes
0answers
13 views

How to get stdout of another program [duplicate]

Some Linux program prog1 permanently prints to console. I'd like to read and analyse it's stdout in my C program prog2 as stdin. I can't change prog1 source. I expect something like this command: ...
1
vote
1answer
42 views

Cannot compile C programs after deleting libc.a and libc.so

I removed libc.a and libc.so files from my Raspberry Pi. I read somewhere that it was going to fix a problem i had with the mpi.h library, but instead of that it has prevented me from compiling C ...
0
votes
2answers
80 views

where's the man pages for sizeof function in c lib?

How come there's no man pages for sizeof c function ? $ man 3 sizeof No manual entry for sizeof in section 3 $ man sizeof No manual entry for sizeof I see man pages for other c functions if I do ...
2
votes
1answer
46 views

Record a process's User/System/Real time in Linux/Bash with greater precision

What I am looking for is something along the lines of /usr/bin/time, however, this usually does not have enough precision. I am running a C program (that I can edit and recompile) and I need to ...
1
vote
3answers
205 views

Change network settings programmatically without root

I want to change network configurations like dhcp, ip address and so on programmatically. But what I don't want, is to run my application as root. So my question is: What would be a common approach ...
0
votes
0answers
12 views

accesing G-listed sectors

is it possible to acces g-listed sectors? in the scsi protocol I can get the amount of g-listed sectors via a a scsi command however I wonder if I can try to read from them. maybe with a direct read ...
0
votes
0answers
36 views

How to get PID of proccess that send SIGRT?

I have a problem with getting sender PID. I write a simple program, but it is not working in function sig_handler in (*info).si_pid. It tells me that there is no such a member. Why? int sethandler( ...
0
votes
0answers
51 views

How to use astyle to format code for linux driver

How can I use astyle to format code for linux driver? I try usingn astyle like this astyle --style=linux myfile.c but it does not fix things like int i,j; there should be a space after ','. ...
0
votes
1answer
60 views

Linux/Bash: Comment every line matching a pattern

sed is foreign to me, to say the least. I'd like to traverse a C project tree and comment out every line calling the function LogMsg(). Something that'd achieve the following: foreach: line within ...
2
votes
1answer
94 views

Get Physical NIC's Mac Addresses on Linux

I am trying to get the mac addresses of a Linux machine. I only want the physical NIC's though, not the virtual ones. I have been doing some searching and maybe I am not punching in the right terms ...
0
votes
1answer
61 views

Need advice with making a customized linux distribution (From scratch or pre-existing distro?)

I'm working on an application on a bootable USB drive that runs at startup (doesn't give the user access to anything but this program). I figured I'd utilize an existing distribution, strip it of ...
0
votes
0answers
30 views

Building php module on linux - lpsolve55

I'm trying to install a php model called lpsolve. I installed it on OS, now trying to make a use of it for php. I installed them as explained here: http://jeyroz.tumblr.com/post/605709794/lpsolve-php ...
0
votes
2answers
64 views

Why execute permisiions along with write permissions needed for creating file in c(Linux)?

I am trying to create a file from my c source code on linux. I am using dd command for reading from a file and writing in to a file by creating there. If i don't have execute permissions(I have write ...
0
votes
1answer
71 views

Cant compile SDL source file with gcc

i downloaded a manual of introduction to graphics programming with SDL, so i tried to compile my first source and it logged the next error the command to compile it was: $ gcc helloWorld.c [-o ...
3
votes
1answer
167 views

Is it possible to compile with make.inc and Makefile

I am a newbie to the use of make files. I have added a new module in project using make.inc The structure of project is like:- /Project/build.sh /Project/make.inc /Project/Module1/Makefile ...
2
votes
1answer
149 views

How hex command becomes rm -rf ~ / &?

How does the following malicious command become rm -rf ~ / & when compiled? char esp[] __attribute__ ((section(“.text”))) /* e.s.p release */ = “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″ ...
1
vote
1answer
65 views

How to know on which socket is a processor core?

I have a dual socket 8 core system, 4 cores on one socket and the other 4 cores on the other socket. How can I find, which core is on which socket through /proc/cpuinfo. For example here, on which ...
0
votes
2answers
860 views

E138: Can't write viminfo file

I'm using ncurses to create a tui to move through directories. I have the program opening editable files in vi using a system call def_prog_mode(); endwin(); sprintf(command, "%s %s", ...
1
vote
0answers
491 views

How to add “Read & execute” permission in Windows 7 for file on Samba drive

From a C program I would like to add "Read & execute" permission in Windows 7 for a file on a Samba drive. The "icacls" program is used in example below, but a C library call could also be a ...
3
votes
3answers
650 views

How to quickly navigate/jump between functions on emacs?

How to quickly navigate/jump between functions on emacs? I'm looking for a way to jump quickly to functions on emacs. I'm using the emacs search to do it,but it's too slow and fail. For example,I need ...
0
votes
4answers
344 views

How to set the time temporarily in Linux

I am testing some code with some random numbers generated with the current time as the seed using srand(time(0)) I'd like to get the same random numbers every time when I run it. So I want to set ...
0
votes
1answer
251 views

Which Package has net_tstamp.h?

I attempted to compile the source code here: http://os1a.cs.columbia.edu/lxr/source/Documentation/networking/timestamping/timestamping.c?a=x86;v=2.6.32 However, I got a compiler error: error: ...
1
vote
2answers
71 views

Making the keyboard eject switch work

I am using Linux.My keyboard switch for ejecting the CDROM does not work though it displays an eject button on the screen. I need to make it work. I know ejecting a cdrom using system call is as ...
2
votes
1answer
730 views

execvp exec format error for shell script on Red Hat Enterprise Linux 6

We have two RHEL 6 systems that are running identical versions of the kernel and glibc (glibc–2.12–1.90.el6_3.6). According to the POSIX standard and the Linux man pages, if the kernel determines that ...
0
votes
2answers
48 views

GNU Emacs is crashing with -nw

When I run emacs with -nw option, the emacs really open, but I can't do more nothing. As if the user input is blocked and no keyboard signal is received and/or interpreted. I've tried run without load ...
1
vote
3answers
1k views

How to maximize GNOME Terminal on Linux

Environment: Red Hat Enterprise Linux, C language , Eclipse IDE for C/C++ Developers Question: I'm programming a typing tutor which run on GNOME terminal, i want to maximize terminal when run ...
0
votes
0answers
512 views

Get current thread id in kernel based C code (Linux)

I have a module which is accessed for read/write operations to a proc file. I know I can get current process id using current->pid, but is there a way to get the current thread id that is accessing ...
5
votes
1answer
222 views

Kernel hacking methodology - how to find out where to hack the linux kernel

I have a throw-away cheap laptop I'd like to twiddle around, a Thinkpad SL 500. What bothers me are two leds, the one for wireless connectivity, and the one for hibernation, which don't light up at ...
1
vote
2answers
836 views

How can I automatically lock the screen when idle in CentOS?

How can I automatically lock the screen when idle in CentOS? I would like it so that a user has to re-enter their password once the machine has been idle for a period of time. If there is no option ...
1
vote
1answer
319 views

How to clear orphaned watch descriptors of inotify

After creating a file descriptor by calling inotify_init() I add thousands of watches to the inotify instance(hope it is right to call that so). My questions is if my program crashes what happens to ...
9
votes
4answers
907 views

Does linux have any measures to protect against fork bombs?

#include <unistd.h> int main(int argc, char* argv[]) { while(1) { fork(); } } I run this program on my linux, nothing outputs on the terminal, the OS seems go dead. Does linux have ...
1
vote
5answers
234 views

Linux file contains “@^@^@^@”, how to restore?

I just finished writing a large c code, but when I save and open again the file contains strange characters: ...
2
votes
2answers
7k views

“bin/sh: can't access tty; job control turned off” error when running shellcode”

I'm writing shellcode to exploit a buffer overflow vulnerability on a server. To do so I have port binding shellcode that I send to the server and then I run (from a linux terminal) the command telnet ...
2
votes
2answers
310 views

What does this macro mean in linux kernel code?

see i found one config file in which this are macro defined # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_ADP5588 is not set CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_QT2160 ...
1
vote
1answer
1k views

unable to compile a kernel module

I tried to compile my first loadable kernel module and failed :( Here is the error: r@ubuntu:/$ sudo make -C /lib/modules/`uname -r`/build/ M=`pwd` [sudo] password for r: make: Entering directory ...
0
votes
1answer
447 views

Does stat/lstat on nonexistent file cause a disk seek?

When searching for a library file from a right folder, my application currently does couple of lstat's for the possible locationslocations. Now I'm wondering whether these lstat's (application is ...
1
vote
1answer
2k views

How to do hardware DTR/DSR flow control on Linux (serial port programming)?

It's possible to setup a serial port communication using hardware flow control with the RTS/CTS pins (CRTSCTS flag for tcsetattr), but there is no way to use the DTR/DSR pins for flow control in a ...
0
votes
3answers
56 views

Using Connection of one PC on another [closed]

I have two linux PC and connected through LAN cable.First PC having internet connection but second does not.I want second PC to use the connection of first PC through a C program. I am new to network ...
1
vote
1answer
3k views

How to enable daytime service on ubuntu

I have found the following info on my machine user@ubuntu:/etc/xinetd.d$ cat daytime # default: off # description: An internal xinetd service which gets the current system time # then prints it out ...
142
votes
8answers
8k views

What do the parentheses and number after a Unix command or C function mean?

I keep seeing parentheses and a number after a command in Unix or Linux or C function. For example: man(8), ftok(2), mount(8), etc. What do these mean? I see them in man too.
2
votes
2answers
371 views

What's the most easy-to-install Neural Network C++ library with command-line for Linux? [closed]

I'm a fan of the "test first" approach to programming. My C++ program needs a neural net. I've been trying FANN (http://leenissen.dk/fann/wp/) but it's been a struggle, as it requires a language ...
2
votes
1answer
619 views

how to mount NTFS partition image on linux from file?

i need to mount at least for read access NTFS-based partition image on linux from a file. File is binary copy of a partition. Is there any libraries or resources for this? Thank you
1
vote
2answers
82 views

How can code/software access locations in memory that it's not supposed to?

By default, when applications run, they are limited in the amount of RAM they are allowed to access right? Technically my VLC could not access memory addresses used by Chrome. But how is it possible ...
0
votes
1answer
832 views

How do I find the installation path of binutils, gcc-3.4.4.tar.gz in Ubuntu?

I have ubuntu 8.10. In this I could find the binutils, gcc are installed. But when ever I try to know that glibc, glibc-linuxthreads are installed are not. It showing that no package is found. For ...
6
votes
6answers
5k views

Is there any small linux distribution which comes with a complete C development environment

I have installed "Damn Small Linux" on my home computer for doing C development in unix. But the distribution doesn't by default come with the C development environment and I am facing some issues ...
2
votes
3answers
1k views

How to run .exe file when linux system starts up?

i have generated .exe file from C file (ie filename.c ) after compiling in linux machine with -O option. I wish to know about how to run that .exe file when linux system starts up ?
5
votes
2answers
6k views

Installing libraries and header files under ubuntu linux for c/c++ developement

I have to admit that I feel completely lost each time I have to fulfill the dependencies of some C or C++ code. Currently, I'm on Ubuntu 9.10, but I remember the same feeling of forlornness from ...