Luna/libos/src/Security.cpp

23 lines
457 B
C++
Raw Normal View History

2023-08-14 08:45:00 +00:00
/**
* @file Security.cpp
* @author apio (cloudapio.eu)
* @brief Functions to restrict process operations.
*
* @copyright Copyright (c) 2023, the Luna authors.
*
*/
#include <errno.h>
#include <os/Security.h>
#include <unistd.h>
namespace os::Security
{
Result<void> pledge(const char* promises, const char* execpromises)
{
int rc = ::pledge(promises, execpromises);
if (rc < 0) return err(errno);
return {};
}
}