Skip to content
suit Documentation
Login

Documentation

#ifndef SUIT_PLATFORM_H
#define SUIT_PLATFORM_H

// The only file that knows which operating system this is.

#include <stddef.h>
#include <stdint.h>
#include <sys/resource.h>
#include <sys/stat.h>

#define PLATFORM_TRUE_PATH "/usr/bin/true"

int64_t platform_mtime_sec(const struct stat *st);
int64_t platform_mtime_nsec(const struct stat *st);

// Peak resident size from a wait4 result, in bytes.
uint64_t platform_peak_resident(const struct rusage *ru);

// Absolute path of the running program. False if it does not fit in CAP.
bool platform_self_path(char *buf, size_t cap);

#endif