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

8
votes
4answers
724 views

What is meant by “a system call” if not the implementation in the programing language?

I would like to understand the term "system call". I am familiar that system calls are used to get kernel services from a userspace application. The part i need clarification with is the difference ...
1
vote
1answer
22 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
0answers
57 views

Why did Dennis Ritchie say “be a pointer my friend”? [closed]

Dennis Ritchie once said: Empty your memory. with a free(); like a pointer If you cast a pointer to a integer, it becomes the integer. If you cast a pointer to a struct, it becomes the ...
1
vote
0answers
17 views

How to get the authentication status from the last PAM module run

If I have the following PAM stack: auth required default_pam.so auth requisite my_custom_pam.so .... How do you obtain the authentication status from the last/previous PAM module run for use in ...
0
votes
0answers
10 views

How do I run TinyWM inside Xephyr?

I'm trying to get into Window Manager hacking, so I found TinyWM and tried running it inside a Xephyr window. I tried: Xephyr -screen 1024x768 :1 & DISPLAY=:1 ./tinywm & DISPLAY=:1 scite ...
-1
votes
0answers
15 views

Use fts(3) functions to rename files and directories. only first level gets changed [migrated]

it's just a simple prog to replace spaces with underscores. i found a bash script that will do it but it's slow. from what i understand i want a depth-first search and i want my remove_space function ...
0
votes
1answer
22 views

Error: Missing newline before EOF - inserted

In my application I am inserting some files in main file. In that there is common header file to all the code files (*.c). This giving me error: D:\New folder\COM_Port_Cont\COM_Port_Task.h(268) : ...
9
votes
6answers
590 views

What C library version does my system use?

How can I tell for sure what userland C library my system uses? Possible reasons to need this information include: There's a gigantic source package I am considering downloading which I'm sure will ...
0
votes
1answer
56 views

libext2fs gcc linking error

I am writing a C program which uses libext2fs: #include <ext2fs/ext2fs.h> int main(int argc, char *argv[]) { char *fsname = argv[1]; errcode_t err; ext2_filsys fs; err= ...
4
votes
3answers
349 views

Are there “esoteric” (weird) but standards-compliant C compilers or runtimes?

As we know, the C standard does not specify a lot of details of the implementation, for example value of NULL pointer, order of bits and bytes (endiannes), alignment in structs and of stack ...
0
votes
0answers
54 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
2answers
81 views

Writing own daemon. systemd error: Failed to read PID from file: Invalid argument

I'm trying to write own daemon a la very simple MPD (it's operating systems laboratory work). I made it work: it starts like a daemon (output of ps): 1 14877 14877 14877 ? -1 Ss 0 ...
2
votes
1answer
26 views

Can you use LXC through C?

I want to use LXC to 'container' plugins my application is loading. Am I able to do this through C? I have been Googling a lot about it, but there don't seem to be any headers, only scripts that can ...
3
votes
1answer
73 views

How to let a user execute a script owned by root? Setuid doesn't seem to work anymore [duplicate]

I have some bash scripts that I use with the user 'root' to manage iptable rules. The problem is that I want these things at the same time: The script must be owned by root Permissions must be 700 ...
-2
votes
1answer
51 views

How to compile c, c++ and python code as “Released/Final” version? [closed]

I want to know if there are ways to compile C, C++ and Python code in order to not be able to reverse engineering it over Linux or not? I have heard there are some ways over Windows to do it, but I ...
7
votes
7answers
737 views

Possible to find out the sizes of data types (int, float, double, …) on a system, without writing a C program?

Is it possible to find out the sizes of data types (int, float, double, ...) on a Linux system, without writing a C program? Would the results for C same as for C++, and other programming languages ...
0
votes
0answers
55 views

Reading from named pipe freezes when piping tshark output

I'm trying to implement a web prefetching system. The purpose of a system like this is to “predict” future requests and prefetch them. The system builds a predictive model from web navigation logs ...
2
votes
0answers
55 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 ...
0
votes
3answers
85 views

In makefile when do we use .o files?

In the following make file, what is the significance of adding .o files instead of .c files? CC=gcc CFLAGS=-I. hellomake: hellomake.o hellofunc.o $(CC) -o hellomake hellomake.o hellofunc.o ...
5
votes
2answers
332 views

What would I get when sudo a kernel-destructive program?

It suddenly comes to me how easy it will be for a sudoer to crash the kernel, so I tried something like this: #include<stdio.h> int main(){ printf("hello world"); int a; ...
2
votes
1answer
366 views

Error compiling FTDI VCP drivers: Cannot find version.h

driver installation fails of FTDI VCP driver during make install. Running ElementaryOS with kernel 3.11.0-14-generic make install awk: cannot open ...
2
votes
0answers
92 views

Writing to Arbitrary Memory Addresses [closed]

I'm reading "Art of Exploitation 2nd Ed." and I have a question regarding a section on format string attacks. Target program Below code (fmt_vuln.c) is a target program. #include <stdio.h> ...
0
votes
0answers
37 views

How to `cat` file with syntax highlight? [duplicate]

In my hello.c: /* Hello World program */ #include main() { printf("Hello World"); } How can i cat this file on terminal with syntax highlight?
1
vote
3answers
107 views

Is there any manual about C in Linux? If any, what is it?

While I find that we can read some manuals about Library calls (C library functions) & acsii in Linux. But I still do not find any manual about C precedence order so far. So you can recommend ...
2
votes
2answers
105 views

How to make processes not die after its parent dies?

I've been messing with forkbombs and noticed that if I just fork() processes repeatedly, killing the initial process will bring down the whole tree. This is not the case for forkbombs written in BASH ...
3
votes
2answers
85 views

How to write software to compile with external libraries?

I want to code open source software with dependencies. I have skills in C/C++ and a minimum makefile knowledge. But im curious about coding this like ./configure && make stuff and how to ...
2
votes
1answer
796 views

Start 4 programs on startup in Linux Mint via terminal

I'm working on a project and I hope you can help me solve a problem. I have four programs that are written in C. They have been compiled using gcc and they work as they should. Because the four ...
0
votes
1answer
81 views

C-library HMAC_MD5 questions

We are working with an older software product that has some limited programming capabilities - specifically, no bit manipulation functions. This has created a significant problem as we need to ...
0
votes
1answer
107 views

Read and parse XML input via TCP [closed]

I'm setting up something where I'll need to be able to setup a service that accepts input on a TCP port and then parses the XML provided and extracts the necessary data, then posts that to Google's ...
5
votes
1answer
376 views

command substitution handling in fish vs. other shells (sh, bash, zsh)

The program mc (Midnight Commander) is not intended to be used for command substitution, but I would like to know why different shells behave differently when this program (and it seems like other ...
2
votes
2answers
504 views

Why does Linux have a C compiler by default?

Why does a Linux distribution have gcc installed in advance? Is it because most of the applications in linux are written in C? What would happen if the gcc directory is deleted?
1
vote
1answer
115 views

Parsing protocol and url from packet payload

We are using pf_ring to capture packets. We are able to decipher information like source and destination ip, mac etc from the header information. Now we are moving into payload to decide the type of ...
3
votes
0answers
131 views

Fork vs. thread system time [closed]

I got the following logs: Program 1: Taken from a program executed 64 fork calls: real 0m0.023s user 0m0.068s sys 0m0.008s Program 2: Taken from a program executed 64 thread calls: real 0m0.613s ...
2
votes
1answer
142 views

Dependencies problem with automake

I am using automake on Debian Squeeze for compiling a very simple C project with 6 source files. The issue comes when I try to compile the sources using the generated Makefile. One of the sources ...
10
votes
2answers
205 views

Is there a way to mirror USB outputs?

I'm currently writing a program for a project. It is for a braille reading system where I have a braille display connected via USB that is controlled by a program called brltty. One of the ...
1
vote
1answer
128 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 ...
4
votes
4answers
519 views

Is it possible to make multi-level directory? [duplicate]

Using mkdir() (the C function) I can create a 1-level directory, if I want to create multi_level directory like: folder/subfolder/subsubfolder is it possible? if so, how?
4
votes
1answer
124 views

Effect of static and dynamic linking on start address

I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: ...
3
votes
3answers
325 views

default wordsize in UNIX/Linux

I was inspecting the preprocessed output of my C program and happened to look at the header file wordsize.h It is located in /usr/include/i386-linux-gnu/bits/wordsize.h the file contains only one ...
4
votes
1answer
85 views

Portions of the file Header

I was working through my C programs, I am new to Linux/UNIX development and was having a look around. I created a simple C program of Hello world and was inspecting the compilation process. I tried ...
1
vote
4answers
2k views

I can not get my Realtek 8723 driver source compiled

I have a Lenovo IdeaPad Yoga 13. WLAN won't work out of box with fedora 18. So I googled around and found this 2 links: ...
-3
votes
2answers
187 views

Using file system call

I'm trying to learn system calls for open,write and close a file. I use this sample and the result is: gcc: error trying to exec 'cc1plus': execvp: No such file or directory Here's my program: ...
0
votes
1answer
126 views

Understanding a XINU system call - getstk.c [closed]

I am having trouble conceptually understanding what is going on towards the end of this system call, and why. I understand the getstk.c method returns the highest memory address of available space, ...
2
votes
2answers
258 views

Why read() is slower than getc()? [closed]

Why is read slower than getc? For example, this: for (;;) { chr++; amr=read(file1, &wc1, 1); amr2=read(file2, &wc2, 1); if (wc1 == wc2) { if ...
1
vote
2answers
264 views

Monitoring script started by rc.local

We have a C program which is started using rc.local´. We added a line like this: /usr/local/bin/pc to the rc.local file. pc is a compiled C program. Everything is working fine at the moment. What ...
0
votes
1answer
219 views

USB-Serial Driver(Exar Xr21v1414) Run Error

I'm currently trying to run the bellow driver in linux-3.8.3 on Exar xr21v1414 http://www.exar.com/connectivity/uart-and-bridging-solutions/usb-uarts/xr21v1410, but when i install the driver ...
1
vote
1answer
129 views

How to explicitly load shell interpreter in a C program

I want to create an executable script which is not readable/writable However since an interpreter needs to read this file it is not possible to do so directly. Therefore I wanted to know if I could ...
0
votes
1answer
56 views

Can a GTK applet widget be instantiated through dbus?

I just posted this: #274616: “Simple” gnome applets in Unity - stickynotes ... where I could instantiate a Gnome 2 bonobo applet in a standalone window, ... using ...
-1
votes
2answers
82 views

Why rsh not opens and reads PAM modules and limits.conf?

I am working on a project, that uses rsh utility for remote connection. But my project needs some extra features for that, so I add that features. Till now, all the things are going fine. But when I ...
3
votes
1answer
145 views

Make Completion Progress Script

Any time I'm executing a build process that takes several hours, I inevitably stare at my terminal and wonder, "how much longer?" Sometimes, I manually pick up on some pathname echoed to the terminal ...