From f23996b445422bdc79b4a16da63c740ae6bddda9 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
+ int atomic_symlink4 (char const *target, char const *name, char *buf, size_t len)
+Atomically makes a symlink named name pointing to target. If
+name designated an existing file, it is unlinked. Does not work if
+name is an existing directory (but will work if it is a
+symlink to a directory!) Returns 1 on success, and 0 (and sets errno) on
+error.
+In addition, if buf is not NULL, and points
+to a buffer of nonzero length len, then if name exists prior to the
+call, it must be a symbolic link, and its target be shorter than len bytes.
+If these conditions are fulfilled, the operation succeeds, and buf then
+contains the previous target of name, with a terminating NULL. If they are not,
+the function fails with 0 (errno is ENAMETOOLONG if the buffer is too small).
+