mirror of https://github.com/postgres/postgres
This way we can make use of it in other components as well, and it fits better with the rest of the build system. Discussion: https://www.postgresql.org/message-id/flat/72fff73f-dc9c-4ef4-83e8-d2e60c98df48%402ndquadrant.compull/51/head
parent
d677550493
commit
0ad6f848ee
@ -0,0 +1,35 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* link.c |
||||
* |
||||
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* |
||||
* IDENTIFICATION |
||||
* src/port/link.c |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "c.h" |
||||
|
||||
#ifdef WIN32 |
||||
|
||||
int |
||||
link(const char *src, const char *dst) |
||||
{ |
||||
/*
|
||||
* CreateHardLinkA returns zero for failure |
||||
* https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinka
|
||||
*/ |
||||
if (CreateHardLinkA(dst, src, NULL) == 0) |
||||
{ |
||||
_dosmaperr(GetLastError()); |
||||
return -1; |
||||
} |
||||
else |
||||
return 0; |
||||
} |
||||
|
||||
#endif |
Loading…
Reference in new issue