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

6
votes
1answer
51 views

Get header of the C function from BASH

I want to get the header(s) that I need for a given C function - e.g. when I want to see what to include when I want to use fork(), I can type out man fork and see that it's #include <unistd.h>. ...
5
votes
1answer
2k 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
62 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
85 views

mount overlayFS as Read-Write FS

I want to mount my RO Filesystem using overlayFS - in order to use two layers FS (Lowerdir and Upperdir). I tried the following mounting command - mount -t overlayfs -o lowerdir=/,upperdir=/overlay ...
1
vote
1answer
683 views

Cannot find -lgcc

I'm trying to compile my next basic c program after hello-world. This contains two supporting modules. I have Ubuntu running in a VM through VirtualBox on a mac. Everything is up to date but I ...
1
vote
1answer
391 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
33 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
20 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 ...
0
votes
1answer
26 views

Server port doenst go back to listen and is in closed_wait state , because of starting an daemon application from client

Below is the basic client and server code . While iam trying to start an appliaction(which has to keep running in the machine once we send a msg to server) during connect call. using ...
0
votes
1answer
19 views

segmentation fault/ not booting main from rcS

I'm trying to boot a 'main' executable from the rcS file /soft/main & 2>&1 >> /var/log/app.log & but I'm getting a segmentation fault witch is strange because when i cd to the application ...
0
votes
1answer
230 views

convert executable back to C source code

Unfortunately I lost my source code and I just have the output file that made with gcc in linux and I don’t have any access to my pc now.is there any way to convert output file to source file (in c ...
0
votes
1answer
148 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 ...
0
votes
1answer
74 views

What happens to TCP when a write fails to enqueue with the device tx ring?

Lets say the device tx ring is full and you do a normal C non blocking write(fd, buff) to enqueue data in the TCP SND buffer. What happens when this fails? In UDP - the packet would be dropped but ...
0
votes
1answer
189 views

Trying to make a Universal Makefile

I'm working on my own netfilter module for the first time. According to internet documentation, The simplest module contains the following C code: //'Hello World' kernel module, logs call to ...
0
votes
1answer
106 views

how to define the top dir in automake system?

I usually use a typical steps to generate the makefile, and firstly I use the "build.sh init" to generate the configure file, and then I use "configure" to generate the makefile with makefile.am file. ...
0
votes
1answer
277 views

Difference between maximum resident set size as reported by /usr/bin/time vs. getrusage?

I ran the command a.out like this: $ /usr/bin/time -f"%M" ./a.out a.out also uses the function getrusage() and prints: printf("%ld",ru.ru_maxrss); where the first ru is the struct. When I run ...
0
votes
1answer
170 views

Compile OS with gcc and ld on Linux

I'm practicing operating system development and am having trouble getting gcc and ld to produce pure binary without any metadata or section labels. For example: int function(){ return 100;} would ...
2
votes
0answers
17 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
43 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
44 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
85 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
63 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
338 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
116 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
138 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
129 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
5k 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
59 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
91 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
426 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
350 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

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
16 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
30 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
65 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
37 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
83 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
65 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
135 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
125 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
109 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
278 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
92 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
2k 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
399 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; ...