24 QI_API FILE*
fopen(
const char *filename,
const char *mode);
36 QI_API bool fnmatch(
const std::string &pattern,
const std::string &
string);
40 QI_API int snprintf(
char *str,
size_t size,
const char *format, ...);
68 QI_API void *
dlopen(
const char *filename,
int flag = -1);
70 QI_API void *
dlsym(
void *handle,
const char *symbol);
83 QI_API std::map<std::string, std::vector<std::string> >
hostIPAddrs(
bool ipv6Addr =
false);
100 #endif // _QI_OS_HPP_
int getpid()
Get the process identifier.
qi::os::timeval operator+(const qi::os::timeval &lhs, const qi::os::timeval &rhs)
int gettimeofday(qi::os::timeval *tp)
The gettimeofday() function shall obtain the current time.
QI_API_DEPRECATED const char ** argv()
Deprecated, see detailed description.
QI_API_DEPRECATED std::string tmpdir(const char *prefix="")
std::string currentThreadName()
bool fnmatch(const std::string &pattern, const std::string &string)
const char * dlerror(void)
Returns a human readable string of the error code.
unsigned short findAvailablePort(unsigned short port)
Find the first available port starting at port number in parameter.
std::string gethostname()
Get the system's hostname.
std::pair< int64_t, int64_t > cputime()
int system(const char *command)
int64_t int64_t
Cross-platform signed integer of length 64 bits (8 bytes).
int kill(int pid, int sig)
Send a signal to a process.
void setCurrentThreadName(const std::string &name)
Set the current thread name to the string in parameter.
FILE * fopen(const char *filename, const char *mode)
Open a file and returns and handle on it.
void msleep(unsigned int milliseconds)
Sleep for the specified number of milliseconds.
int stat(const char *filename, struct stat *pstat)
std::string getMachineId()
Returns an unique uuid for the machine.
int snprintf(char *str, size_t size, const char *format,...)
char * strdup(const char *src)
#define QI_API_DEPRECATED
Compiler flags to mark a function as deprecated. It will generate a compiler warning.
std::string mktmpdir(const char *prefix="")
Return a writable temporary directory.
std::string generateUuid()
int spawnvp(char *const argv[])
size_t memoryUsage(unsigned int pid)
std::map< std::string, std::vector< std::string > > hostIPAddrs(bool ipv6Addr=false)
Find all network adapters and corresponding IPs.
bool setCurrentThreadCPUAffinity(const std::vector< int > &cpus)
void sleep(unsigned int seconds)
void * dlsym(void *handle, const char *symbol)
Get the address where the symbol is loaded into memory.
dll import/export and compiler message
int spawnlp(const char *argv,...)
qi::os::timeval operator-(const qi::os::timeval &lhs, const qi::os::timeval &rhs)
int waitpid(int pid, int *status)
int setenv(const char *var, const char *value)
std::string home()
Return path to the current user's HOME.
int dlclose(void *handle)
Decrements the reference count on the dynamic library.
void * dlopen(const char *filename, int flag=-1)
Load a dynamic library.
std::string getenv(const char *var)
Get an environment variable.
int gettid()
Get the thread identifier.