view dep/animia/include/animia/fd/linux.h @ 150:ffa535b6d630

*: avoid usage of std::[pair,tuple] https://arne-mertz.de/2017/03/smelly-pair-tuple/ it's better to use real structures and such where variables are easily known... also apparently using [] on structs is actually valid? I had no idea.
author Paper <mrpapersonic@gmail.com>
date Tue, 14 Nov 2023 16:27:33 -0500
parents aa4df5a84338
children 8700806c2cc2
line wrap: on
line source

#ifndef __animia__animia__fd__linux_h
#define __animia__animia__fd__linux_h

#include <vector>
#include <utility>
#include <string>
#include <set>

#include "animia/types.h"
#include "animia/fd.h"

/* Russian warship, go fuck yourself */
#ifdef linux
#undef linux
#endif

namespace animia::internal::linux {

class LinuxFdTools final : public BaseFdTools {
	public:
		bool GetAllPids(std::set<pid_t>& pids) override;
		bool GetProcessName(pid_t pid, std::string& result) override;
		bool EnumerateOpenFiles(const std::set<pid_t>& pids, std::vector<OpenFile>& files) override;
};

}

#endif // __animia__animia__fd__linux_h