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

2
votes
0answers
19 views

Is ranlib efficient for small libraries?

I understand how ranlib works but does using it on small libraries make them less efficient than not using it?
1
vote
0answers
20 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 ...
0
votes
0answers
14 views

Eclipse lint plugin for C language on Linux?

Can anybody suggest a best Eclipse lint plugin for C code? My C code has a dependency on glib. The lint plugin should be able to identify glib macros too.
3
votes
0answers
16 views

In ubuntu, I cannot send two-byte commands over a usb serial port from within a C program [migrated]

I wish to write in C or C++ a program to control a Sony camera connected over a USB serial device (Applied Logic USB to LANC [0600]) running on my Virtual Box guest OS, Ubuntu 12.04. Through putty, I ...
5
votes
4answers
455 views

chdir(<directory>) doesn't change directory after exiting to shell

I wanted to make a simple C program to change to my project directory. Its content is following: #include <unistd.h> int main(){ chdir("/home/enedil/projects/algo"); return 0; } I ...
0
votes
1answer
44 views

What are the disadvantages of uClibc?

I try to speed up my boot sequence, and somebody recommends to use the uClibc instead of Glibc. I've built an image with it, it gets smaller and faster to boot — but at which cost? Does anyone know ...
3
votes
1answer
77 views

How to programmatically retrieve the GID of a running process

I need to write some C code to check the effective GID of a running process whose PID I know. I've not found any direct way to do this. There are a number of heavyweight kludges I could use, such as ...
2
votes
0answers
43 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 ...
1
vote
0answers
59 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 ...
0
votes
0answers
38 views

Copy stdout contents to a file in command line mode [migrated]

I have a program like this. I am in terminal mode. I want to copy the outptu contents to another file. First I tried redirecting, but it didnt work due to buffering. Then i tried unbuffer command. But ...
0
votes
0answers
73 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 ...
2
votes
2answers
109 views

How does a parallelized Python program look with top command?

I work on a shared cluster. I've seen people run parallelized c code on this cluster which, when I use top to see what processes are running, are shown to be using (for example) 400% of the CPU, ...
0
votes
1answer
66 views

How to develop a GUI app in linux which can run without x window system?

While developing a GUI app in Linux, in most time, those app are using gtk or qt lib, they can only be run in the X window system and will not work in text mode. I want to develop a movie player which ...
2
votes
2answers
55 views

What is bitwise.c~? [duplicate]

I am new to Linux Debian and I am trying to made a program to experiment bitwise operators. The name of the program is bitwise.c Before compiling the program, I decided to look at the directory just ...
2
votes
1answer
69 views

closing the unwanted file descriptors

I am trying to understand how pipes work . This code snippet is from some website . So my understanding of the program goes like this : When we do pipe(fd) then fd[0]=3 and fd[0]=4 ( assuming only ...
3
votes
1answer
50 views

Is each process considered a thread?

Is a Linux process considered a thread? For example, if I write a simple c program that calls pthread_create to create a new thread in main(), does that mean that I now have 2 threads, one for ...
3
votes
0answers
79 views

How do I use ctags functionality in vim with cscope installed?

When I install cscope by adding the line Bundle 'chazy/cscope_maps to my .vimrc file, my tags menu (g+[) is replaced with a cscope list, which seems to contain a list of files where the tag is called, ...
1
vote
1answer
300 views

Default stack size for pthreads

As I understand the default stack size for a pthread on linux is 16K. I am getting strange sesults on my 64bit ubuntu install. $ ulimit -s 8192 Also pthread_attr_init(&attr); ...
0
votes
1answer
29 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 ...
1
vote
0answers
45 views

how to get user's last login including the year in C [closed]

I'm trying to write a program that can get the user's last login time. Then i want to do something with the data. eg. check which user havent login for 90 days. So I tried using last command. This ...
9
votes
5answers
1k 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
149 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 ...
1
vote
0answers
27 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
84 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 ...
0
votes
1answer
46 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) : ...
10
votes
6answers
914 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
74 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
361 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
74 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
249 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
47 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
168 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
62 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
981 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
106 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
86 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
100 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
340 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
580 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
125 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
111 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
160 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
97 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
1k 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
90 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
137 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
432 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 ...
3
votes
2answers
566 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
145 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 ...