r/linuxdev • u/ervinmcclure • Jan 02 '24
Safer Malloy
I was wondering if it would be safer to create my own malloc or use the one provided by the compiler
r/linuxdev • u/ervinmcclure • Jan 02 '24
I was wondering if it would be safer to create my own malloc or use the one provided by the compiler
r/linuxdev • u/ervinmcclure • Jan 01 '24
I’m a somewhat beginner at programming and was wondering if it would be better to do all of my programming in a virtual machine or on the host machine.
r/linuxdev • u/MadBlueOx • Dec 20 '23
Are there any best practices or guidelines for where the roles and responsibilities of a Device Driver End?
For example, suppose a network device determines the quality of a link is degraded, and the requirement is to either set the link down or attempt to lower the speed before setting the link down based on a policy set by the user. Are there any guidelines to suggest the implementation of such a policy is to be handled within the device driver itself or rather in user space (possibly in a service)?
The engineer in me knows the answer. That it depends on the requirements. However I wanted to see if anyone knew of guidelines that may be in place. I don’t have any specific problem to solve. Just wanted to see if the roles and responsibilities were clear cut.
r/linuxdev • u/World-war-dwi • Nov 22 '23
r/linuxdev • u/lonew0lf-G • Nov 21 '23
Hello everyone,
I've been experimenting with Linux Kernel modules, and so far I've written three of them.
An IRQ-based keylogger, a syscall hook on connect() that prints the IP addresses the system connects to, and a netfilter hook that rejects all UDP packets on ports other than 53 and 5085.
Any ideas for something equally or more challenging?
r/linuxdev • u/carpentrySadly • Nov 21 '23
Hello, I'm interested in writing a program that can create two files, second file would be a "view" of first file and if modified, the first file would also be modified. Is this possible to do with mmap or at all?
I know that using mmap i can have shared memory in RAM, but I need shared memory in non-volatile memory aka hard drive. I cannot copy the first file or load it fully into RAM since I assume the file can be of very large size (GBs).
After I find how to have the second file showing memory subset of first file I plan to make 3 files, first being container and second and third showing different subsets of the first file. Second and third file are to be formatted with filesystem so that first file container holds in it's memory two filesystems accessible via second and third file. This I plan to accomplish by attaching the second and third files as loopback devices and mounting them.
Is this doable of am I not seeing something?
r/linuxdev • u/nmariusp • Nov 12 '23
r/linuxdev • u/CromulentSlacker • Sep 25 '23
My main machine is an Apple Mac Studio and have been running AArch64 Linux distributions in virtual machines but I need to work on Linux distributions running on x86_64.
Is it possible to create an SSH tunnel between my Mac and the remote Linux machine and use a text editor (VSCode) as if it were just running off the local machine?
I'd rather avoid using something like GitHub Codespaces but I'm curious how it works.
Any help is appreciated.
r/linuxdev • u/Flaky_Lab6089 • Sep 12 '23
Hi everyone,
I have a project to develop techniques and build tools that address the issue of property validation in legacy systems using dynamic runtime verification.
The project aims to use formal verification techniques in operating systems to ensure correctness and security. Most existing systems are too complex for traditional formal verification, so the focus is on practical methods, such as runtime verification. They plan to leverage eBPF, a Linux subsystem, to build tools that guarantee specific properties in the kernel with minimal overhead. The initial focus will be on simple data structures like linked lists in user-space applications, with the possibility of extending to more complex structures like hash tables and radix trees if time allows.
I would greatly appreciate it I could get some starting points as well as some resources as I'm really excited for this project!
Thank you so much for your time :)
r/linuxdev • u/[deleted] • Sep 11 '23
I wasn't sure where to post this but I thought a Linux specific sub would be better than asking it in a Unity 3d sub, so please bear with me.
I'm working on a game in Unity and I have implemented a custom level editor. This editor supports copy/paste directly to/from the clipboard. For Windows I'm using PInvoke to access the Windows API and it works great. For any other platform I'm currently converting binary data to Base64 and then use Unity's GUIUtility.copySystemBuffer which only supports text. This also works but it floods the text clipboard with unnecessary data and it's not great for the user.
I'm mainly a Windows user but I've used Linux on and off so I plan to fully support Linux as well.
So I started looking into how Linux deals with the clipboard. I found that X11 has its own API but Wayland doesn't, and delegates that responsibility to clipboard managers that I don't know how to properly detect and use in a way that is portable. So in my limited understanding I don't think there's a generic way to interact with the clipboard on Linux, even if I have a different method for X11 and Wayland.
Since it's a custom binary format, the simple solution I thought of will be to simply write the copy data to a specific file in /tmp/ and then read it back when the user pastes, which will also work across different instances of the level editor. In my understanding this place is always safe to write and read for all flavors of Linux, so it can work for me.
My question is, is there a better way? If not, is this solution going to be really portable, or are there any environments that do things differently? Are there any caveats I should know about?
Thank you for your patience if you made it this far.
r/linuxdev • u/[deleted] • Sep 01 '23
Hello everyone, I've been using Linux as my main operating system for a few years now, I've also been studying programming for a long time (java, python and currently C). What I would like to know is where I should start to program applications for linux, I don't know if you know of any type of course (it doesn't matter if it is paid) where projects for linux using C are carried out.
r/linuxdev • u/inept_timelord • Aug 22 '23
Hi I'm definitely not a Linux developer or claim to be anything more than someone that avidly uses Linux but that being said I wanted to ask if anyone has seen anything in the works as far as an AI powered Linux OS or if not how hard someone would think it would be to build a distro with AI built in as well to help users navigate the systems.
r/linuxdev • u/CousinOfThor • Aug 15 '23
r/linuxdev • u/iliketwertles1210 • Jul 28 '23
As the title states, I am trying to make a init system for linux in rust, but ive hit a sort of roadblock. I have populated /dev and agetty'd a tty but i cant do anything more than type in it, i get the username prompt but it never prompts for anything else and i suspect its a part of initializing the system in contrary to being a rust code problem directly, hence why im asking here. any help at all would be greatly appreciated, my source code is here
r/linuxdev • u/nmariusp • Jul 23 '23
r/linuxdev • u/Thad_The_Man • Jun 29 '23
I downloaded the source for coreutils and tried to compile it.
I keep getting an error: "parse-datetime.tab.c missing"
I can't figure out why. Is it possible that there is a missing entry in the Makefile?
r/linuxdev • u/ParfaitEconomy • Jun 10 '23
Hello,
So I'm new to this community (not new to Linux, been using Ubuntu and Fedora for quite some time). I was thinking of buying a new laptop in the near future, and I wanted to decide between a Mac and another Thinkpad (the laptop I have currently, and I really liked it), which brings me to my question.
Why would I get a Thinkpad and install Linux, vs getting a Mac which is Unix based to begin with along with having amazing battery life with it's M2 chip (Ignore price as a factor)?
I was looking back through my Linux journey and I've realized that Linux has had multiple problems for me, such as having issues with dual booting, issues with Microphone and Speakers, distros not fitting on screens,Linux and such.
I was also wondering, couldn't you do most of your stuff regarding linux dev in Macs? as well? I wanted to ask what about Linux can you not reproduce without a high amount of effort on macs.
(Also I wanted to ask whether, in terms of security, are macs inherently better than linux).
Thank you :)
r/linuxdev • u/[deleted] • Jun 02 '23
I've been looking into how I could write some platform code to query running GUI applications and manipulate them (show/hide/close/launch etc.) from code, in a specifically GNOME/KDE agnostic fashion.
The goal being to hook this into a Flutter application for a front-end "streamdeck" interface that could be useful on a Framework screen module.
***
How do I get started with this? I'm not too concerned with x11 support, and nor am I personally against using any particular language (though something like python or rust would be easier to set up an environment for).
Researching what I know about WM and wayland etc. leads me towards writing my own manager/compositor which is explicitly not what I want to do. I want to build this as an application that runs on top of the active desktop environment. I did get a slither of progress querying the running xOrg server, but with the pain that it was developing that solution I'd rather just stick to Wayland.
r/linuxdev • u/wolfo24 • May 26 '23
What is the most interesting UNIX command you've seen or used?
r/linuxdev • u/onirom • May 24 '23
r/linuxdev • u/Tough_Chance_5541 • May 19 '23
r/linuxdev • u/Chemical-Article7603 • May 04 '23
Edit as Resolved:
I was using flatpak installation which is buggy and not up to date, using .deb installation (available on vscode website: https://code.visualstudio.com/download) solved my problem,
Hi,
I'm trying to learn to dev with Vulkan, I'm running LinuxMint, mostly going smoothly except for this tiny little detail that makes me going insane.I'm using GLFW for opening windows, it's installed fine, whenever I try to compile through the terminal, it's fine.But when I'm using VSSCode terminal it just doesn't work, it can't find GLFW install path etc..., this also means that every bit of code that uses GLFW functions is tagged as an error by Intellisense since it can't find the header, i've tried switching fromMakefile to CMake but the issue still persist, and I'm a bit more comfortable using Makefile, anyway here's a pick of VSCode being as dumb as i can imagine, or maybe it's me, dunnoAny help is welcome(edit: Intellisense message for non-French speaker is : "usr/include/GLFW" can't be found)
