kernel syscalls - How does it work?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

kernel syscalls - How does it work?

#1 Post by technosaurus »

Lets say I have a 2.6.38 kernel that is compiled with xz support. Is there a way to use syscalls to the kernel (in a C program) to decompress an xz file without having to use the userland tools?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

That's the transparent decompression mechanism as used by squashfs, cramfs, cloop, zisofs and now also ext4. They all depend on the kernel being able to do on-the-fly decompression of streams. And they each depend on a different program to create those filesystesms/images. From a regular C program, you'd want to use glibc calls along with small stream decompressor code. The in-kernel stuff is only useful at the filesystem level.

Post Reply