Skip to content

kekse1/nproc.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nproc.c

This tool is one of the coreutils which outputs the amount of available processor cores/threads.

Once I had to deal with the 'Raptor Lake' bug of Intel processors, which caused segmentation faults ('Speicherzugriffsfehler') when I compiled some projects (with the gcc).

I didn't find out how to adapt the core/thread count (this was a thing of the apt util, not the regular MAKEFLAGS or so), and I already knew the compilation worked with less cores/threads, so I implemented this tiny helper (for my purposes).

Description

Either it'll print out the real core/thread count as usual, or it can also print a value you select for yourself by setting the NPROC environment variable to your needs.

Unset this variable in your environment to see the original/real values again. If value is lower than 1, it'll fallback to the real ones. That's all.. :-)

Implementation

I choosed regular ANSI C as programming language.

Download

  • nproc.c [Version v0.2.3; updated 2025-03-19];

BTW., it was born 2024-04-15.

Contact

Copyright and License

The Copyright is (c) Sebastian Kucharczyk, and it's licensed under the MIT (also known as 'X' or 'X11' license).

Favicon

About

Tiny extension to the `nproc` command

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages