mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 07:53:06 +01:00
aa3360f88a
PR-URL: https://github.com/nodejs/node/pull/32132 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
18 lines
342 B
C
18 lines
342 B
C
#include <assert.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
|
|
#define OLD "/sandbox/input.txt"
|
|
#define NEW "/tmp/output.txt"
|
|
|
|
int main() {
|
|
struct stat st_old;
|
|
struct stat st_new;
|
|
|
|
assert(0 == stat(OLD, &st_old));
|
|
assert(0 == link(OLD, NEW));
|
|
assert(0 == stat(NEW, &st_new));
|
|
assert(st_old.st_ino == st_new.st_ino);
|
|
return 0;
|
|
}
|