mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-19 22:46:34 -05:00
22 lines
254 B
C++
22 lines
254 B
C++
|
|
#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);
|
||
|
|
}
|
||
|
|
}
|