commit: 485fcdabfa1c79499b29554eb6e1c2b3bb441c93
parent 19f4662eeb0e6db7c60772cb438624cadd56fd49
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 27 Dec 2021 15:44:50 +0100
bin/sync: Add
Diffstat:
4 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/bin/Makefile.config b/bin/Makefile.config
@@ -1,2 +1,2 @@
-EXE = args basename cat date del dirname echo false humanize lolcat mdate pwd range sizeof sname strings tee true tty xcd
-MAN1 = basename.1 date.1 del.1 dirname.1 echo.1 humanize.1 lolcat.1 sname.1
+EXE = args basename cat date del dirname echo false humanize lolcat mdate mknod pwd range sizeof sname strings sync tee true tty xcd-256 xcd xrd
+MAN1 = basename.1 date.1 del.1 dirname.1 echo.1 humanize.1 lolcat.1 sname.1 sync.1
diff --git a/bin/sync.1 b/bin/sync.1
@@ -0,0 +1,22 @@
+.\" Collection of Unix tools, comparable to coreutils
+.\" Copyright 2017-2021 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+.\" SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
+.Dd 2021-12-27
+.Dt SYNC 1
+.Os
+.Sh NAME
+.Nm sync
+.Nd Schedule file system updates
+.Sh SYNOPSIS
+.Nm
+.Sh DESCRIPTION
+.Nm
+shall cause all information in memory that updates file systems to be scheduled for writing out to all file systems.
+.Sh EXIT STATUS
+.Ex -std
+.Sh SEE ALSO
+.Xr sync 2
+.Sh STANDARDS
+No applicable one known.
+.Sh AUTHORS
+.An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me
diff --git a/bin/sync.c b/bin/sync.c
@@ -0,0 +1,14 @@
+// Collection of Unix tools, comparable to coreutils
+// Copyright 2017-2021 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
+
+#define _XOPEN_SOURCE 700 // XSI but not mere POSIX
+#include <unistd.h> // sync()
+
+int
+main(void)
+{
+ // Maybe consider hooking up to fsync(3p)
+ sync();
+ return 0;
+}
diff --git a/coreutils.txt b/coreutils.txt
@@ -80,7 +80,7 @@ stat: Todo
stdbuf: No.
stty: Todo
sum: No.
-sync: Todo
+sync: Done
tac: Todo
tail: ?
tee: Todo