aboutsummaryrefslogtreecommitdiff
path: root/file_io/unix
diff options
context:
space:
mode:
authorBojan Smojver <bojan@apache.org>2008-07-25 00:17:04 +0000
committerBojan Smojver <bojan@apache.org>2008-07-25 00:17:04 +0000
commite8957cc62709498baced8306437be67a91c46303 (patch)
tree31bec45d0db517020fac20f3aca541ab72c7954a /file_io/unix
parent4927c82930004283fdcdccf39e26f500590ecea8 (diff)
downloadapr-e8957cc62709498baced8306437be67a91c46303.tar.gz
apr-e8957cc62709498baced8306437be67a91c46303.zip
Add apr_file_link() function.
PR 44841. Patch by Mark Heily <mark heily.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@679630 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix')
-rw-r--r--file_io/unix/copy.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
index 3a1c59a62..d8c1702d7 100644
--- a/file_io/unix/copy.c
+++ b/file_io/unix/copy.c
@@ -116,3 +116,13 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path,
perms,
pool);
}
+
+APR_DECLARE(apr_status_t) apr_file_link(const char *from_path,
+ const char *to_path)
+{
+ if (link(from_path, to_path) == -1) {
+ return errno;
+ }
+
+ return APR_SUCCESS;
+}