C is a general-purpose computer programming language used for operating systems, games and other high performance work and is clearly distinct from C++. It was developed in 1972 by Dennis Ritchie for use with the Unix operating system.

learn more… | top users | synonyms

5
votes
1answer
3k views

what device name should I have to give in snd_pcm_open other than “default”

I want to record sound from 2 devices simultaneously: internal mic external usb webcam mic Using pulseaudio sound controller, I set either of these devices as default and could record sound with ...
3
votes
1answer
1k views

ioctl: invalid argument for HDIO_GET_IDENTITY

I wrote a program to get the details of hard disk drive using HDIO_ ioctl calls. For writing program, I'm referring Documentation/ioctl/hdio.txt in kernel source(2.6.32). Here is my main part of ...
2
votes
1answer
105 views

Bash shell launched by forkpty() spawns child processes that ignore SIGINT. Why and how do I ensure SIGINT is not ignored?

I have a C program that uses forkpty to execute a bash shell. I'm finding that the programs launched by this shell are launched with SIGINT ignored, so when I send a Ctrl-C to the shell they never ...
1
vote
1answer
217 views

How to determine which Berkeley DB version is used for RPM's database?

I am attempting to read and write the RPM database located in /var/lib/rpm under CentOS 5, and eventually other system types (CentOS 6, RHEL, etc.) The problem is that I don't know what version of ...
1
vote
1answer
442 views

How to trace process scheduling of certain process?

For a project at my university I am researching ways to trace, log and manipulate the process scheduling of certain processes. I would like to launch an number of applications, everyone in a single ...
0
votes
1answer
53 views

How does one establish SIGRTMIN at run-time?

Reading up on signal(7) I can see that now: two, but once: three; signal numbers past 31 are reserved for use by the Real-time signal system and should not be used: Real-time Signals Linux ...
0
votes
1answer
50 views

How do kthreads actually work?

Need to implement DHCP server in kernel space. It's supposed to be a multithreading server, and I think I should use kthreads ( I'll be glade if you know better decision ). However I can't understand ...
0
votes
1answer
35 views

openSSL Key and Certificate

As far I know, in an authenticated SSL connection, both the client and server have private keys and provide their certificates (with the corresponding public keys) across the connection before ...
3
votes
0answers
25 views

Linux application development and signal handling

Currently I am having problems with my users complaining about the termination of my application. Under some (seemingly arbitrary) conditions and desktop environments the app is not terminated and ...
2
votes
0answers
30 views

how to build kernel-tools-4.2.xx.rpm and kernel-ltools-libs-4.2.xx.rpm

I am trying to upgrade Centos-7 kernel (kernel-3.10) to (Kernel-4.2.6) and for that I downloaded kernel from kernel.org and create rpm for the custom configuration (arch x86_64)using "make rpm". ...
2
votes
0answers
45 views

Look up documentation on C types?

I'm reading over documentation on concurrency in C and trying to learn how to do things concurrently. As I'm reading, I'm coming across types I've never come across before like tss_t, etc. Is there ...
2
votes
0answers
57 views

How to remove a broken installation of glibc

I just attempted to install glibc version 2.19 to my computer as follows: 1) I cloned the glibc git repo with $ cd ~ $ git clone git://sourceware.org/git/glibc.git 2) I checked out version 2.19 ...
2
votes
0answers
125 views

Can I add iptables rule from the inside of a C Linux program only with capabilities or do I need necessarily root?

I need to add an iptables rule from the inside of a C Linux program. How should I do? Do I need root privilege or can I just grant some capabilities? I tried granting CAP_NET_RAW+iep and using ...
2
votes
0answers
70 views

Make GNU indent break long comments

Is there a way to convince GNU indent to break long comment and change it to multiline comment? Something like this: // Very long comment, longer than 80 characters. Just imagine that. To this: /* ...
2
votes
0answers
371 views

How can I compile minix when I make changes in libraries

I am looking for a way to compile minix. The make hdboot command seems to do nothing with the directories under /usr/src/lib. I changed only one .c file in syslib. Do I have to do make world for this ...
2
votes
0answers
121 views

Command-line file reader (like “less”) that can tell the line where the user stopped reading

[Context] I'm developing a little app, as a hobby to learn ncurses, that catalogs and lists and searches within a set of documents (for now, they are the HOWTOs from TLDP). The most tricky part of ...
1
vote
0answers
21 views

can two android devices in different network(3g) comunicate themselves with ssh connection?

I have two rooted android devices with different isp(i use different 3g connection for them) and created a double ssh connection(i can with a public ip server)comunicating both to this server(i have ...
1
vote
0answers
45 views

Is the (Free)BSD Codebase ANSI Compliant?

Google does not seem to shed any light on this topic - But the question is quite simple: Is the FreeBSD (Or any BSD) CodeBase ANSI (c89) Compliant, or does it use c99, c11 or non-standard features ...
1
vote
0answers
24 views

Unable to establish PPP on USB dongle?

I have USB Dongle and i am willing to setup ppp through the dongle. I have done following steps to setup ppp. 1.When i plugged the dongle into Ubuntu 14.04. It has been detected as the Mass ...
1
vote
0answers
163 views

Error building and compiling GCC 5.2.0 from scratch on Vortex86DX

In order to upgrade a VortexDX86 custom linux with a gcc 3.2.3 compiler, I´m trying to built the GCC 5.2.0 compiler to support the latest C++ 11 standard. I have downloaded its source code from ...
1
vote
0answers
157 views

How to get minor and major page fault for individual or group of processes?

I am trying to write a code in Linux C. Basically I am trying to draw a statistic that should show like: pid, number of process, page fault(major/minor) and total number of page faults. val, pid, ...
1
vote
0answers
6k views

Getting “cannot open shared object file: No such file or directory” error while run time

I have successfully compiled the file but now I am getting following errors export LD_LIBRARY_PATH=/opt/mcr/v717/sys/java/jre/glnxa64/jre/lib/amd64/server/:D_LIBRARY_PATH ./invoke ./invoke: error ...
1
vote
0answers
69 views

CPUFreq Kernel module

I would like to try the CPUFreq module on my board (Marvell Soc based on ARMv7 running a v3.15 linux kernel). My architecture is obviously not supported by the default source code (located in the ...
1
vote
0answers
95 views

Limit program execution to a list of arguments

I would like that my Unix users can only run a specific command insecurecommand with a controlled list of arguments stored in a file. The only solution I have found at this time is to : Create a ...
1
vote
0answers
482 views

How to cause memory fragmentation on a Linux based embedded device?

Hardware ARM What am I trying to do: Answer: I am trying to create memory fragmentation on a Linux 2.6.31 based swapless embedded device. Why: Answer:I am trying to port some patches to Linux ...
1
vote
0answers
375 views

mod_rewrite: undefined symbol: lstat error

I compiled the mod rewrite for apache (version 1.3.0) however, when I try to run the server I have this error about mod_rewrite: Syntax error on line 27 of /home/myuser/apache/etc/httpd.conf: Cannot ...
0
votes
0answers
15 views

Strange PFN read from pagemap

I m trying to find the physical page to which a range of virtual addresses are mapped in a piece of C code that I ve written. I m using the /proc/self/pagemap to read the mapping. I ve used the code ...
0
votes
0answers
14 views

Compile project with cmake for OpenBSD 5.9

I'm writing a shell and have compiled and run it with Ubuntu. It previously built and ran with OpenBSD 5.9 earlier, but now I get compiler error that I don't understand. $ make [ ...
0
votes
0answers
51 views

Where are the definitions for the prototype declarations in <bsd/stdlib.h>?

I have a C program on Ubuntu 16.04, in which I would like to use arc4random_uniform. typedef unsigned char u_char; #include <bsd/stdlib.h> int main () { return (int) arc4random_uniform(100); } ...
0
votes
0answers
22 views

Build location-independent GCC binaries

I have some problems with GCC. I want a portable version of GCC because the PC I use for programming cannot be connected to Internet due to some driver issues. So, I read an article on how to compile ...
0
votes
0answers
11 views

Error with libraries after setting up Code::blocks to work as an arduino IDE

First of all I apologize in advance if this is the wrong community, you're welcome to advise me another one to post. I followed this guide: ...
0
votes
0answers
11 views

Error occured with USB modem

I have MPC8309 Tower Board and connected USB Modem to it and then established Async PPP on Modem, now I started applying ping from different terminal from my laptop by applying nat commands and ...
0
votes
0answers
21 views

How to call a device's power management methods in another way than during suspend to ram?

Let us consider the e1000e driver for an Ethernet card. This driver provide two power management methods .suspend and .resume to respectively turn off and turn on the card. Those methods are naturally ...
0
votes
0answers
155 views

Building Handbrake on Debian Jessie

I have found a web site that explains how to install Handbrake 0.9.9 on Jessie. The explanations there seem a bit outdated, because it advises to use SVN to get the sources, but Handbrake has switched ...
0
votes
0answers
7 views

GDB not copying desired string (Buffer Overflow attempt)

Ok so I am trying to learn about buffer overflows and there is this simple program that is vulnerable of a BoF because it copies the first argument into a buffer of 5 characters. In the source code, ...
0
votes
0answers
22 views

openpty returning zero as master file descriptor

I am opening a pseudoterminal with openpty function. This will be used to redirect some data coming from a serial port into an external application (in this case, a GPS receiver). The fact is that ...
0
votes
0answers
25 views

Error libGL dlopen

I am starting learning SDL. I am reading a tutorial and it has this code: #include <SDL2/SDL.h> int main( int argc, char* args[] ) { SDL_Init(SDL_INIT_VIDEO); return 0; } And when ...
0
votes
0answers
44 views

custom runtime environment - libpthread segmentation fault

I have built a project using gcc 4.9.2 (libstdc++.so.6.0.20). When I want to run that program on the virtual machine which is equipped with gcc 4.6.3 (libstdc++.so.6.0.16) I have to deliver ...
0
votes
0answers
98 views

system user + kernel time using /proc/stat

user: normal processes executing in user mode nice: niced processes executing in user mode system: processes executing in kernel mode idle: twiddling thumbs iowait: waiting for I/O to complete irq: ...
0
votes
0answers
42 views

Find system idle time using any system call in microseconds

For the perf analysis and to make decision based on system and app performance I need to find the idle time of system. I want the precise value in microseconds. I know that I can get the value in ...
0
votes
0answers
134 views

Calling a password checking command from PHP using exec() - how to escape user input?

I am working on a PHP-based website where the login form needs to authenticate against local users on the system via PAM - in other words, they should be able to login successfully if they enter a ...
0
votes
0answers
85 views

How do I send a variable through SSH so it can be used across servers? C Shell

EDIT: Would this be possible in bash? Note: I have to use C shell. (.csh) I have something very similar to the following code: set var = "string" ssh -X server "$var" << END * I ...
0
votes
0answers
211 views

Incorporating GTK into Eclipse

I do not understand what is missing here when incorporating gtk2 into eclipse . First - I know I have the devs installed since I have already successfully compiled an gtk-app through a makefile. gcc ...
0
votes
0answers
163 views

custom gcc install include files

I have a custom installation of g++ 4.8.1 in my home directory. However the include files in that installation have no extensions! (except for tgmath.h, fenv.h, complex.h, and cxxabi.h) Thus even if ...
0
votes
0answers
150 views

I can fix/repair small damaged tar.gz files using fixgz but it doesn't work on bigger files

The title tells it. I have some damaged .tar.gz files, most of them are pretty small (smaller than 1-2gb) but 4 of them are bigger and fixgz cant fix them, when i run fixgz for those big files, it ...
0
votes
0answers
362 views

how to increase Stack Size of a running program in C

I am trying to identify any way if we can increase the stack size of my running program after getting SIGSEGV. I know we can increase the size of stack by ulimit -c but, that did not solve this ...
0
votes
0answers
112 views

keyboard still working after calling free_irq(1, NULL);

I'm developing a kernel module which free the IRQ number 1 in order to disable the keyboard in Intel architectures. according to wikipedia the IRQ 1 is used for keyboard. but after building and ...
0
votes
0answers
3k views

GTK3+ and C++ on OSX - “No GSettings schemas are installed” error

I'm trying to run a C++ example with GTK3+ and GStreamer components on OSX. I can gcc compile the source with: gcc -o basic5 basic-tutorial-5.c 'pkg-config --libs --cflags gstreamer-1.0 ...
0
votes
0answers
414 views

network device module equivalent to ping

I have made a module which is transmitting but I don't know whether the packet which I am transmitting is a ping packet or not. Code is shown below: icmp.type = 8; icmp.code = 0; ...
-1
votes
0answers
10 views

Socket test failed on Tru64 v4.0

I need to use sockets on DEC Unix v4.0 to run a client-server app. When I run my app I get an error that says "socket not open or closed" After that error I am going to go to test socket. I ...