mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.1K
active users

#posix

7 posts6 participants0 posts today

POSIX people, I need a tool recommendation:

I want a tool that will listen on stdin for a tar file and run a commandline for every file encountered, with the file being piped to it.

Ideally, I don't want things to touch the disk, because the tar file and files within it are likely to be big.

Is there a POSIX-style tool for this?

I'm trying to add "genric" #signal handling to #poser. Ultimate goal is to provide a way for #swad to handle #SIGHUP, although signal handling must be done in poser's main event loop (signals are only ever unblocked while waiting for file descriptor events).

Okay, I could just add explicit handling for SIGHUP. But a generic solution would be nicer. Just for example, a consumer might be interested in #SIGINFO which doesn't even exist on all platforms ... 🤔

Now, #POSIX specs basically just say signal constants are "integer values". Not too helpful here. Is it safe to assume an upper bound for signal numbers on "real world" OS implementations, e.g. 64 like on #Linux? Should I check #NSIG and, if not defined, just define it to 64? 🙈

Continued thread

The KDE team has created a wonderful Network for your Androids it's called Konnect and the things that it can do are so various that I'll just show you one of them in the included photographs

The ease with which I can control a music 🎵 player that works on one Android from all my devices which run Konnect opens up possibilities which are just marvelous for a sound engineer like me

#KDE#Xorg#Desktop

Revisiting #async / #await in #POSIX C, trying to "add some #security" 🙈

Recap: Consider a classic #reactor-style service in C with a #threadpool attached to run the individual request handlers. When such a handler needs to do some I/O, it'll have to wait for its completion, and doing so is kind of straight forward by just blocking the worker thread executing the job until whatever I/O was needed completes.

Now, blocking a thread is never a great thing to do and I recently tooted about an interesting alternative I found: Make use of the (unfortunately deprecated) POSIX user context switching to enable releasing the worker thread while waiting. In a nutshell, you create a context with #makecontext that has its own private #stack, and then you can use #swapcontext to get off the thread, and later again to get back on the thread. A minor issue is: It must be the *same* thread ... so you might have to wait until it completes something else before you can resume your job. But then, that's probably okayish, you can make sure in your job scheduling to only use worker threads with awaited tasks attached when no other thread is available.

In my first implementation, I just used #malloc to create a 64kiB private stack for each thread job. That's perfectly fine if you can guarantee your job will never consume more stack space, AND it won't have any vulnerabilities allowing some attacker to mess with the stack. But in practice, especially for a library offering this async/await implementation, it's nothing but a wild #CVE generator.

So, I now improved on that:

* Allocate a much larger stack of now 2MiB. That alone makes issues at least less likely. And on a sane modern OS, we can still assume pages will only be mapped "on demand".
* Only allocate the stack directly before running the thread job, and delegate allocation to some internal "stack manager" that keeps track of all allocated stacks and reuses them, only freeing them on exit. This should avoid most of the allocation overhead.
* If MAP_ANON / MAP_ANONYMOUS is available, use #mmap for allocating the stack. That at least gives a chance to stay away from other allocations ....
* But finally, if MAP_STACK is available, use this flag! From my research, #FreeBSD, #OpenBSD and #NetBSD will for example make sure there's at least one "guard page" below a stack mapped with this flag, so a stack overflow consistently takes the SIGSEGV emergency exit 😆. #Linux knows this flag as well, but doesn't seem to implement such protection at this time ... 🤔

Linus Torvalds has proper motivated reasons for really disliking file systems without a case sensitivity.

Read this with me from the kernel lkml, regarding bcachefs.

Re: [GIT PULL] bcachefs fixes for 6.15-rc4 - Linus Torvalds
lore.kernel.org/lkml/CAHk-=wja

🖋️ #bash #sh #zsh #ksh #csh #tcsh #fish #git #Linux #lkml #POSIX #FOSS #100daysofCode #640DaysOfCode #coding #1024DaysOfCode #github #programming #Torvalds #filesystem

Replied in thread

I still need some more feel at home config help. As you can see here I love having vertical gradients on my displays, but in KDE and Vallpaper I have not found how I can set gradients on the side of my wallpaper which are deliberately not 16:9 since I love to look at (vertical) gradients. Where do I need to look to achieve that? Is there a KDE action that I need to define for all my 20 KDE desktops?

.🖋️ #xFace #KDE #bash #MX #mxLinux #sh #zsh #ksh #csh #tksh #fish #distro #gPartEd #Gnome #Linux #POSIX #fresh #programming #hugo #gvfs #backgrounds #wallpaper #Vallpaper #gufw

In 2005, Google paid $50 million to a software engineer called Andy Rubin, together with his team for a dying phone company giving away their FREE software.

Critics called it the "dumbest acquisition ever."
Today, that "dumb decision" is worth over $500 BILLION and is the reason why you are holding a less expensive but quality phone that is not an iPhone

Here's how Google saw the future before anyone else: and built the world's most used mobile device - Android phones

It all started with a tiny company called Android Inc.

Founded by 4 top tech entrepreneurs and business executives, Led by Andy Rubin.

Their goal?
To create smarter mobile devices
that are more aware of their owner's location and preferences, and an operating system that is completely free & open-source.

Any manufacturer could use, modify, or make it their own. But at this time, this seemed insane.

Because the company was struggling financially:

No products.
No revenue.
Just 4 guys and a dream.
To make it worse, the mobile phone industry was locked down tight by software giants:

• Nokia controlled its software
• Microsoft charged for Windows Mobile
• BlackBerry kept everything in-house

The idea of giving away a free Mobile phone Operating system (OS) was Laughable.

But Google, just as they saw the future of YouTube, saw something much bigger - Mobile phones would become the primary way people access the internet. With that google search engine will be irresistible

They weren't buying software.
They were buying the future of computing.

To protect their search engine business, they pushed to buy

This was the real threat:
If Microsoft or Nokia dominated mobile, they could:
• Block Google Search
• Push their own services
• Control the future of digital advertising

Google couldn't let that happen.

So they made their boldest move yet. Buy out the entire company, not just the product.

But they didn't just buy Android. They kept it open-source.
Why?
This was genius because they wanted:
• To give Phone makers free software,
• help Android developers get a free platform
• Help Users have more choices.

Result? Companies like Samsung, Huawei, HTC can distribute their Android devices freely

Everyone won...

Except Google's competitors. 😁
Blackberry
Nokia
Microsoft
Because within 10 years of Android's free open-source purchase, their company was gone.

wondering why you have not seen them again today.
Cos' everyone prefers an open-source free phone where you don't have to pay for anything after the initial purchase.

That's the masterstroke
In 2008, the first Android phone was launched;

The HTC Dream (T-Mobile G1)

It wasn't pretty.
It wasn't smooth.

But it was the beginning of a revolution...
Because Google did something unprecedented:
They gave manufacturers complete freedom:

• Change the interface
• Add new features
• Customize everything
This sparked an explosion of innovation...

Companies like Samsung, HTC, LG, and others could now compete with Apple without building an OS from scratch.

The result?

Android powers 71% of all smartphones worldwide.

That's billions of devices running Google's software.
But here's what makes this truly genius:

In everything Google builds, it always finds a way to monetize.

How does Google make money from its $50 million investment?

The truth is, Google doesn't make money from Android directly.
Instead, they make money from:
• Play Store fees
• Google Search
• Digital advertising
• User data
The platform is free, but the ecosystem is priceless.

This $50M bet didn't just transform mobile.
It transformed how we:
• Connect
• Shop
• Work
• Live

The lesson?
Sometimes the biggest opportunities look like the riskiest bets.
Google's Android gamble teaches us:
The best investments aren't about what something is today.
They're about what something could become tomorrow.
And sometimes, giving away value is the best way to capture it.

Source FB

Replied in thread

Im starting to achieve platform distro OS translucency regarding more and more projects. Now I can smoothly work in my hugo projects from any distro I want in Linux. All I need to do is keep the copies I work on in sync.
Since I dont run zfs jet on a centralized HDD / SSD I simply use mc -a to do the job manually.
Normally it should be trivial, but the hugo projects want rm -Rf dir otherwise old files with similar size can be changed, thus screwing up continuity

Since my KDE MX install is moothing out in cfg features I need, which is a combo of XFce components and KDE, I can smoothly switch to the KDE distro and work further while I tune it.

I chose to keep XFce seperate from KDE distro wise due to size constraints I;ve put on my boot partition

.🖋️ #bash #MX #mxLinux #sh #zsh #ksh #csh #tksh #fish #distro #gPartEd #xFace #KDE #Gnome #Linux #POSIX #fresh #programming #backgrounds #wallpaper #Vallpaper #gufw

I figured #swad's password file management tool (swadpw) should really *ensure* that when reading a password from the #terminal, prompts are printed to exactly that terminal.

Well, I already check whether standard input *is* a terminal. In that case, I assume it *should* be writable. It certainly *is* writable on #FreeBSD and #Linux. But I can't find any guarantee looking at #POSIX specs 🤔.

Ok, so I wrote a weirdo function to provide fallbacks. 🤪 Is this taking it too far? And how would I ever test these fallbacks? 🙈

Just released: #swad v0.3!

github.com/Zirias/swad/release

swad is the "Simple Web Authentication Daemon", your tiny, efficient and (almost) dependency-free solution to add #cookie + login #form #authentication to whatever your #reverse #proxy offers. It's written in pure #C, portable across #POSIX platforms. It's designed with #nginx' 'auth_request' in mind, example configurations are included.

This release brings a file-based credential checker in addition to the already existing one using #PAM. Also lots of improvements, see details in the release notes.

I finally added complete build instructions to the README.md:

github.com/Zirias/swad

And there's more documentation available: manpages as well as a fully commented example configuration file.