Skip to content
suit Artifact [af1b8d9b45]
Login

Artifact [af1b8d9b45]

Artifact af1b8d9b453e893026435524d28887062ebb79c0fb16d4922b32a6ec2764156e:


#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