Kernel: Implement SYS_SYNC and add sync executable to userspace
You can (and have to) manually sync disk after writes to it.
This commit is contained in:
@@ -12,6 +12,7 @@ set(USERSPACE_PROJECTS
|
||||
Shell
|
||||
snake
|
||||
stat
|
||||
sync
|
||||
tee
|
||||
test
|
||||
touch
|
||||
|
||||
17
userspace/sync/CMakeLists.txt
Normal file
17
userspace/sync/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(sync CXX)
|
||||
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(sync ${SOURCES})
|
||||
target_compile_options(sync PUBLIC -O2 -g)
|
||||
target_link_libraries(sync PUBLIC libc)
|
||||
|
||||
add_custom_target(sync-install
|
||||
COMMAND sudo cp ${CMAKE_CURRENT_BINARY_DIR}/sync ${BANAN_BIN}/
|
||||
DEPENDS sync
|
||||
USES_TERMINAL
|
||||
)
|
||||
6
userspace/sync/main.cpp
Normal file
6
userspace/sync/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
sync();
|
||||
}
|
||||
Reference in New Issue
Block a user