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.

-1 votes
1 answer
53 views

Status bar in a C program

I need to incorporate a "status bar" into one of my programs. Basically, it looks like this: +----------------------------------------+ | | ...
ignatius's user avatar
  • 399
0 votes
0 answers
14 views

Cannot find mqic library when compiling Mqueue-sending C program

On our linux dev server for an application at work, we have an in-house C program called sendFile to, well, send files to the Mqueue. The program has seemingly not been changed since its creation in ...
Gael L's user avatar
  • 131
0 votes
1 answer
34 views

setuid not working with C code and system() call

I have NICE-DCV installed in RHEL-8.10 and as root doing a dcv list-sessions shows all sessions on the system. But if a user does dcv list-sessions then the output from that is only their session ...
ron's user avatar
  • 7,453
0 votes
1 answer
51 views

Implement UDP packets filtering in C

I have a question on how to setup the filtering as described in the following scenario: I see that systemd-resolved listens on port 53 and sends all the DNS requests to the real DNS resolvers. I am ...
Andrei Glingeanu's user avatar
3 votes
2 answers
272 views

shell script to match a function in a file and replace it with another function in another file

I have files that contains multiple functions like below. file1.c: static void function1() { code } ... static void functionX() { code } ... static void lastFunction() { code } file2.c: ...
aWLW's user avatar
  • 133
1 vote
0 answers
41 views

Arch Linux version & headers package don't line up

I'm trying to write a kernel module in C on ArchLinux. Installing the linux-headers package gives me the version 6.10.5-arch1-1 but running uname -r returns 6.10.5-arch2-1 How can I install the ones ...
KtheVeg's user avatar
  • 183
1 vote
0 answers
63 views

Waking Qemu From Suspend With USB Device

I am doing research with Linux Power Management interactions with USB devices. Which is why I would like to be able to wake a qemu vm from suspend with a passed through USB device. I have been able to ...
Darrion Ramos's user avatar
1 vote
1 answer
67 views

Gedit Bracket match is out of range

Gedit matches brackets like { with } and tells us where the matching opening/closing bracket is. If it is more than 10000 characters, it says "Bracket match is out of range" instead. How ...
Some Student's user avatar
3 votes
2 answers
108 views

Is it possible for SIGALRM to be delivered after setitimer() disables the timer?

I have some code like this that has failed once on CI and once locally, though I cannot reproduce it reliably. The code is like this: #include <stddef.h> #include <signal.h> #include <...
Tavian Barnes's user avatar
2 votes
2 answers
2k views

Why is off_t signed?

On my journey to create a 16 EiB sized file, I encountered the following issue: POSIX defines files to have their size represented using type off_t, and that "blkcnt_t and off_t shall be signed ...
Semnodime's user avatar
  • 377
8 votes
1 answer
1k views

Does mtrace() still work in modern distros?

tldr: Does mtrace still work or am I just doing it wrong? I was attempting to use mtrace and have been unable to get it to write data to a file. I followed the instructions in man 3 mtrace: t_mtrace.c:...
TopherIsSwell's user avatar
0 votes
0 answers
48 views

File descriptors get corrupted when program runs in background

I have written a program for an embedded Linux system(petalinux). It runs fine when started from the terminal or TCF debugger. However, I want it to run when the system starts, so I use the start-stop-...
user3219624's user avatar
1 vote
1 answer
202 views

Where do i trace NVME IO within the Linux driver?

I want to write a small Linux driver extension. More specific: I want to write all the communication between the host and a M.2-nvme-ssd into a userspace file. The nvme driver is pretty big though and ...
led's user avatar
  • 13
0 votes
0 answers
29 views

Does bash explicitly allow commands like passwd, su, etc., to run in setuid while disabling other custom binaries? [duplicate]

I know that /bin/bash has certain built-in protections that prevent the abuse of the Set-UID mechanism. So if I create a custom binary and execute it, it won't run with SUID 0 (refer the below image). ...
yellowspectre's user avatar
0 votes
0 answers
124 views

How to keep a shell alive after it gets started from inside a program?

I was not sure where to ask this question, since it is a mix of both programming and Linux, but hopefully this is the right place. I have written a simple program, which I'm buffer overflowing. I have ...
r3k0j's user avatar
  • 15

15 30 50 per page
1
2 3 4 5
58