mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-25 01:16:30 -05:00
Revert removal of readdir init setup, simplify cfg usage (#1520)
This commit is contained in:
parent
99c28ad3bc
commit
f64ff9ca1e
42 changed files with 388 additions and 426 deletions
21
src/thread_info.hpp
Normal file
21
src/thread_info.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include "fs_lstat.hpp"
|
||||
|
||||
namespace thread_info
|
||||
{
|
||||
static
|
||||
inline
|
||||
int
|
||||
process_count()
|
||||
{
|
||||
int rv;
|
||||
struct stat st;
|
||||
|
||||
rv = fs::lstat("/proc/self/task",&st);
|
||||
if(rv < 0)
|
||||
return rv;
|
||||
|
||||
return (st.st_nlink - 2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue