Skip to main content

Questions tagged [c]

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.

0 votes
1 answer
87 views

I am new to socket programming & I have realized that most posix functions from libc require that you pass a buffer & a length. While I can understand this helps the functions to understand ...
Weezy's user avatar
  • 681
1 vote
1 answer
48 views

I'm trying to compile the drm-subtree of JSM because I want to enable the panfrost driver on the RockPro64 / KHADAS EDGE-V / RK3399. The code is here: https://github.com/jsm222/drm-subtree He improved ...
john_connor's user avatar
2 votes
1 answer
173 views

When using the set -e flag in Bash, then it's difficult to get user-friendly error messages (a stack trace) and it's difficult to add cleanup code that executes before your script exits with an error ...
user3207874's user avatar
0 votes
1 answer
177 views

So I am designing a feature to redirect log file if there are multiple processes of this very program are running. I guess this requires me to somehow get to know whether there exists yet unfinished ...
PkDrew's user avatar
  • 111
1 vote
1 answer
149 views

Assume the following C snippet showing a piece of error handling: #include <sysexits.h> #include <stdio.h> … int main(int argc, char argv*[]) { int retval=0; … if(3!=argc) { /* wrong ...
AlMa0r's user avatar
  • 1
26 votes
3 answers
2k views

The 'gmtime()' standard library function returns a struct that has days numbered 1-31, but months numbered 0-11. Why is that? Presumably there is some historic reason?
7 votes
1 answer
576 views

Are there any lists compiled that provide a list of linux system calls used per function in a standard glibc build? For example, free() requires mmap, munmap, mprotect, prlimit64, and brk. If ...
user30972097's user avatar
2 votes
2 answers
154 views

I’m trying to write a C wrapper to run a bash process. The goal of this wrapper is to apply a seccomp policy to restrict certain syscalls. Here is the code: #define _GNU_SOURCE #include <stdio.h>...
Liric Ramer's user avatar
0 votes
0 answers
126 views

We are two FreeBSD lovers and a stubborn system administrators. We are trying to project a phone based on FreeBSD for several months. Emanuel Vadot and Jesper Schmitz Mouridsen have enabled the ...
mister_smith's user avatar
0 votes
2 answers
160 views

If I open a fifo for reading+writing in blocking mode: fd = open("foo", "O_RDWR"); Then it blocks until someone on the other end opens it for either reading or writing. But how do ...
Ariel's user avatar
  • 117
0 votes
0 answers
76 views

Trying to move a window by grip-able button. On 2 other window managers, and no manager it works fine. Windows move anywhere you want pass display edge bounds. On GNOME Shell and Mutter(Gala) the ...
user748603's user avatar
0 votes
1 answer
79 views

I am testing FTRACE in Linux VM (ubuntu 24.04) the kernel is Linux VirtualBox 6.11.0-26-generic. I wrote a kernel module to register a hook (probe) to kernel tracepoint of signal_generate, here is the ...
wangt13's user avatar
  • 651
0 votes
2 answers
100 views

According to The Open Group Base Specifications Issue 8, on the rationale of the open() and openat() functions: The purpose of the openat() function is to enable opening files in directories other ...
Salubia's user avatar
0 votes
1 answer
96 views

I am working on a process that forks several times. To debug it, I am using a debug file for which I open a fd and which stays the same for all child forks. Then I have a function print_debug, that ...
Bastian's user avatar
  • 25
0 votes
0 answers
69 views

As a way to better understand Linux kernel structures, interacting with and pulling information from these (and also getting more experience coding in C), I've been building simple kernel modules to ...
genericuser99's user avatar

15 30 50 per page
1
2 3 4 5
59