Update copyright for 2022
[pgsql.git] / src / port / link.c
blob1e0ccd4648a582ad0951f0a52860b7a998626642
1 /*-------------------------------------------------------------------------
3 * link.c
5 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
6 * Portions Copyright (c) 1994, Regents of the University of California
9 * IDENTIFICATION
10 * src/port/link.c
12 *-------------------------------------------------------------------------
15 #include "c.h"
17 #ifdef WIN32
19 int
20 link(const char *src, const char *dst)
23 * CreateHardLinkA returns zero for failure
24 * https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinka
26 if (CreateHardLinkA(dst, src, NULL) == 0)
28 _dosmaperr(GetLastError());
29 return -1;
31 else
32 return 0;
35 #endif