2023-02-27 13:40:20 +01:00
|
|
|
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
|
2022-08-22 16:40:08 +02:00
|
|
|
#include <nosv.h>
|
2022-09-29 15:34:44 +02:00
|
|
|
#include <unistd.h>
|
2022-08-22 16:40:08 +02:00
|
|
|
|
|
|
|
#include "common.h"
|
2023-03-22 19:06:18 +01:00
|
|
|
#include "compat.h"
|
2022-08-22 16:40:08 +02:00
|
|
|
|
2022-09-29 15:34:44 +02:00
|
|
|
int
|
|
|
|
main(void)
|
2022-08-22 16:40:08 +02:00
|
|
|
{
|
|
|
|
nosv_init();
|
|
|
|
|
|
|
|
nosv_task_t task;
|
2024-02-14 13:23:28 +01:00
|
|
|
if (nosv_attach(&task, NULL, "attached-task", 0) != 0)
|
2023-03-21 16:09:01 +01:00
|
|
|
die("nosv_attach failed");
|
2022-08-22 16:40:08 +02:00
|
|
|
|
2023-03-22 19:06:18 +01:00
|
|
|
sleep_us(100);
|
2022-08-22 16:40:08 +02:00
|
|
|
|
2022-09-29 15:34:44 +02:00
|
|
|
if (nosv_detach(0) != 0)
|
2023-03-21 16:09:01 +01:00
|
|
|
die("nosv_detach failed");
|
2022-08-22 16:40:08 +02:00
|
|
|
|
2022-09-29 15:34:44 +02:00
|
|
|
if (nosv_shutdown() != 0)
|
2023-03-21 16:09:01 +01:00
|
|
|
die("nosv_shutdown failed");
|
2022-08-22 16:40:08 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|