Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: |
2 | * | ||||
Rob Landley | c92fde0 | 2007-04-23 15:45:55 -0400 | [diff] [blame] | 3 | * sync.c - Write all pending data to disk. |
Rob Landley | fece5cb | 2007-12-03 20:05:57 -0600 | [diff] [blame] | 4 | * |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 5 | * Copyright 2007 Rob Landley <rob@landley.net> |
6 | * | ||||
Rob Landley | fece5cb | 2007-12-03 20:05:57 -0600 | [diff] [blame] | 7 | * Not in SUSv3. |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 8 | |
Rob Landley | 55928b1 | 2008-01-19 17:43:27 -0600 | [diff] [blame] | 9 | USE_SYNC(NEWTOY(sync, NULL, TOYFLAG_BIN)) |
10 | |||||
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 11 | config SYNC |
12 | bool "sync" | ||||
13 | default y | ||||
14 | help | ||||
15 | usage: sync | ||||
16 | |||||
17 | Write pending cached data to disk (synchronize), blocking until done. | ||||
18 | */ | ||||
Rob Landley | c92fde0 | 2007-04-23 15:45:55 -0400 | [diff] [blame] | 19 | |
20 | #include "toys.h" | ||||
21 | |||||
Rob Landley | efda21c | 2007-11-29 18:14:37 -0600 | [diff] [blame] | 22 | void sync_main(void) |
Rob Landley | c92fde0 | 2007-04-23 15:45:55 -0400 | [diff] [blame] | 23 | { |
24 | sync(); | ||||
Rob Landley | c92fde0 | 2007-04-23 15:45:55 -0400 | [diff] [blame] | 25 | } |