true(1), false(1): adds pledge(2) and unveil(2) support

This commit is contained in:
Emma Tebibyte 2024-08-10 12:50:51 -06:00
parent 1f59a9806e
commit cf96a13419
Signed by: emma
GPG Key ID: 06FA419A1698C270
2 changed files with 21 additions and 4 deletions

View File

@ -1,9 +1,18 @@
/* /*
* Copyright (c) 2023 Emma Tebibyte <emma@tebibyte.media> * Copyright (c) 20232024 Emma Tebibyte <emma@tebibyte.media>
* SPDX-License-Identifier: CC0 * SPDX-License-Identifier: CC0
* *
* This work is marked with CC0 1.0. To view a copy of this license, visit * This work is marked with CC0 1.0. To view a copy of this license, visit
* <http://creativecommons.org/publicdomain/zero/1.0>. * <http://creativecommons.org/publicdomain/zero/1.0>.
*/ */
int main() { return 1; } #ifdef __OpenBSD__
# include <unistd.h> /* pledge(2) */
#endif
int main() {
#ifdef __OpenBSD__
pledge(NULL, NULL);
#endif
return 1;
}

View File

@ -1,9 +1,17 @@
/* /*
* Copyright (c) 2023 Emma Tebibyte <emma@tebibyte.media> * Copyright (c) 20232024 Emma Tebibyte <emma@tebibyte.media>
* SPDX-License-Identifier: CC0 * SPDX-License-Identifier: CC0
* *
* This work is marked with CC0 1.0. To view a copy of this license, visit * This work is marked with CC0 1.0. To view a copy of this license, visit
* <http://creativecommons.org/publicdomain/zero/1.0>. * <http://creativecommons.org/publicdomain/zero/1.0>.
*/ */
int main() {} #ifdef __OpenBSD__
# include <unistd.h> /* pledge(2) */
#endif
int main() {
#ifdef __OpenBSD__
pledge(NULL, NULL);
#endif
}