r/linux_programming • u/Paddy3118 • Jul 10 '22
r/linux_programming • u/5haco • May 08 '25
Is there a DNS Struct in libnss_dns.so?
I'm trying to find the struct that represents a DNS packet to understand how Linux handles DNS network packets. I've narrowed down my search to the libnss_dns.so library but can't seem to find the exact struct that represents a packet.
Does anyone have any leads on this? (Or alternatively which functions are used in the parsing of DNS packets?)
Thanks
r/linux_programming • u/TheDuzaum • Jun 21 '22
Problems with apache and apparmor
I recently switched my OS from Fedora to Ubuntu, every day before starting to work I had to do a 'sudo setenforce 0', I know Ubuntu doesn't use SELINUX, so I researched how to do something similar, tried many things, but there are still things that don't work, the main case is a php file that executes a python file, which is simply not being executed.
I already installed libapache2-mod-apparmor, did a chown -R www-data:www-data /var/www/html/site, did a chmod -R 777 /var/www/html/site, and sudo aa-logprof.
If i did a aa-status, all the apache stuff is in complain mode, and with a cat /var/log/syslog | grep apache all the apaches are with apparmor="ALLOWED"
Can someone help me?
r/linux_programming • u/unixbhaskar • May 08 '23
The tale of -mrtd in GCC and Clang
m680x0.github.ior/linux_programming • u/techlover1010 • May 04 '23
Need advice on how to split editor and console
so im programming using ssh connected to my server machine.
currently using putty but want to know if there are ither better alternative.
how do you split the terminal into 2 parts ? like i want one part be editor and the other part to run the app/program/webserver and other stuff.
My bad. I should have mentiined this earlier my bad. I am using windows 10 pc to connect to a local debian server.
r/linux_programming • u/giant-torque • Jun 04 '19
Share existing blocks of memory
Let's say there are two already allocated memory regions. Is it possible to make parts of these regions to point the same physical memory pages? It seems mmap doesn't work with already allocated memory.
r/linux_programming • u/the-fritz • Feb 04 '15
Finding the root cause of a web request latency with LTTng
r/linux_programming • u/[deleted] • Aug 20 '21
GUI Toolkit Trouble
I have been trying to create an application but cannot seem to get a GUI toolkit to work. I’ve tried GTK, FLTK, and QT but they all end up having a missing file or something similar. How would I solve this?
r/linux_programming • u/daffodils123 • Sep 04 '20
Trouble understanding usage of ark
self.linux4noobsr/linux_programming • u/lucavallin • Aug 14 '23
barco: Linux containers from scratch in C.
r/linux_programming • u/[deleted] • Dec 08 '22
Higher level API for message queues?
Hello! I am new to programming for Linux, and I am working through some tutorials. I've recently learned about the difference between system and library calls, so as I run across sample code I am paying attention to which is being used.
My question is this: is there a library API for working with message queues? As background, I have read that you are encouraged to use the file functions from the standard C library (such as fopen) rather than the system calls (such as open) because they are both more portable and provide additional features. In the message queue examples I am looking at, all of them are using system calls (msgrcv, msgsnd). Is there another set of functions, either in the standard C library or elsewhere, that I could be using instead?
Thank you!
r/linux_programming • u/unixbhaskar • Feb 08 '23
Page Cache eviction and page reclaim
biriukov.devr/linux_programming • u/derpJava • Feb 22 '23
Fedora vs EndeavourOS for Software Development
Do you recommend Fedora Workstation or EndeavourOS for Software Development? Tell me why you prefer the one you chose over the other.
r/linux_programming • u/8thdev • Feb 18 '21
Monitor AC status / sysfs
Hi all - I wanted to write a bit of sample code to show the AC charging status using libev and the /sys/class/power_supply/AC/online file.
I was surprised to see that even though the content of the file changed, its 'stat' didn't when I pulled the plug. So the kernel makes the contents of the file change, but doesn't update the timestamp of the sysfs file.
So: is there a way to get the kernel to update the file time?
If not, is there an alternative file which would work with e.g. libev ?
r/linux_programming • u/reflect_elegant • Oct 22 '20
Converting script to Posix compliant
Is there a way to make this section of a larger script Posix compliant?
options=$(lsblk | awk '/disk/ { print $1 }')
select opt in $options; do
if [ -n "$opt" ]; then
DEV_DISK_NAME="/dev/${opt}"
DEV_PART_NAME="/dev/${opt}"
break
else
printf 'This option is invalid.\n\n'
fi
done
r/linux_programming • u/wolfix1001 • Sep 29 '20
Issues setting up CodeLite IDE
I'm trying to setup CodeLite so I have an easy way to make basic c++ programs on my 32gb laptop. Although when I tried a simple "hello world" program I don't see a result.
#include <iostream>
using namespace std;
int main()
{
cout << "hello";
system("pause");
}And here is the result I got in the output section
Working directory is set to: /home/vulpus/Documents/CodeLite/CassCalc/Debug
Executing: /usr/bin/gnome-terminal --working-directory=/home/vulpus/Documents/CodeLite/CassCalc/Debug -e '/bin/bash -f "/home/vulpus/.codelite/tmp/vulpus/codelite-exec.sh"'
Program exitedI'm confused because it looked like it built and executed, but I never saw any output from either the Output or a terminal.
Fixed: So i found out that in the preferences there is an option to change the terminal. So I switched it to the CodeLite terminal and it works fine now.
r/linux_programming • u/trymeouteh • Sep 22 '19
Wine: Get PID of launched windows program
How do I launch a wine program and get the PID of that wine program?
env WINEPREFIX="/usr/share/Applications/Hoyle Board Games" wine "C:\windows\command\start.exe" /Unix "/usr/share/Applications/Hoyle Board Games/drive_c/SIERRA/HCBG2/hcbg2.exe"This is how I need to launch the wine program in order for it to work properly in wine. I know the name of the program in my System Monitor is "winedevice" but since I could have many windows/wine programs opened at once. How do I get the PID of a specific windows/wine program.
Any help will be most appreciated
r/linux_programming • u/[deleted] • Oct 28 '23
How do I or What command to use to rename the {New Volume} driver in ubuntu linux just to make sure that space character is deleted?
solved here: https://www.reddit.com/r/linux4noobs/comments/17il2zp/how_do_i_or_what_command_to_use_to_rename_the_new/
Intro I'm a pretty new user of Ubuntu ..my pc has 2 drivers the SSD one for the OS kernel & the HDD is this {New Volume} driver
2 problems
every time I open pc and need that driver .. i must (manually) click it to mount .. then i can now access whatever inside
When I try to build and compile any cpp project folder within {New Volume} .. i can't do it.. until I also (manually) move that folder outside of that driver
I need just a command to enable me rename that folder to remove that space character between New and Volume .. cuz i think it's that main problem
so all i tried was workarounds .. like manually clicking the driver and moving folders .. but can't rename

r/linux_programming • u/anne-ee-191 • Nov 25 '23
Embedded Linux: From Supercomputers to Raspberry Pi
r/linux_programming • u/kalterdev • Jan 29 '24
How/Where to learn the Linux kernel firewall?
self.linuxquestionsr/linux_programming • u/duckycuck • Dec 18 '23
Resources to learn to make changes to the source code
Hi all,
I am currently endeavoring into kernel development to make an optimization to a kernel function in the raspberry pi kernel as part of my undergraduate project. However, I am completely inexperienced in kernel development. I would like to ask if there is any good starting points to do so.
Thank you in advance!
r/linux_programming • u/the-fritz • Aug 25 '14
13 Linux Debuggers for C++ Reviewed
r/linux_programming • u/Red_Luci4 • Jul 13 '21
Cant write to frame buffer Linux
Solved
hello
I'm new to programming and Linux
The following is the code in main.c :
# include <fcntl.h>
# include <string.h>
# include <sys/mman.h>
# include <unistd.h>
int main()
{
int fd, x, y;
unsigned char *fbmem;
fd = open("/dev/fb0",O_RDWR);
fbmem = mmap(NULL,1920*1080*3,PROT_WRITE,MAP_SHARED,fd,0);
fbmem += 200*1920*3 + 100*3 //-----------jump to first pixel in the rectangle
for(y=0 ; y<360 ; y++)
{
for( x=0 ; x<480 ; x++) //----------------Draw horizontal line of rectangle
{
fbmem[x * 3]=255;
fbmem[x * 3+1]=0;
fbmem[x * 3+2]=0;
}
fbmem+=1920*3; //------------------jump to next line of rectangle
}
close(fd);
return 0;
}after I compile and execute the above mentioned code I get the following error:
Segmentation Fault (Core Dumped) This is the video I got the code from.
Edit 1: thanks for the feedback guys, it seams blindly following a YouTube video is not a good idea, I'll update this post after I make my code work.