diff options
Diffstat (limited to 'programs/env')
| -rw-r--r-- | programs/env/CMakeLists.txt | 19 | ||||
| -rw-r--r-- | programs/env/imports | 1 | ||||
| -rw-r--r-- | programs/env/include/sys/mount.h | 25 | ||||
| -rw-r--r-- | programs/env/private_include/env.h | 25 | ||||
| -rw-r--r-- | programs/env/src/CMakeLists.txt | 19 | ||||
| -rw-r--r-- | programs/env/src/mount.c | 27 |
6 files changed, 116 insertions, 0 deletions
diff --git a/programs/env/CMakeLists.txt b/programs/env/CMakeLists.txt new file mode 100644 index 0000000..5d2e650 --- /dev/null +++ b/programs/env/CMakeLists.txt @@ -0,0 +1,19 @@ +# wnix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +add_library(wnix_env) +add_subdirectory(src) +target_include_directories(wnix_env PUBLIC include PRIVATE private_include) diff --git a/programs/env/imports b/programs/env/imports new file mode 100644 index 0000000..f82bd6e --- /dev/null +++ b/programs/env/imports @@ -0,0 +1 @@ +wnix_mount diff --git a/programs/env/include/sys/mount.h b/programs/env/include/sys/mount.h new file mode 100644 index 0000000..eae6d63 --- /dev/null +++ b/programs/env/include/sys/mount.h @@ -0,0 +1,25 @@ +/* + * wnix, a Unix-like operating system for WebAssembly applications. + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#ifndef _SYS_MOUNT_H +#define _SYS_MOUNT_H + +int mount(const char *__src, const char *__tgt, const char *__type, + unsigned long __flags, const void *__args); + +#endif diff --git a/programs/env/private_include/env.h b/programs/env/private_include/env.h new file mode 100644 index 0000000..5f78d51 --- /dev/null +++ b/programs/env/private_include/env.h @@ -0,0 +1,25 @@ +/* + * wnix, a Unix-like operating system for WebAssembly applications. + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#ifndef ENV_H +#define ENV_H + +int wnix_mount(const char *src, const char *tgt, const char *type, + unsigned long flags, const void *args, int *error); + +#endif diff --git a/programs/env/src/CMakeLists.txt b/programs/env/src/CMakeLists.txt new file mode 100644 index 0000000..644c2f0 --- /dev/null +++ b/programs/env/src/CMakeLists.txt @@ -0,0 +1,19 @@ +# wnix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +target_sources(wnix_env PRIVATE + mount.c +) diff --git a/programs/env/src/mount.c b/programs/env/src/mount.c new file mode 100644 index 0000000..8cd63f8 --- /dev/null +++ b/programs/env/src/mount.c @@ -0,0 +1,27 @@ +/* + * wnix, a Unix-like operating system for WebAssembly applications. + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#include <sys/mount.h> +#include <env.h> +#include <errno.h> + +int mount(const char *const src, const char *const tgt, const char *const type, + const unsigned long flags, const void *const args) +{ + return wnix_mount(src, tgt, type, flags, args, &errno); +} |
